Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

There are three interrupts that the real time clock can generate and these are TICK (100 times a second - 10ms), SEC (once a second) and MIN (once a minute). TSTA may be set for all three events at once, or individually (all at once means that a TICK made a new second and that second made a minute).

  • A tick interrupt is fired when TIM0 is odd (bit 0 set), TIM0 continues to count to 199 then wraps to 0.

...

  • A minute interrupt is fired when TIM1 = 32 (bit 5 set), TIM1 continues to count to 59 then wraps to 0.

TSTA may never be set for all three events at once. Tick occurs on a 10ms pace when TIM0 is odd, second or minute interrupt occur when TIM0 is even (bit 0 reset). Second interrupt occurs 59 times a minute. When a minute interrupt is fired, a second interrupt has to be handled (but is not flagged in TSTA).

STA.TIME is set when TSTA.MIN or TSTA.SEC or TSTA.TICK are set according TMK mask. When all TSTA interrupts have been acknowledged, STA.TIME is reset. This logic is detailed in blink interrupts.

...