CONSIDERATIONS FOR USING TIMER INTERRUPTS
- The first time you set up a timer register, write all bits of the
register.
TMSK2 = 0x03; /* Set prescaler to divide by 8 */
- Enable Interrupt by Setting Enable Bit in TMSK1 or TMSK2 -
LEAVE OTHER BITS UNCHANGED
TMSK2 = TMSK2 | 0x80; /* Enable Timer Overflow Interrupt */
- Clear Timer Flag by Writing 1 to Flag Bit in TFLG1 or TFLG2 -
WRITE 0 TO ALL OTHER BITS
TFLG2 = 0x80; /* Clear Timer Overflow Interrupt */
Bill Rison
2001-02-26