12.2.3 CSWHOLD
When the system oscillator changes frequencies, peripherals using the system clock may be affected. For example, if the I2C module is actively using the system clock as its Serial Clock (SCL) time base, changing the system clock frequency will change the SCL frequency. The Clock Switch Hold (CSWHOLD) bit can be used to suspend a requested clock switch. In this example, software can request a new clock source, use the CSWHOLD bit to suspend the switch, wait for the I2C bus to become Idle, then reconfigure the SCL frequency based on the new clock source. Once the I2C has been reconfigured, software can use CSWHOLD to complete the clock switch without causing any issues with the I2C bus.
1
), a write to NOSC and/or NDIV is accepted, but the clock switch is suspended and does not
automatically complete. While the switch is suspended, code execution continues using
the old (current) clock source. Module hardware will still enable the new oscillator
selection and set the NOSCR
bit. Once the NOSCR bit is set, software will either:- clear CSWHOLD so that the clock switch can complete, or
- copy the Current Oscillator Source Select (COSC) value into NOSC to abandon the clock switch.