External ADC ADS131A02 connected through SPI not working

pcp_696
Posts: 3
Joined: Thu Oct 07, 2021 4:39 am

External ADC ADS131A02 connected through SPI not working

Postby pcp_696 » Mon Nov 08, 2021 9:53 am

I am using ESP32-WROOMD with cpu clock speed of 240MHz. I have to read the external ADC i.e ADS131a02 from TI in asynchronous slave mode, 32-bit device word, Hamming code word validation off. I should read when i receive an interrupt on DRDY pin, I am using the ESP_INTR_FLAG_EDGE as interrupt flag, i will call a vTaskNotifyGiveFromISR() from the interrupt handler. In the task i'll wait for notification using ulTaskNotifyTake(), once the notification is received i'll call "spi_device_transmit()" function with txBuffer of 0s and of length 96bits (32 bits for status+ 32 bits for channel1+ 32 bits for channel2). the RXbuffer with rxlength 96bits received after transmission shows the status as 0x2220 to NULL command, which indicates that "SPI fault" has occured. To further check on SPI fault i read the STAT_S register it gives the status as 0x2501, which indicates "Frame fault".
I am using the SPI clock speed at 26MHZ, clock speed above it doesn't work for the ADC.
2220.JPG
This is logical analyzer image showing 0x2220
2220.JPG (120.03 KiB) Viewed 2344 times
2501.JPG
This is logical analyzer image showing 0x2501
2501.JPG (118.53 KiB) Viewed 2344 times

pcp_696
Posts: 3
Joined: Thu Oct 07, 2021 4:39 am

Re: External ADC ADS131A02 connected through SPI not working

Postby pcp_696 » Tue Nov 16, 2021 12:14 pm

We also tried increasing the number of SCLKs from 96 to 128 cycles by providing the Txbuffer and RxBuffer with length 128bits. But the issue is still observed.
2220-128b.JPG
Logical analyzer image showing 0x2501 with 128 clks
2220-128b.JPG (107.22 KiB) Viewed 2203 times
2501-128bits.JPG
Logical analyzer image showing 0x2220 with 128 clks
2501-128bits.JPG (120.75 KiB) Viewed 2203 times

ESP_Sprite
Posts: 9709
Joined: Thu Nov 26, 2015 4:08 am

Re: External ADC ADS131A02 connected through SPI not working

Postby ESP_Sprite » Wed Nov 17, 2021 4:44 am

I don't think too many people here are familiar with that ADC... do you think the ESP32 is sending something wrong, or do you have any idea why your ADC is detecting a frame fault?

Who is online

Users browsing this forum: No registered users and 56 guests