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

problem concerning timer

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



Joined: 24 Mar 2015
Posts: 8
Location: Syria

View user's profile Send private message

problem concerning timer
PostPosted: Tue Mar 24, 2015 3:39 pm     Reply with quote

hey there :
I'm using PIC16F877A.
I've read a lot about dealing with timer but I didn't get how am I supposed to code the ISR to make the PIC count one second.
My problem is with the prescaler thing and its calculations.
help please Smile
asmboy



Joined: 20 Nov 2007
Posts: 2128
Location: albany ny

View user's profile Send private message AIM Address

PostPosted: Tue Mar 24, 2015 4:10 pm     Reply with quote

the prescaler on timer 0,1,3 counts Fosc/4,
further divided by the prescaler divisor.
the timer in question sets it's interrupt flag on overflow -
and that is what calls your ISR.


What is your take away from reading the manual on the topic
setup_timer_x()

???
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Mar 24, 2015 10:05 pm     Reply with quote

This CCS example file use Timer0 (also called rtcc) to count seconds:
Quote:
c:\program files\picc\examples\ex_stwt.c
balboa



Joined: 24 Mar 2015
Posts: 8
Location: Syria

View user's profile Send private message

thank you for help
PostPosted: Fri Mar 27, 2015 1:18 pm     Reply with quote

PCM programmer wrote:
This CCS example file use Timer0 (also called rtcc) to count seconds:
Quote:
c:\program files\picc\examples\ex_stwt.c
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