18.3 Analog Peripheral Manager Setup

Use the following steps as a guide for configuring the Analog Peripheral Manager module. Refer to Figure   1 for more information about the APM module timing and operation.

  1. Select the APM clock source using the APMCLK register.
  2. Setup the 16-bit APM counter by configuring the prescaler using APMPRE and the period using APMPER to meet the application timing requirements.
  3. Set the Start 1 Event time by writing to the APMSTART1 register.
  4. Select which analog peripheral(s) will be activated after a Start 1 Event occurs, by setting the respective bit(s) in the APMPERS1 register.
  5. Set the End 1 Event time by writing to the APMEND1 register.
  6. Select which analog peripheral(s) will be deactivated and transitioned back into a low-power state (until reactivated again by the APM) after an End 1 Event occurs, by setting the respective bit(s) in the APMPERE1 register.
  7. Set the Start 2 Event time by writing to the APMSTART2 register.
  8. Select which analog peripheral(s) will be activated after a Start 2 Event occurs, by setting the respective bit(s) in the APMPERS2 register.
  9. Set the End 2 Event time by writing to the APMEND2 register.
  10. Select which analog peripheral(s) will be deactivated and transitioned back into a low-power state (until reactivated again by the APM) after an End 2 Event occurs, by setting the respective bit(s) in the APMPERE2 register.
  11. Enable the APM module by setting the EN bit.
Figure 18-1. Analog Peripheral Manager Timing Diagram (APMPRE = 2 and APMPER = 7)