Use a crystal oscillator for the PIC (any frequency) and setup timer0 to timeout once a second (if that is your countdown rate). Use Mister E's PIC multi-calc to come up with the values. Sit in a tight loop and read INTCON.2 (Timer0 overflow bit). When that bit goes high, decrement your counter and display it on the LCD, then jump back to the tight loop. You can put a test for a button push or turn on a buzzer in that tight loop as well. It will be perfectly accurate as long as whatever you do in the tight loop takes less than 1 second.




Bookmarks