2 ADCC Single Conversion

This example shows how to configure the ADCC module to give one conversion of an analog value read from a pin. The ADCC module is configured to use its dedicated clock (FRC) with results right-justified. First, the sample capacitor will be discharged by connecting it to the ground potential of the microcontroller and then a conversion will be started on the analog channel.

The value can then be read from the debugger’s variable watch menu.

To achieve the functionality described by the use case, the following actions will be performed:

  • System clock initialization
  • Port initialization
  • ADCC initialization
  • Discharge sample capacitor
  • Starting the conversion