10.4.1 Initialization

Follow these steps to configure and enable a generator:
  1. Select the clock source by writing the corresponding value into the Generator Clock Source Select bit field of the Generator Control n register (GENCTRL[n].SRC).
  2. Set the Division Factor bit field (GENCTRL[n].DIV) and the Divide Selection bit (GENCTRL[n].DIVSEL) according to the desired division of the clock source frequency.
  3. Configure the Peripheral Channel Control n register. The generator used as a clock source for a peripheral must be selected by writing the desired value to the Generator Selection bit field (PCHCTRL[n].GEN), and the peripheral channel must be enabled by writing ‘1’ to the Channel Enable bit (PCHCTRL[n].CHEN).
  4. Enable the Generator by writing ‘1’ to the generator enable bit of the GENCTRL[n] register (GENCTRL[n].GENEN).
Note: Each Generator n is configured by one dedicated register, GENCTRL[n].
Note: Each Peripheral Channel n is configured by one dedicated register, PCHCTRL[n].