asmallri
Joined: 12 Aug 2004 Posts: 1634 Location: Perth, Australia
|
|
Posted: Thu Oct 19, 2006 10:21 am |
|
|
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!! |
|