The ADC conversion is controlled by the ADC12 FSM that provides all the necessary control signals for the successive approximation register (SAR) ADC operation. The binary search algorithm, sampling time and bit timing are controlled by the state machine based on firmware configuration. 8 sample and hold timing configurations are provided to run the ADC12 at various sampling frequencies.
Address 0x00040000
Figure 8-9 ADC Control Register (ADCCTRL) EXT_TRIG _GPIO_VAL | EXT_TRIG _GPIO_DIR | EXT_TRIG _GPIO_EN | EXT_TRIG_EN | EXT_TRIG_SEL |
R/W-0 | R/W-0 | R/W-0 | R/W-0 | R/W-0000 |
ADC_SAMPLING_SEL | ADC_SEL_REF | ADC_ROUND | BYPASS_EN |
MAX_CONV | SINGLE _SWEEP | SW_START | ADC_INT_EN | ADC_EN |
R/W-0000 | R/W-0 | R/W-0 | R/W-0 | R/W-0 |
LEGEND: R/W = Read/Write; R = Read only; -n = value after reset |
Note: Even though the ADC12 sampling frequency is preset to 267 Ksps as default by setting the ADC_SAMPLINGSEL to zero, in order to achieve the best measurement results it is recommended to set the sampling rate to 267 Ksps by setting the ADC_SAMPLINGSEL to 6:
AdcRegs.ADCCTRL.bit.ADC_SAMPLINGSEL = 6; // Means: ADC sampling rate is set to 267 KS/s