The oscillator sub-system offers many other features useful for embedded applications, such as:
To allow the accuracy of the POSC (Primary Oscillator) to be used to execute code, it is possible to use FRC (Fast RC Oscillator) as the clock source until the POSC stabilizes.
When enabled, Two-Speed Start-Up switches automatically, accounting for both the POSC's stabilization time and the PLL lock time (if enabled). This ensures that code can be executed in what would otherwise be dead time. When executing applications written in C, this typically means that the ‘start-up’ code, which prepares the stack, CPU core and any defined variables, can be started, ensuring that the application code can be reached earlier than would otherwise be possible.
Fail-Safe Clock Monitor (FSCM)
This feature monitors the clock output from the POSC. In the event that the oscillator stops operating (e.g. due to a broken crystal after heavy vibration or a short-circuit), the system will automatically switch to the FRC clock source. This ensures that the PIC32 can still continue to operate, albeit at a fraction of the desired speed. If the associated interrupts are enabled, the FSCM can generate a dedicated interrupt to signal this catastrophic oscillator failure.
With a few exceptions, it is possible to switch between all clock sources and reconfigure the PLLs during run-time. For safety reasons, modifying these registers requires a special unlocking sequence to be written to certain registers, thus ensuring that the registers can’t be modified by runaway code. Once changes have been made, the registers need to be locked once more.
Power Saving Support
POSC and FRC are always disabled in Sleep mode. Whether the SOSC (Secondary Oscillator) and LPRC (Low Power Oscillator) remain active depend if they are being used by any peripheral modules. All oscillators remain active in Idle mode.