19.9 Timer1 Operation During Sleep
Timer1 can only operate during Sleep when configured for Asynchronous Counter mode. In this mode, an external crystal or clock source can be used to increment the counter. To set up the timer to wake the device:
- The TMRxON bit of the TxCON register must be set
- The TMRxIE bit of the PIEx register must be set
- The PEIE/GIEL bit of the INTCON register must be set
- The TxSYNC bit of the TxCON register must be set
- Configure the TMRxCLK register for using secondary oscillator as the clock source
- Enable the SOSCEN bit of the OSCEN register
The device will wake up on an overflow and execute the next instruction. If the GIE/GIEH bit of the INTCON register is set, the device will call the Interrupt Service Routine.
The secondary oscillator will continue to operate in Sleep regardless of the TxSYNC bit setting.