2.1 Single Conversion
Task: One single-ended conversion of ADC input 1 using virtual
channel 2.
- Configure the Input Mode bitfield (INPUTMODE) in Channel 2 Control Register (CH2CTRL) equal to 0x01 to select single-ended input
- Configure the MUX Positive Input bitfield (MUXPOS) in Channel 2 MUX Control Register (CH2MUXCTRL) equal to 0x01 to select ADC input 1
- Configure the Enable bit (ENABLE) in Control Register A (CTRLA) to enable the ADC module without calibrating. Wait for the ADC start-up time (typical max. 24 ADC clocks).
- Configure the Start Conversion bit for channel 2 (CH2START) in Control Register A (CTRLA) to start a single conversion
- Wait for the Interrupt Flag bit for channel 2 (CH2IF) in the Interrupt Flags register (INTFLAGS) to be set, indicating that the conversion is finished
- Read the Result register pair for channel 2 (CH2RESL/CH2RESH) to get the 12-bit conversion result as a 2-byte value