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 config

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







Timer1 config
PostPosted: Fri Aug 27, 2004 2:45 pm     Reply with quote

Hi, i need to use the timer1 on my 16f76 by interrupt. the pic runs at 18,432 MHZ.i want to realise an interrupt every about 1 second. what code do i have to put in my program?,could you please post it? sorry, i'm new in Pic programming! thanks
valemike
Guest







PostPosted: Fri Aug 27, 2004 2:55 pm     Reply with quote

Look at ex_stwt1.c

It uses Timer1 interrupts.

You would just need to redefine #INTS_PER_SECOND to:

18432000 / (4*4*65536) = 17.578

So choose 17 or 18 to be your #INTS_PER_SECOND definition. Unfortunately, 17.578 smack in the middle between 17 and 18, so choose your pick.

-Mike
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