The AFEx3004W have an integrated ADC. The analog channels can be converted to independent ADC inputs, as shown in Figure 6-5. The main ADC channel is ADC3, whereas the other inputs are multiplexed to ADC3. ADC3 must be configured as a comparator and the FB3/AIN3 pin must be connected to VDD using a pullup resistor when any channel is selected as ADC. The transfer function of the ADC is given in Equation 5.
Equation 5.
where
- ADC_DATA is the output of the ADC read back in the register map. ADC_DATA is limited to (210−1).
- VIN is the input voltage at the AINx pin.
- VFS is the full-scale input voltage as provided in Table 6-1.
- (INTEGER) denotes integer division.
Follow these steps to configure and read data from ADC channel x:
- Configure the full-scale voltage using VOUT-GAIN-X for the corresponding channel in the DAC-X-VOUT-CMP-CONFIG register.
- Configure DAC channel 3 as comparator by writing 1 to the CMP-X-EN bit in the DAC-3-VOUT-CMP-CONFIG register. Only Hi-Z input is allowed in channel 3.
- Configure DAC channel-x as comparator by writing 1 to the CMP-X-EN bit in the DAC-X-VOUT-CMP-CONFIG register.
- Select the number of averages, ADC channel, and then trigger the ADC conversion using the ADC-CONFIG-TRIG register.
- Read the ADC data using the ADC-DATA register. The data are valid when the ADC-DRDY bit is 1.
- Repeat steps 4 and 5 for every ADC readback.
Table 6-1 Full Scale Analog Input (VFS)| REFERENCE (VREF) | GAIN | VFS (Hi-Z INPUT MODE) | VFS (FINITE IMPEDANCE INPUT MODE) |
|---|
| Power supply | 1 × | VDD / 3 | VDD |
| External | 1 × | VREF / 3 | VREF |
| Internal | 1.5 × | (VREF × GAIN) / 3 | VREF × GAIN |
| 2 × | (VREF × GAIN) / 3 | VREF × GAIN |
| 3 × | (VREF × GAIN) / 6 | (VREF × GAIN) / 2 |
| 4 × | (VREF × GAIN) / 6 | (VREF × GAIN) / 2 |