20.7 Timer1 Interrupt
The TMRx register increments to FFFFh and rolls over to 0000h. When TMRx rolls over, the TMRx Interrupt Flag (TMRxIF) bit of the PIRx register is set. To enable the interrupt-on-rollover, the following bits must be set:
- ON bit of the TxCON register
- TMRxIE bits of the PIEx register
- Global interrupts must be enabled
The interrupt is cleared by clearing the TMRxIF bit as a task in the Interrupt Service Routine.
Important: The TMRx register and the TMRxIF bit need to
be cleared before enabling interrupts.