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

pic16f877 and cascading timers

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







pic16f877 and cascading timers
PostPosted: Thu Oct 19, 2006 10:06 am     Reply with quote

Is it possible to to set up a second timer to count the overflows of the first timer without using an isr?

Thank you for your help, I've been digging around on the net and the data sheet and it's just not jumping out to me on how to set it up.
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Thu Oct 19, 2006 10:21 am     Reply with quote

An alternative approach is to periodically sample the TimerIF flag in the mainline loop. Whenever the flag is set you clear it and increment your variable.

This mechanism works fine for long delays provided you do not make calls to code that consumes 100% PIC CPU cycles to execute such as doing serial I/O to the software UART, using delay_ms(xxx) functions that sort of thing.
_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
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