10.4.2.3.3 Selecting the Clock Source for a Peripheral

When changing a peripheral clock source by writing to the Generator Selection bit field of the Peripheral Channel Control register (PCHCTRLm.GEN), the peripheral clock must be disabled before being re-enabled with the new clock source setting. The following actions prevent glitches during the transition:
  1. Disable the peripheral channel by setting the Channel Enable bit of the PCHCTRL[n] register (PCHCTRL[n].CHEN) to ‘0’.
  2. Verify that PCHCTRLm.CHEN reads ‘0’.
  3. Change the source of the peripheral channel by writing the corresponding value to PCHCTRLm.GEN.
  4. Re-enable the peripheral channel by writing PCHCTRLm.CHEN to ‘1’.
  5. Verify that PCHCTRLm.CHEN reads ‘1’.