Timer 1 Secondary Oscillator

A dedicated low-power 32.768 kHz oscillator circuit is built-in between pins SOSCI (input) and SOSCO (amplifier output). This internal circuit requires an external 32.768 kHz "clock" crystal to operate. This oscillator is designed as a clock source to feed the Timer 1 module and enable the PIC® MCU device to create time keeping applications. The oscillator can also be used as a secondary system clock when Clock Switching is enabled.

One advantage to this clock source is the oscillator will continue to run during Sleep mode so the time keeping can continue to operate at low power.

t1oscblock.png

Enabling Timer 1 Secondary Oscillator

Setting the Oscillator Enable Control (T1OSCEN) bit in the Timer 1 Control (T1CON) register will enable the oscillator drive circuitry.

t1osc.png
t1oscbit.png

Oscillator Start-up Delay

The oscillator requires a start-up and stabilization time before use. Thus, the T1OSCEN bit should be set and a suitable
delay similar to the Oscillator Start-up Timer (OST) delay can be implemented in software by clearing the Timer 1 Interrupt Flag (TMR1IF) bit in the Peripheral Interrupt Register (PIR) and then presetting the Timer 1 High (TMR1H) and Timer 1 Low (TMR1L) register pair to a hexadecimal value of FC00. The TMR1IF flag will be set when 1024 clock cycles have elapsed, thereby indicating that the oscillator is running and reasonably stable.


For more information on 8-Bit oscillator options visit the 8-Bit Oscillator Options article.

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 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.