PIC32 Oscillator - Oscillator Start-up Timer (OST)

Oscillator Start-up Timer

Crystal oscillators require some time to generate a stable output. The Oscillator Start-up Timer (OST) is automatically applied any time you want to use or switch to a clock source that was disabled and that uses a crystal or ceramic resonator.

If you are using the PLL, an additional delay is required to allow the PLL to achieve lock. Click on the following links for for more information on the "System PLL Lock Status":
PIC32MX System PLL Lock Status
PIC32MZ System PLL Lock Status


The OST is a simple 10-bit counter that counts 1024 oscillator cycles before releasing the oscillator clock to the rest of the system. The amplitude of the oscillator signal must reach the VIL and VIH thresholds before the OST can begin to count cycles.

When enabled, the OST is used every time the oscillator has to restart (i.e., on a Power-on Reset (POR), Brown-out Reset (BOR) or a wake-up from Sleep mode). The Primary and Secondary oscillators (POSC and SOSC) both have their own OST.

The Secondary oscillator can be enabled or disabled at run-time using the following MPLAB® Harmony functions:

  • PLIB_OSC_SecondaryEnable(OSC_ID_0); // enable Secondary oscillator
  • PLIB_OSC_SecondaryDisable(OSC_ID_0); // disable Secondary oscillator

Reasons you may want to keep the Secondary oscillator running at all times:

  • Enable a fast switch to the 32 kHz system clock for lower power operation
  • Allow the Real-Time Clock to keep time during Sleep mode
  • Allow Timer1 to keep counting during Sleep mode

Detailed Overview

For more detail on the Oscillator Start-up Timer feature for a specific PIC32 device, please view the Oscillator family reference manual chapter for that device, for example:

The device data sheet should then be consulted to verify the specific features implemented in that device.

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.