On supported PICs, Clock Recovery lets the USB connection help keep the internal oscillator on time. Select it only when the tool offers it for your exact device.
Some targets offer Clock Recovery in the same dropdown as numerical crystal frequencies. This selects the supported internal oscillator and USB-based automatic tuning, rather than an external crystal.
The PIC still uses its own oscillator. Once connected, it can use the computer's regular USB timing packets to correct small changes in that oscillator. These packets are called Start-of-Frame (SOF) packets. There is no separate USB clock wire, and this feature does not depend on taking board power from USB.
To use it:
Allow USB to connect before waiting for USB timing. The computer cannot supply timing packets before the connection is active. A startup wait for the PIC's own oscillator or PLL is a separate check.
The MCU still needs a numerical Declare Xtal matching its selected Fosc. Switching back to an external crystal applies the crystal settings and disables USB-based tuning.
Clock Recovery is offered on the six PIC16F/LF145x targets and selected K50, J94/J99 and PIC24 targets. Its presence is determined by the exact selected part, not by the general PIC18 or PIC24 family name. If it is absent, do not copy another target's ACTCON or OSCTUN setting to add it.
During USB suspend, normal SOF traffic stops. The Device Library's normal suspend handling does not require you to replace the clock startup or insert a generic Sleep instruction. If your application adds Sleep, oscillator switching or peripheral power-down, it must preserve or restore the required oscillator, PLL and USB operation according to that target's requirements. Clock Recovery alone does not implement the board's suspend-power design.
Created with the Personal Edition of HelpNDoc: What is a Help Authoring tool?