Hello everyone,
I am working on a project using an MCP3208 (12-bit, 8-channel SPI ADC) connected to an ESP32-S3. I have a stable analog signal (~1400–1500 range), but when I read the ADC values via SPI and send them over RS485, I notice a very strange pattern:
- Some values are never read. For example: 1467 and 1468 appear normally, 1469 and 1470 almost never appear, then 1471 and 1472 appear again.
- Observing the 12-bit binary representation, the last two bits are always equal. Any value where bit1 ≠ bit0 disappears.
- This pattern repeats across the entire measurement range.
- When the values are lower (~1200), the readings are stable with only small tolerances (~20 units).
- At higher values (~2000+), missing values and spikes increase, but only in the negative direction (values are lower than actual, never higher).
My setup:
- MCP3208 powered at 5V
- ESP32-S3 logic at 3.3V
- SPI clock = 1 MHz
- SPI mode = 0
- CS held low for a single transaction of 24 clocks
- No FreeRTOS tasks used
I have tried multiple ADCs, and the problem persists. I suspect it may be related to SPI bit alignment, logic level mismatch, or Vref decoupling, but I am not sure.
Has anyone encountered a similar pattern when reading MCP3208 on ESP32? Any suggestions on the correct SPI read sequence, or how to avoid missing LSBs / negative spikes at higher ADC values?
Thanks in advance!