Timer1 Sleep Operation

Timer1 can only operate during Sleep when setup in Asynchronous 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:

• TMR1ON bit of the T1CON register must be set
• TMR1IE bit of the PIE1 register must be set
• PEIE bit of the INTCON register must be set
• T1SYNC bit of the T1CON register must be set
• TMR1CS bits of the T1CON register must be configured
• T1OSCEN bit of the T1CON register must be configured

The device will wake-up on a Timer1 overflow and execute the instructions following the SLEEP assembly command.

The wake up from sleep can also drive the device to the execute the Interrupt Service Routine instead of the instruction following the sleep command. To enable this the Global Interrupt Enable bit (GIE bit) of the INTCON register needs to be set. The device will call the Interrupt Service Routine on wake-up. If the interrupt service routine contains a SLEEP instruction, the device will return to sleep mode. The service routine must also clear the TMR1IF prior to returning to sleep.

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.