HI,
In my case also ADS1158 is not responding, Can anyone suggest correct initialization sequence of this ADC.
I have tried to read some channel as well as tried to toggle GPIOs. But not able to do both with my current code.
as of now iam using below initialization.
void init_ADC(unsigned short channels)
{
digitalWrite(CS, LOW);
delayMicroseconds(5);
SPI.transfer(0x70); // in default auto scan mode
delayMicroseconds(5);
SPI.transfer(0x00);
delayMicroseconds(5);
SPI.transfer(0x80); // slow mode,disabled current sources
delayMicroseconds(5);
SPI.transfer(0x00); // No fixed mode channel selection
delayMicroseconds(5);
SPI.transfer(0x00); // No diff mode channel selection
delayMicroseconds(5);
SPI.transfer(channels & 0x00FF); // select the channels from AN0 to AN7
delayMicroseconds(5);
SPI.transfer((channels & 0xFF00) >> 8); // select the channels from AN8 to AN15
delayMicroseconds(5);
SPI.transfer(0x01); // Only offset no monitoring
delayMicroseconds(5);
digitalWrite(CS, HIGH);
}