Tool/software:
Hi everyone,
I’m working on a project where I designed a custom PCB that uses two ADS1261 ADCs to measure differential voltages between 16 electrodes. Here’s my setup:
-
Electrode Wiring:
-
ADS1261 #1: Electrode 1 to Electrode 10 are connected to AIN0–AIN9 respectively.
-
ADS1261 #2: Electrode 10 to Electrode 16 are connected to AIN0–AIN6, and Electrode 0 (the wrap-around electrode) is connected to AIN7.
-
-
ESP32 Connections:
-
Both ADS1261 devices share the same SPI bus. I have connected:
-
/DOUT_DRDY (from both ADCs) to MISO (GPIO19)
-
SCLK to GPIO18
-
DIN to MOSI (GPIO23)
-
-
Chip select pins are separate: ADC1 uses GPIO14 and ADC2 uses GPIO15.
-
Additionally, I have tied the START, /RESET, /PWDN, and /DRDY pins of both ADCs together (this might be an issue, but i think with the right addressing i can work around this).
-
-
Measurement Approach:
-
I plan to initialize both ADCs in parallel to run in 40 kSPS mode with a PGA gain of 64 (which suits my electrode voltage ranges) and to use the internal 2.5V reference. My idea was to send the same SPI commands to both devices simultaneously (by pulling both CS lines low at once) so they recieve the commands in parallel, and act accordingly in parallel.
-
After initialization, I would set the INPMUX (register 0x11) of both ADCs to the appropriate differential channels (e.g., AIN0–AIN1, AIN1–AIN2, …), then issue the START command in parallel. Once either device’s DRDY goes low, i would wait 1 uS, so i can ensure both ADCs finished sampling, and I would sequentially read each ADC’s conversion result by toggling their respective CS lines.
-
In testing, I tried to initialize one device and perform a differential measurement between AIN0 and AIN1, but the readout fails (always returning 0 or unexpected values).
-
-
Development Environment:
-
I am using the Arduino framework with PlatformIO for programming.
-
I have incorporated an ADS1261 driver (code from TI’s examples) and implemented the required HAL functions for my ESP32 (using SPI.transfer(), digitalWrite(), delay(), etc.).
-
My Specific Request:
I’m currently stuck at the very basic level:
-
Initialization: How can I correctly initialize a single ADS1261 instance with the settings above (40 kSPS, PGA gain = 64, internal 2.5 V reference) using SPI-only control (ignoring /PWDN, /RESET, and START hardware pins)?
-
Measurement: How should I correctly perform a single-shot differential measurement between AIN0 and AIN1 (i.e., set the INPMUX register properly, issue the START command, wait for DRDY, and then read the conversion data)?
If anyone has an ESP32-based driver example for the ADS1261—or can provide guidance on troubleshooting this one-device configuration—I’d really appreciate the help. Once I can successfully initialize one device and get a proper reading between AIN0 and AIN1, I can adapt the design for parallel operation with both ADCs.
Thanks in advance for your assistance!
Regards,
Balazs