I am currently working on an SPI interface to measure the voltage of an amplified sensor bridge signal. I am using an ESP32 module to control the device. Since I am logging the data to an SD card, I chose to connect the ADS8698 (Datasheet) via the default HSPI interface (see below). Unfortunately I am receiving zero readings only - no matter what commands I send. I tried to illustrate my setup as detailled as possible down below - if you think that I am missing something, do not hesitate to remind me ;).

My Question is: Do you have any ideas on things that I missed facing this issue? - Thanks in advance!

Related Topics
I know that there are related topics in Source A, Source B and Source C, from which however none does lead to a final answer. My research in the last couple of days showed, that several people face issues with this ADC, which lead me to start a new thread to reactive this topic and collect all referenced ressources without creating a duplicate.

One possible reason for the communication problem could be, that I am not using DMA to interface via SPI which might lead to timing problems. I wasn't able to test any ESP32 spi dma library, since the only library I found (https://github.com/hideakitai/ESP32DMASPI) does not compile. Furthermore I found discussions, whether DMA is actually more precise with respect to timing or not, which did not lead to a verified result (the multi-core structure of the ESP32 might even be faster).

Hardware Setup & Wiring

ADS8689 Schematic

The ADS8698 circuit is shown above, it is connected to the ESP32 as follows: | ESP32DevKitCV4 | ADS8698IDBT| | -------- | -------------- | | 12 (HSPI_MISO) | SDO| | 13 (HSPI_MOSI) | SDI| | 14 (HSPI_SCK) | SCK | | 15 (HSPI_CS) | CS |

Current Software State

#include <Arduino.h>
#include <SPI.h>

//ADC Settings
#define CHANNEL 0
#define SCLK_SPEED 18e6
#define BUFFER_SIZE 5
#define CS_PIN 15
#define RST_PIN 32

SPIClass * hspi = NULL;
uint8_t receivedBytes[3];

void setup() {
  Serial.begin(115200);                 //initialize serial communication
  pinMode(CS_PIN, OUTPUT);              //set pinmode
  pinMode(RST_PIN, OUTPUT);
  digitalWrite(CS_PIN, HIGH);           //no communication
  digitalWrite(RST_PIN, HIGH);          //normal operation

  hspi = new SPIClass(HSPI);
  hspi->beginTransaction(SPISettings(SCLK_SPEED,MSBFIRST, SPI_MODE));

  hspi->transfer(0xC0);                 //manual read Ch0

void loop() {
  hspi->transfer(0);                    // wait 16 clk cycles for conversion, 0x00 = continue Operation
  receivedBytes[0] = hspi->transfer(0); //read 3 bytes 
  receivedBytes[1] = hspi->transfer(0);
  receivedBytes[2] = hspi->transfer(0);

  for(int i=0;i<3;i++)
  • Based on the page 48-49 of the datasheet, your implementation does not follow the timing and signalling of the READ operation.
    – hcheung
    Jan 20, 2023 at 15:07
  • Thank you vor your reply! Could you please specify in which regards I misunderstood the read signaling? I assume you refer to table 8 and figure 92 on page 49 of the datasheet. Since I have put the ADC in MANUAL_READ_CH0 mode in the setup, an address / cmd of 0x00 should be fine in terms of continued operation. I thought that the manual read command would lead to an SDO signal output according to table 14 on page 54. The latter starts after the 16th falling clk cycle whereas the read command outputs data following the first byte transferred. Maybe that lead to confusion.
    – Dexter S
    Jan 21, 2023 at 9:07
  • Table 14 describes the detail of the received data. But the table 8 and figure 92 shows how the command should be sent and when the data will arriving. The timing diagram shows that data start to coming in on 3rd byte, and DS line won't be drop until data has been received. Your code send the command 0xC000, then drop the CS line. What it should be according the time timing diagram should be digitalWrite(CS_PIN,LOW); hspi->transfer(0xC0); hspi->transfer(0x00); receivedBytes[0] = hopi->trnasfer(0); ... digitalWrite(CS_PIN,HIGH); .
    – hcheung
    Jan 22, 2023 at 3:38
  • 1
    Read the first program of, "The program register is a 16-bit read or write register. There must be a minimum of 24 SCLKs after the CS falling edge for any read or write operation to the program registers".
    – hcheung
    Jan 22, 2023 at 3:41
  • Thank you for your explanation. You are right, I did not consider the accurate timing for the command register write sequence. I updated my code and added a line in void setup to read back the value written to the register - which is obviously zero. Unfortunately I am still getting exclusively zero readings in my main loop. Did I miss something else you mentioned?
    – Dexter S
    Jan 24, 2023 at 8:48


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.