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 CCS Technical Support

Timer1 question

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



Joined: 09 Feb 2005
Posts: 48

View user's profile Send private message

Timer1 question
PostPosted: Fri Feb 25, 2005 9:39 am     Reply with quote

İf I use 16f877 with setting of the timer1 the following

setup_timer_1(T1_INTERNAL|T1_DIV_BY_8); //20MHz cristal


104,857ms time later interrupt occurs. My question is that if I define setup_timer with the same configuration like that

setup_timer_1(T1_INTERNAL|T1_DIV_BY_8 |T1_DIV_BY_8);

interrupt occurs at that time later 104,857*8=838,860ms doesn't it?
Humberto



Joined: 08 Sep 2003
Posts: 1215
Location: Buenos Aires, La Reina del Plata

View user's profile Send private message

PostPosted: Fri Feb 25, 2005 10:09 am     Reply with quote

Copied from the Compiler HELP:
_____________________________________________________________
SETUP_TIMER_1( )
Syntax:
setup_timer_1 (mode)
Parameters:
mode values may be:

- T1_DISABLED, T1_INTERNAL, T1_EXTERNAL, T1_EXTERNAL_SYNC

- T1_CLK_OUT

- T1_DIV_BY_1, T1_DIV_BY_2, T1_DIV_BY_4, T1_DIV_BY_8

constants from different groups may be or'ed together with |.
_____________________________________________________________

Hence, in your expresion:

setup_timer_1(T1_INTERNAL|T1_DIV_BY_8 |T1_DIV_BY_8);

T1_DIV_BY_8 | T1_DIV_BY_8 Is Not Valid because you are ORed
two constants of the same group.


Humberto
Mark



Joined: 07 Sep 2003
Posts: 2838
Location: Atlanta, GA

View user's profile Send private message Send e-mail

PostPosted: Fri Feb 25, 2005 10:43 am     Reply with quote

It will actually be the same since oring something with itself is the same. Read the datasheet on the PIC and you will see the available scalers or divide bys.
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