|
|
View previous topic :: View next topic |
Author |
Message |
Ted Larson Guest
|
Timer1 clarification... |
Posted: Fri May 16, 2003 11:50 am |
|
|
The CCS documentation for the call setup_timer1() states:
"...Timer 1 is a 16 bit timer. With an internal clock at 20mhz, the timer will increment every 1.6us. It will overflow every 104.8576ms."
How can this be true? Why is it that it doesn't increment every 200ns at the instruction cycle rate? Or is the documentation just wrong.
I haven't ever used timer1 before...so, I am just trying to get clear on the units it will return.
Thanks,
- Ted
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514512 |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
Re: Timer1 clarification... |
Posted: Fri May 16, 2003 1:22 pm |
|
|
:=The CCS documentation for the call setup_timer1() states:
:=
:="...Timer 1 is a 16 bit timer. With an internal clock at 20mhz, the timer will increment every 1.6us. It will overflow every 104.8576ms."
:=
:=How can this be true? Why is it that it doesn't increment every 200ns at the instruction cycle rate? Or is the documentation just wrong.
------------------------------------------------------
It would be true if you used the "divide by 8" prescaler.
The manual has a lot of incorrect examples. You'll notice
on that same page, they have this line:
setup_timer_1 ( T1_INTERVAL | T1_DIV_BY_8 );
Except, there is no "T1_INTERVAL" constant defined in any
of the .h files. It should be T1_INTERNAL.
And for some reason, CCS left out the index (Adobe calls it
"bookmarks") in the latest manual, making it almost useless.
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514513 |
|
|
Forest Guest
|
Re: Timer1 clarification... |
Posted: Fri May 16, 2003 6:36 pm |
|
|
The manual isn't quite clear in quite a few areas like that.
Have look at the FAQ's - "How is the TIMER0 interrupt used to perform an event at some rate?"
This is for TIMER0 but it goes for the other timers also - the explanation at the bottom helped me.
:=The CCS documentation for the call setup_timer1() states:
:=
:="...Timer 1 is a 16 bit timer. With an internal clock at 20mhz, the timer will increment every 1.6us. It will overflow every 104.8576ms."
:=
:=How can this be true? Why is it that it doesn't increment every 200ns at the instruction cycle rate? Or is the documentation just wrong.
:=
:=I haven't ever used timer1 before...so, I am just trying to get clear on the units it will return.
:=
:=Thanks,
:=
:=- Ted
:=
___________________________
This message was ported from CCS's old forum
Original Post ID: 144514518 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|