Summary
On an EVAL-AD4195-4 with VREF = 2.5 V and gain 1, an input above +2.5 V reads DATA = 0x7FFFFF, as expected. Whether ADC_CONV_ERR (ERROR register 0x74, bit 3) is also set depends on how the conversions are run:
- Conversion mode. At 2.755 V with the Sinc3 filter, ten conversions in continuous mode set ADC_CONV_ERR. Ten conversions in single-conversion mode do not.
- Number of conversions in continuous mode. At the same input, a run of ten continuous conversions sets ADC_CONV_ERR. A run of one does not.
- Input level. Every mode and count sets ADC_CONV_ERR once the input is far enough above full scale: about 3.0 V (1.2 × VREF) for Sinc3. The level depends on the filter and on FS (Table 2).
The flag does not arrive late. ERROR read immediately after RDY, 2 s later, and 10 s later all give 0x0000.
The datasheet (Rev. 0, page 58) states that ADC_CONV_ERR "is set if there is a saturation (overflow or underflow) of the ADC result" and is "updated in conjunction with the update of the data register". It does not describe a dependence on mode, count or input level.
Questions
- Is this the expected behavior of ADC_CONV_ERR?
- What does ADC_CONV_ERR monitor, and why does a single conversion, or the first conversion in continuous mode, need a higher input to set it than later continuous conversions?
- For single conversions and channel sequences, what is the recommended way to detect an over-range input? Is DATA = 0x7FFFFF or 0x800000 a reliable indication on its own?
- Is this related to the ADC_CONV_ERR behavior after zero-scale calibration in an earlier thread, "AD4195-4 ADC_CONV_ERR set after every zero-scale calibration although the calibration result looks correct" (thread 606257)?
Test setup
- Board: EVAL-AD4195-4 on its own 5 V regulator. AVDD = 5 V, AVSS = GND (LK21 to LK28 installed).
- Reference and gain: internal 2.5 V reference (REF_CONTROL = 0x0001), selected as REFOUT/AVSS. PGA gain 1, bipolar coding. Positive full scale is therefore +2.5 V.
- Input: channel 3, AIN7 (+) to AIN8 (−), with AIN8 at AVSS (ground). Only channel 3 is enabled (CHANNEL_EN = 0x0008), except in test D.
- Host: RP2040 microcontroller, SPI mode 3 at 1 MHz with CRC on. RDY is routed to DIG_AUX1 and read as a GPIO.
The voltage source
The input voltage comes from the wiper of an 8-bit digital potentiometer (MCP41HVX1), connected between 3.3 V and ground, with its wiper on AIN7. The potentiometer is a convenient programmable DC source, and it has two limits:
- It steps in about 12.7 mV increments, so a threshold is known only to within one step.
- It cannot go above 3.3 V or below 0 V. Negative over-range was not tested.
The results depend only on the voltage between AIN7 and AIN8. A bench supply or calibrator that applies the same voltages should give the same results.
Note: The voltages in this post were not measured with a meter. They are calculated by a straight-line fit to the ADC's own in-range readings at potentiometer codes 0xBC to 0xC3: 12.713 mV per code, with residuals below 0.1 mV. Above 2.5 V they are extrapolated, so treat them as accurate to a few millivolts.
Minimal tests
Configure the ADC as in Table 3 (appendix), with Sinc3 at FS 5000 in every setup (FILTERn = 0x0006, FILTER_FSn = 0x1388). FS 65532 gives the same results, more slowly. Run each test at the three input levels in Table 1. Between tests, write ADC_CTRL = 0x0007 (idle) and clear ERROR by writing 0x0008 to it.
Note: Before every test, our host also read INTERFACE_STATUS_A, STATUS and ERROR, and read back every configuration register in Table 3 to confirm it was unchanged. INTERFACE_STATUS_A read 0x00 every time. These reads are part of our host's routine; we have not tested whether the results change without them.
- Test A, continuous mode, channel 3 only, one conversion:
- Write CHANNEL_EN = 0x0008 (channel 3 only).
- Write ADC_CTRL = 0x0000 (continuous).
- At RDY, read DATA_PER_CHANNEL3 (0x34).
- Write ADC_CTRL = 0x0007 (idle), then read ERROR.
- Test B, continuous mode, channel 3 only, ten conversions:
- Write CHANNEL_EN = 0x0008 (channel 3 only).
- Write ADC_CTRL = 0x0000 (continuous).
- At each of ten RDYs, read DATA_PER_CHANNEL3 (0x34).
- Write ADC_CTRL = 0x0007 (idle), then read ERROR.
- Test C, single-conversion mode, channel 3 only, ten conversions:
- Write CHANNEL_EN = 0x0008 (channel 3 only).
- Write ADC_CTRL = 0x0004 (single conversion).
- At RDY, read DATA_PER_CHANNEL3 (0x34). The ADC returns to standby by itself (ADC_CTRL reads 0x0005).
- Repeat steps 2 and 3 until ten conversions have been read.
- Write ADC_CTRL = 0x0007 (idle), then read ERROR.
- Test D, continuous mode, channels 0 to 3, three sequences (12 conversions):
- Write CHANNEL_EN = 0x000F (channels 0 to 3).
- Write ADC_CTRL = 0x0000 (continuous).
- At each of three RDYs, read DATA_PER_CHANNEL0 to 3 (0x28, 0x2C, 0x30, 0x34). Each sequence converts channels 0, 1, 2 and 3 once, and RDY falls after the fourth. Three sequences are 12 conversions, 3 of them on channel 3.
- Write ADC_CTRL = 0x0007 (idle), then read ERROR.
Table 1. ADC code and ERROR register after each test (Sinc3, FS 5000 and FS 65532)
| Input (AIN7 to AIN8) | ADC code (DATA_PER_CHANNEL3, 0x34) |
ERROR register (0x74), read at the end of the test | |||
|---|---|---|---|---|---|
| Test A: CH3 only, continuous, 1 conversion |
Test B: CH3 only, continuous, 10 conversions |
Test C: CH3 only, single, 10 conversions |
Test D: CH0 to CH3, continuous, 3 sequences (12 conversions) |
||
| 2.488 V (in range) | 0x7F5E98 to 0x7F61A3 | 0x0000 | 0x0000 | 0x0000 | 0x0000 |
| 2.755 V | 0x7FFFFF | 0x0000 | 0x0008 | 0x0000 | 0x0000 |
| 3.048 V | 0x7FFFFF | 0x0008 | 0x0008 | 0x0008 | 0x0008 |
An ERROR value of 0x0008 is ADC_CONV_ERR (bit 3) set. 0x0000 in red marks an ADC code clamped at full scale (0x7FFFFF) with ADC_CONV_ERR clear. Each test was run three times at each input level with Sinc3 at FS 5000, and three times again with Sinc3 at FS 65532. All six runs of a test at a level gave the same ERROR value. The ADC code column is channel 3's, across all four tests.
At 2.755 V all four tests read the same clamped code, 0x7FFFFF, from the same input, but only test B sets ADC_CONV_ERR. The tests differ only in conversion mode, number of conversions, and channels enabled.
To check for a late flag, at 2.755 V and Sinc3 FS 65532:
- ERROR was read immediately after RDY of a single conversion, with no register write in between: 0x0000.
- After one conversion, in either mode, ERROR was read again 2 s later and 10 s later, with no other access to ERROR in between: 0x0000 each time.
Where single conversions set the flag
Single conversions of channel 3 alone (single-conversion mode, ADC_CTRL = 0x0004, as in test C but one conversion per measurement), at seven FS values, with the input raised from 2.501 V toward the threshold. ERROR was read immediately after RDY. In each row the two inputs are adjacent potentiometer steps, about 12.7 mV apart, so the threshold lies between them. At least two conversions were run at each level, and they always agreed. DATA read 0x7FFFFF at every level in the table.
Table 2. Single-conversion threshold of ADC_CONV_ERR
| Filter | FS | Highest input with ERROR = 0x0000 | Lowest input with ERROR = 0x0008 |
|---|---|---|---|
| Sinc3 | 20 | 3.060 V | 3.073 V |
| Sinc3 | 100 | 3.009 V | 3.022 V |
| Sinc3 | 500, 2000, 5000, 20000, 65532 | 2.997 V | 3.009 V |
| Sinc5 + Avg | 20 | 3.124 V | 3.137 V |
| Sinc5 + Avg | 100 | 2.603 V | 2.615 V |
| Sinc5 + Avg | 500 | 2.514 V | 2.526 V |
| Sinc5 + Avg | 2000, 5000, 20000 | 2.501 V | 2.514 V |
| Sinc5 + Avg | 65532 | none | 2.501 V |
Appendix: register settings
Read back from the AD4195-4 at rest, in standby. Setups 0 to 3 are identical, and channel n uses setup n. Only CHANNEL_EN, FILTERn and FILTER_FSn change between tests.
Table 3. Register settings
| Address | Register | Value | Meaning |
|---|---|---|---|
| 0x00, 0x01, 0x02 | INTERFACE_CONFIG_A, _B, DEVICE_CONFIG | 0x10, 0x80, 0x00 | Reset values |
| 0x03 | CHIP_TYPE | 0x07 | Device identity |
| 0x04, 0x05 | PRODUCT_ID_L, PRODUCT_ID_H | 0x004C | Device identity |
| 0x06 | CHIP_GRADE | 0x04 | Device identity |
| 0x0B | SPI_REVISION | 0x83 | Device identity |
| 0x0C, 0x0D | VENDOR_L, VENDOR_H | 0x0456 | Device identity |
| 0x10 | INTERFACE_CONFIG_C | 0x66 | CRC enabled; strict register access |
| 0x68 | PIN_MUXING | 0x0010 | RDY on DIG_AUX1; SYNC_IN disabled |
| 0x6A | CLOCK_CTRL | 0x0000 | Internal oscillator |
| 0x6C | STANDBY_CTRL | 0x0105 | Clock, VBIAS and internal reference stay on in standby |
| 0x6E | POWER_DOWN_SW | 0x0000 | |
| 0x70 | ADC_CTRL | 0x0005 | Standby between tests; the tests write 0x0000, 0x0004 and 0x0007 |
| 0x72 | ERROR_EN | 0x30BC | DLDO_PSM, ALDO_PSM, REF_DIFF_MIN, AINM_OV_UV, AINP_OV_UV, ADC_CONV_ERR and SPI_ERR monitors enabled |
| 0x78 | CHANNEL_EN | 0x0008 | Channel 3 only (0x000F in test D) |
| 0x80 + 4n, 0x82 + 4n | CHANNEL_SETUPn, CHANNEL_MAPn | n; 0x0001, 0x0304, 0x0506, 0x0708 | Channel n uses setup n. Channel 3 is AIN7 to AIN8 |
| 0xC0 + 14n | MISCn | 0x0000 | |
| 0xC2 + 14n | AFEn | 0x0050 | Reference REFOUT/AVSS; PGA gain 1; bipolar |
| 0xC4 + 14n | FILTERn | 0x0006 | Sinc3 (0x0000 for Sinc5 + Avg) |
| 0xC6 + 14n | FILTER_FSn | 0x1388 | FS 5000 (0xFFFC for FS 65532) |
| 0xC8 + 14n | OFFSETn | 0x000000 | Reset value; no calibration run |
| 0xCB + 14n | GAINn | 0x555555 | Factory value; never written |
| 0x130 | REF_CONTROL | 0x0001 | Internal 2.5 V reference enabled |
| 0x134 | V_BIAS | 0x0052 | VBIAS on AIN1, AIN4, AIN6 (not on AIN7 or AIN8) |
| 0x136 to 0x13E | I_PULLUP, CURRENT_SOURCE0 to 3 | 0x0000 | Pull-ups and excitation currents off |
| 0x190, 0x192 | GPIO_MODE, GPIO_OUTPUT_DATA | 0x0000 |