This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

ADS124S06: Unable to read data on continuous mode, DRDY pin is being high all the time.

Part Number: ADS124S06
Other Parts Discussed in Thread: ADS124S08EVM

Tool/software:

Good evening, Team, 

I'm working in a project where I need to read data from a sensor continuously. To read the data from the sensor, I'm using ADS124S06. 

 

ADS124S06_Handle adc1 = { 
		.hspi = &hspi1,
		.cs_port = ADC1_CS_GPIO_Port, 
		.cs_pin = ADC1_CS_Pin,
		.start_port = ADC1_START_GPIO_Port, 
		.start_pin = ADC1_START_Pin,
		.reset_port = ADC1_RST_GPIO_Port, 
		.reset_pin = ADC1_RST_Pin 
};

bool ADS124S06::WriteRegister(ADS124S06_Handle *dev, uint8_t reg, uint8_t data) {
	uint8_t cmd[3]= {0};
	cmd[0] = (WREG | (reg & 0x1F)); //WREG = 0x40
	cmd[1] = 0x00;
	cmd[2] = data;
	cs_low(dev);
	bool ok = HAL_SPI_Transmit(dev->hspi, cmd, 3, ADS_TIMEOUT) == HAL_OK;
	cs_high(dev);
	return ok;
}

void ADS124S06::Init(ADS124S06_Handle *dev)
{
    HAL_GPIO_WritePin(dev->reset_port, dev->reset_pin, GPIO_PIN_RESET);
	HAL_Delay(1);
	HAL_GPIO_WritePin(dev->reset_port, dev->reset_pin, GPIO_PIN_SET);
    WriteRegister(dev, 0x03, 0x00); // GAIN: PGA=1, 20SPS
    WriteRegister(dev, 0x02, 0x54); // I/p MUX: AIN5-AIN4 0x54
    WriteRegister(dev, 0x04, 0x14); // DataRAte : 20SPS, osc-4.096MHz
    WriteRegister(dev, 0x05, 0x0A); // REF : internal 2.5V On always.
    WriteRegister(dev, 0x06, 0x00); // IDACMAG
    WriteRegister(dev, 0x07, 0xFF); // IDACMUX
    WriteRegister(dev, 0x08, 0x00); // VBIAS
    WriteRegister(dev, 0x09, 0x10); // SYS
    WriteRegister(dev, 0x0A, 0x00);
    WriteRegister(dev, 0x0B, 0x00);
    WriteRegister(dev, 0x0C, 0x00);
    WriteRegister(dev, 0x0D, 0x00);
    WriteRegister(dev, 0x0E, 0x00);
    WriteRegister(dev, 0x0F, 0x40);
    WriteRegister(dev, 0x10, 0x00);
    WriteRegister(dev, 0x11, 0x00);
}

After the initialisation of the ADS124S06 with the above parameters I'm reading back the registers. 

void ADS124S06::ReadRegisters(ADS124S06_Handle *dev) {
	uint8_t txData[20];
	uint8_t rxData[20];
	/*Prepare RREG command*/
	txData[0] = RREG; //RREG = 0x20
	txData[1] = 0x11;
	for (int i = 2; i < 20; i++) {
		txData[i] = 0xFF;
	}
	/* Pull CS low to start communication*/
	cs_low(dev);
	HAL_SPI_TransmitReceive(dev->hspi, (uint8_t*) txData, (uint8_t*) rxData, 20,
			100);
	cs_high(dev);
	}
	

I'm getting all the register values as expected. everything goes well till here.


phReadings ADS124S06::ReadData(ADS124S06_Handle *dev) {
	uint8_t tx_buf[1];
	static bool st = true;
	tx_buf[0] = RDATA; // 0x12
	cs_low(dev);
	if (st) {
		HAL_SPI_Transmit(dev->hspi, tx_buf, 1, 100);
		st = false;
	}
	HAL_SPI_Receive(dev->hspi, rx_buf, 3, 100);
	cs_high(dev);
	return calculate_voltage(rx_buf, 2.495, 1);
}

Now, I'm trying to read data in continuous mode using start_pin (through hardware, not used start command "0x08"

configured the DRDY_PIN in interrupt mode (falling edge trigger). whenever DRDY_PIN goes low adc1_drdy flag will be HIGH.

I'm starting the conversation once and continuously reading the data using ReadData function (in loop runs every 100ms). 

able to read values for few readings later DRDY_PIN is being HIGH all the time, that leads adc1_drdy flag LOW and now I'm unable to read data. 

If I reset the controller then again, I'm able to read data for few readings and then previous issue repeats. 


What do I do? Please help me out. 
Thanks in advance.

  • Hi Pawan Kalyan,

    This sounds like a hardware issue, can you send a schematic of your system? The DRDY pin staying low implies that the ADC is no longer converting, assuming of course that you are not driving the DRDY somehow so it cannot toggle

    Also, have you checked to make sure the code isn't writing anything to the ADC that you didn't intend to cause the ADC to stop converting?

    -Bryan

  • Good Morning  , 

    I'm not sure whether it is a hardware issue or a firmware issue, because both hardware and firmware working as expected Shortly after power-up, I can successfully read data from the ADC. I initiate conversions by pulling the START pin HIGH, and the data reads correctly. However, after a few conversions, the DRDY pin remains HIGH continuously, preventing further readings.

    I’m not driving the DRDY pin—it's configured as an interrupt input triggered on its falling edge. Because DRDY stays HIGH, the interrupt never fires, halting data retrieval.

    The firmware behaves as expected at startup and reads ADC data without issue initially. The problem only arises after a few conversions, suggesting the issue lies elsewhere-- maybe configuration or timing issues?



    you can see the schematic 

  • Hi Pawan Kalyan,

    Today is a national holiday in the US, please expect a response to your post in the next 1-2 days. Thanks for your patience.

    -Bryan

  • Hi Pawan Kalyan,

    You should be able to power up the ADC, pull the START pin high, then monitor the DRDY pin to see if the ADC is "alive". There is no need to send any commands to the ADC to get this behavior to work. This assumes that the ADC is powered correctly, the clock is working, and the RESET pin is high. You show a hand-drawn resistor to ground on the CLK pin, so I am not sure if this is something you added manually in your system or if this resistor was just included on a different schematic page. Either way, you should include at least a pull-down to ground if you intend to use the ADC internal oscillator. Also, if this is manually installed, recheck the connections / soldering. A poor clock signal could cause the issue you are describing

    You can add a pull-up to the START pin so the ADC defaults to this behavior.

    Let me know if you are able to continuously see the DRDY pin toggling at the default data rate (20 SPS, or ~50 Hz). Again, this should continue until you tell the ADC to stop converting. If you do not see this behavior then you have an issue with your power supply or clock, or both.

    I would also add a pull-up to the RESET pin so the ADC starts in a known state

    -Bryan

  • Hii  , 

    You should be able to power up the ADC, pull the START pin high, then monitor the DRDY pin to see if the ADC is "alive".

    This Works perfectly, ADC is alive. and drdyPin toggling continuously. 

    void ADS124S06::ReadData(ADS124S06_Handle *dev, char *buf) {
    	uint8_t tx_buf[1];
    	tx_buf[0] = RDATA; // 0x12 START
    	cs_low(dev);
    
    	HAL_SPI_Transmit(dev->hspi, tx_buf, 1, 100);
    	HAL_SPI_Receive(dev->hspi, rx_buf, 3, 100);
    
    	cs_high(dev);
    }

    if I'm doing this, I'm able to read the data continuously. But I'm sending 0x12 command every time and receiving 24bit data. 

    Whereas, in ADS124S08EVM I connected the logic analyser on SPI Lines, and I observed only once 0x12 command is being sent and able to read data on MISO line continuously.

    When I tried to do the same with my firmware,
    void ADS124S06::ReadData(ADS124S06_Handle *dev, char *buf) {
    	static bool st = true;
    	uint8_t tx_buf[1];
    	tx_buf[0] = RDATA; // 0x12 START
    	cs_low(dev);
    
    	if(st)
    	{
    	    HAL_SPI_Transmit(dev->hspi, tx_buf, 1, 100);
    	    st = false;
    	}
    	HAL_SPI_Receive(dev->hspi, rx_buf, 3, 100);
    
    	cs_high(dev);
    }

    I'm facing an issue in readings. After capturing the few readings (morethan 2), Drdy pin is being high all the time.

  • Hi Pawan Kalyan,

    Thanks for providing the requested information. I am glad you can confirm that the DRDY signal is working correctly at power up, and that you are able to read data when sending the RDATA command

    Can you show us the communication on a logic analyzer to see if we can diagnose the issue? Please include CS, SCLK, DIN, DOUT, and DRDY. Please also show the data before, during, and after the issue occurs

    Can you send us the ADC register settings you are using as well?

    -Bryan

  • Hii  , 

    We analyzed the logic analyzer output for a single data transmission, and the captured data matches our expectations.

    While monitoring the EVM SPI lines during sampling, we observed that the RDATA (0x12) command is issued only once after the START pin is pulled high. After that, the device continuously outputs conversion data until the specified sample count is completed, and then the START pin is pulled low.

    However, in our case, the behavior is different. We are required to send the RDATA command repeatedly in order to receive continuous conversion data. If the RDATA command is not sent every time, no conversion data is received.

  • Hi Pawan Kalyan,

    Can you send us the .sal file for the entire data transaction? Include good data, bad data, etc.. Please also include the START pin

    I also don't see the RDATA command being issued at all on the ADS124S08EVM. I see that the START pin is pulled low all the time. This is necessary because the EVM is using the START/STOP commands to control conversions. I don't see any activity on DIN other than the START / STOP commands, which means the EVM is using the read data direct mode. Can you clarify what you are referring to in your last post? Are you using your own software to communicate with our EVM?

    -Bryan

  • Hii  , 

    I also don't see the RDATA command being issued at all on the ADS124S08EVM. I see that the START pin is pulled low all the time. This is necessary because the EVM is using the START/STOP commands to control conversions.

    Yes, EVM is not sending any RDATA command instead they were sending START/STOP command while collecting the data. 

    I don't see any activity on DIN other than the START / STOP commands, which means the EVM is using the read data direct mode

    Yes, NO Activity on DIN (MOSI) pin other than the START/STOP commands while collecting data. 

    Are you using your own software to communicate with our EVM?

    No, we're using the Delta-Sigma ADC Evaluation Software only. 

    Can you clarify what you are referring to in your last post?

    Yeah! In the previous post, I mentioned "While monitoring the EVM SPI lines during sampling, we observed that the RDATA (0x12) command is issued only once after the START pin is pulled high. After that, the device continuously outputs conversion data until the specified sample count is completed, and then the START pin is pulled low." On rechecking, I realized that this was my oversight in interpreting the EVM SPI data. The correct observation is that with the START pin kept low, the device transmits the START (0x08) command and STOP (0x0A) command on the DIN line to control the conversions.

    I’m trying to figure out the right way to collect continuous data from the ADS124S06.

    In my project:

    • The ADC needs to collect data continuously from a sensor.

    • The same SPI bus is shared with a display, and I’m handling this by using separate chip select (CS) pins for each device.

    • Once powered up, the ADC should start continuous conversions and push the results into a queue for further processing.

    So, my main question is:
    What’s the recommended method to configure the ADS124S06 for continuous data collection over SPI while ensuring smooth operation alongside the display on the same bus?



  • Hi Pawan Kalyan,

    Both methods of reading data - RDATA command and read data direct - should work fine. I tend to favor using the RDATA command because once the command is decoded it is executed, whereas you need to be careful to avoid any glitches on DIN during read data direct or the readback could be corrupted. But again, you can see that the EVM uses read data direct mode and everything works well.

    If you are able to read continuous data using the RDATA command then just keep using that method, there is no reason to switch

    -Bryan

  • Thank you,  , for your valuable time and support. I look forward to receiving the same guidance and assistance in my future tests as well.