12.6.2.10.3 Selecting the Clock Source for a Peripheral
When changing a peripheral clock source by writing to PCHCTRLm.GEN, the
peripheral clock must be disabled before re-enabling it with the new clock source
setting. The following actions prevent glitches during the transition:
- Disable the Peripheral Channel by writing PCHCTRLm.CHEN = 0.
- Assert that PCHCTRLm.CHEN reads '0'.
- Change the source of the Peripheral Channel by writing PCHCTRLm.GEN.
- Re-enable the Peripheral Channel by writing PCHCTRLm.CHEN = 1.