AnsweredAssumed Answered

Problem in Data rate when reading multiple channels in AD7124

Question asked by kaveh14934 on Feb 7, 2017
Latest reply on Feb 13, 2017 by kaveh14934

I am reading AD7124 using Arduino Due in continuous conversion mode. I have activated channel0 with a 640SPS. I have used the following code to read RDY bit in Status register to find out when data is ready.

 

while (RDY_BIT == 1)
{
SPI.transfer(0x40 | 0x00); //Tell Communication Register you want to read from Status Register
value = SPI.transfer(0x00); //Get the Status Register Value
if (bitRead(value,7) == 0) //If the last bit of Status register is 0, data is ready
{
RDY_BIT = 0;
}
}

 

The total delay of the loop is ~1.5ms giving ~640SPS. 

 

But when I activate only channel0 and channel2 and use the following code to get data from these two channels using the following code: 

 

while (RDY_BIT == 1)
{
SPI.transfer(0x40 | 0x00); //Tell Communication Register you want to read from Status Register
value = SPI.transfer(0x00); //Get the Status Register Value
if (bitRead(value,7) == 0) //If the last bit of Status register is 0, data is ready
{
RDY_BIT = 0;
channel_id = bitRead(value,1); //Find out which channel is converted, channel2 or channel0
}
}

 

The total delay of the loop becomes ~6.2ms while I expect every single reading still should take 1.5ms. 

I can not find out what is wrong here. 

 

Kaveh

Attachments

Outcomes