I think **broken link removed** by Microchip has a flaw. It uses 32768 Hz oscillator for Timer1 and Writes values to timer1 so that supposedly 1 interrupt occurs every second.
The part of interest is in this code.
Won't this code increment the seconds at a rate slightly more than 1Hz because of interrupt latency and all ?
But since this code came directly from Microchip, I just wanted to confirm.
The part of interest is in this code.
Code:
void interrupt intsrv(void)
{
if (TMR1IF)
{
TMR1H = 0x80;
TMR1L = 0;
TMR1IF = 0;
// service the clock
rtcc.time.seconds++;
... //rest of the codes
But since this code came directly from Microchip, I just wanted to confirm.
Last edited: