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

Time

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



Joined: 06 May 2012
Posts: 2

View user's profile Send private message

Time
PostPosted: Mon May 07, 2012 2:47 am     Reply with quote

I want C code as example of how I can set a timer (ie. 5 minutes, 1hour ..etc) using pic18f452 with clock frequency 8MHz.
for example if the time pass (5 minutes, 1hour) a led connected with PIC will turn on forever till another condition happen make it off.

another question
Time= (4x clock period ) x Prescaler x (256 - TMR0L)
what is the difference between prescaler 8 , 1, 32.. etc ? what these numbers mean ? what are the affect they made
_________________
MKA
SherpaDoug



Joined: 07 Sep 2003
Posts: 1640
Location: Cape Cod Mass USA

View user's profile Send private message

PostPosted: Mon May 07, 2012 6:21 am     Reply with quote

You should really read the datasheet for your PIC. The Timer section of the datasheet will tell you about the prescaler and give you an idea how your program should work.
_________________
The search for better is endless. Instead simply find very good and get the job done.
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