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

setting RTCC_DIV_2 and RTCC_DIV_4

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








setting RTCC_DIV_2 and RTCC_DIV_4
PostPosted: Sun Mar 27, 2005 2:01 am     Reply with quote

Hi all

I am using Timer0 to set the sampling frequency. I have to work with 7 different frequency values. There are 7 different "if" statement and every statement uses its own sampling rate.
Forexample:1Khz,2Khz,3Khz,6Khz,8Khz,12Khz,16Khz so every time I need to set the setup_timer_0(RTCC_INTERNAL|RTCC_DIV_?); value. How can i do this with only one variable. Like a for
RTCC_DIV_2 and after that if i need RTCC_DIV_8, i shift a 2 bits.Is it possible??
Thanks

Best Regards
Mark



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

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

PostPosted: Sun Mar 27, 2005 8:25 am     Reply with quote

Read the datasheet on setting up the timers. You can do it manually. Beaware that there are only a few divide bys allowed. Read the datasheet and this will become more clear.
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