4.1.5.3 PIOSC Operation
The microcontroller powers up with the PIOSC running. If another clock source is desired, the PIOSC must remain enabled, because it is used for internal functions. The PIOSC can only be disabled during deep-sleep mode. It can be powered down by setting the PIOSCPD bit in the DSCLKCFG register.
The PIOSC generates a 16-MHz (typical) clock. At the factory, the PIOSC is set to 16 MHz at room temperature; however, the frequency can be trimmed for other voltage or temperature conditions using software in the following ways:
- Default calibration: Clear the UTEN bit and set the UPDATE bit in the Precision Internal Oscillator Calibration (PIOSCCAL) register.
- User-defined calibration: The user can program the UT value to adjust the PIOSC frequency. As the UT value increases, the generated period increases. To commit a new UT value, first set the UTEN bit, then program the UT field, and then set the UPDATE bit. The adjustment finishes within a few clock periods and is glitch free.
- Automatic calibration using the enable 32.768-kHz oscillator from the Hibernation module: Set the CAL bit in the PIOSCCAL register; the results of the calibration are shown in the RESULT field in the Precision Internal Oscillator Statistic (PIOSCSTAT) register. When calibration is complete, the PIOSC is trimmed using the trimmed value returned in the CT field.