Hi!
I managed to read 0-5V at one channel on ADS1256 (AINCOm=GND).
Now I want to cycle through all 8channels. I have a problem, that after I updated MUX register with a new channel ,the first value read from ADS1256is allways wrong.
This happens even at the startup for first AIN0 channel. When I measured only at one channel this is not important. I simply ignore. But now this makes me troubles.
I need app 100 sps/channel so I set DRATE register value to 0xA1 (1000SPS/8channels=125SPS per channel).
So If I am cycling two times at each channel (becouse I must ignore first reading) I am reducing sampling speed.
In a datasheet it is written that first value should be OK. But this is not in my case.....
The procedure how I am reading data from ADS1256: (this is not exactelly code).
FOR loop (counting channels from 0 to 7) {
--------------------------------------------------------
waiting dataready DRY pin to go low
----------------------------------------------------------
Sending which channel I want to readto MUX register
SPI.transfer(0x51); // MUX register
SPI.transfer(0x00); // 2nd command byte, write one register only
SPI.transfer(data); // write the databyte to the register
delayMicroseconds(10);
-------------------------------------------------------------
Sending SYNC command
SPI.transfer(0xFC);
delayMicroseconds(10);
------------------------------------------------------------
Senging Wake up command
SPI.transfer(0x00);
delayMicroseconds(10);
----------------------------------------------------------
Reading data from ADS1256
SPI.transfer(0x01); // Read Data 0000 0001 (01h)
delayMicroseconds(10);
adc_val = SPI.transfer(0);
adc_val <<= 8; //shift to left
adc_val |= SPI.transfer(0);
adc_val <<= 8;
adc_val |= SPI.transfer(0);
delayMicroseconds(10);
SPI.endTransaction();
} ... END FOR loop