> -----Original Message----- > From: Robert Rolf [mailto:robert.rolf@UALBERTA.CA]=20 > Sent: Sunday, June 15, 2003 1:10 AM > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: [PIC]: Using dual-clock chip as a RTC >=20 >=20 > If you have such a time sensitive loop, disable interrupts,=20 > assuming that you can be COMPLETELY done the loop in less=20 > than a second (or a serial character time). The Timer1=20 > overflow will be 'pending' when you reenable that interrupt,=20 > and will just be serviced late. >=20 Ah, ok. I guess I didn't understand exactly how the timers worked. For some reason, I was assuming that when they overflowed, then they waited until the interrupt was serviced before continuing counting. Now that I write that down, it doesn't make much sense. :-) So you may end up with a sequence like this: Int1: 0 sec Int2: 1.001 sec Int3: 1.999 sec So the interrupts aren't neccesarily right on 1 sec marks, but the overall time measurement doesn't drift. So, assuming you had a perfect crystal, you would only be off by at most 1 second at any particular time measurement. For my application, I don't need a high level of precision, but I do want my time measurement to not drift over time. Alex -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu