Electron wrote: > Hi, > I am using a 32.768 watch crystal connected to Timer1. I'd like Timer1 to generate > an interrupt exactly each 1.0000 seconds. Should I load 16383 or 16384 to PR1? What > it's not clear to me is if the value specified is ever reached in TMR1. > > Thanks, > Mario > > And the PIC you are using is....? ... regardless, TMR1 is a 16 bit timer. 65536 ticks per interrupt, and, with 32768 crystal will be 2 seconds per interrupt. So, you want 16384 ticks per interrupt, but, you may be past the interrupt before you get to read the timer.... The simplest thing is to set the most significant bit of the TMR1H byte very soon after the TMR1 interrupt.... (to be absolutely safe, it must be within 256 ticks of TMR1 or 7.8ms). bsf TMR1H,7 What this does is cause the interrupt to happen in exactly 1 time per second .... ;-) Rolf -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist