External ADC ADS131A02 connected through SPI not working
Posted: 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.
I am using the SPI clock speed at 26MHZ, clock speed above it doesn't work for the ADC.