CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Timer1 clarification...

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ted Larson
Guest







Timer1 clarification...
PostPosted: Fri May 16, 2003 11:50 am     Reply with quote

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

View user's profile Send private message

Re: Timer1 clarification...
PostPosted: Fri May 16, 2003 1:22 pm     Reply with quote

:=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...
PostPosted: Fri May 16, 2003 6:36 pm     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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