ADC2 stops working while Wi-Fi is on
The ADC2 channels (GPIO11-20) cannot be used at the same time as Wi-Fi: the radio shares ADC2 through an arbiter. Put analog sensors on ADC1 (GPIO1-10), as the sound labs do with GPIO6.
Analog
Two 12-bit converters that turn a voltage into a number
built, not flashedLoading the 3D view…
Two 12-bit SAR ADCs on 20 pins: ADC1 on GPIO1-10, ADC2 on GPIO11-20.
The reference is about 1.1 V. Attenuation (0, 2.5, 6 or 12 dB) stretches the range; calibrated, 12 dB reads up to about 2.9 V.
Up to 100 k samples per second, and DIG ADC1 can stream samples to memory through DMA.
After calibration the error is within 5 mV at 0 dB and 50 mV at 12 dB. Averaging helps.
ADC2 cannot be used while Wi-Fi is on: put analog inputs on ADC1.
The digital (DMA) controller of ADC2 does not work properly, so continuous sampling uses ADC1.
The ADC2 channels (GPIO11-20) cannot be used at the same time as Wi-Fi: the radio shares ADC2 through an arbiter. Put analog sensors on ADC1 (GPIO1-10), as the sound labs do with GPIO6.
8 labs use this block, across 1 tracks. Open a track to see them.
SENS_SAR_MEAS1_CTRL2_REGoffset 0x000C| Bits | Field | What it does |
|---|---|---|
| 30:19 | SENS_SAR1_EN_PAD | Which pin to measure, as a bitmap. |
| 17 | SENS_MEAS1_START_SAR | Start a conversion (software start). |
| 16 | SENS_MEAS1_DONE_SAR | Conversion done. |
| 15:0 | SENS_MEAS1_DATA_SAR | The ADC1 result. |
SENS_SAR_ATTEN1_REGoffset 0x0014| Bits | Field | What it does |
|---|---|---|
| 31:0 | SENS_SAR1_ATTEN | 2 bits of attenuation per ADC1 channel. |
APB_SARADC_CTRL_REGoffset 0x0000| Bits | Field | What it does |
|---|---|---|
| 18:15 | APB_SARADC_SAR1_PATT_LEN | How many pattern-table entries to scan. |
| 14:7 | APB_SARADC_SAR_CLK_DIV | ADC clock divider. |
| 0 | APB_SARADC_START_FORCE | 1: start conversions from software. |
APB_SARADC_APB_ADC_ARB_CTRL_REGoffset 0x0038| Bits | Field | What it does |
|---|---|---|
| 11:10 | APB_SARADC_ADC_ARB_WIFI_PRIORITY | Priority of the radio's use of ADC2. |
| 9:8 | APB_SARADC_ADC_ARB_RTC_PRIORITY | Priority of your ADC2 reads. |
Read the full sectionTechnical reference §39.3