Part Number: ADS1231
Other Parts Discussed in Thread: ADS1262, ADS124S06, ADS1248
I am polling an ADS1231 in a load cell application. With my applied load I normally get an ADC value of < 0x200000. Occasionally I get ADC values of 0x??ffff.
My code is
void ReadAdc()
{
if( GetDataBit() )
{
return;
}
// read in the data
long newValue = 0;
for( int nBit = 0; nBit < 24; nBit++)
{
Clock(CLOCK_PIN);
newValue <<= 1;
newValue += GetDataBit();
}
// add another clock to force the data pin high so that the above polling works correctly
Clock(CLOCK_PIN);
}
void Delay() { delayMicroseconds(1); }
void Clock(int nPin) { digitalWrite(nPin, 1); Delay(); digitalWrite(nPin, 0); Delay(); }
From a scope trace, I can see that when I get the incorrect reading the dout pin remains high throught the clock pulses.
Although I am checking for DOUT low before starting my reading, I am not synchronised with the ADS1231 sample interval and therefore there is a chance that a new sample is initiated during my poll.
Do I need to wait for DOUT clocking high then low so that I can synchronise to the sample interval?
Is there a better part to use for this application (ideally I would like 20+ bits at about 1ksps)