Other Parts Discussed in Thread: REF5040
Hi everyone, I have ADS1158 and I want to use for measuring sensor that is output voltage range 0-4 volt.
I want to use 16 single-ended channels in aoutoscan mode. But I got some nonsense data.
I controlled DRDY by interrupt pin MCU. I read 3 bytes when interrupt occur. Status-data-data (for read, I transfer 3 byte 0xFF)
My register settings below;
#define DATA_CONFIG0 0x12
#define DATA_CONFIG1 0x70
#define DATA_MUXSCH 0x00 // NO EFFECT
#define DATA_MUXDIF 0x00
#define DATA_MUXSG0 0xFF // ALL CHANNELS
#define DATA_MUXSG1 0xFF
#define DATA_SYSRED 0x3C
#define DATA_GPIOC 0xFF
#define DATA_GPIOD 0x00
I writed all that and I read back, no problem.
// INTERRUPT FUNC.----------------
digitalWrite(CS_PIN,LOW);
delayMicroseconds(1);
data[0] = SPI.transfer(0xFF);
data[1] = SPI.transfer(0xFF);
data[2] = SPI.transfer(0xFF);
digitalWrite(CS_PIN,HIGH);
//---------------------------------------------
Adc values is not correct, what did I do wrong. I can send my circuit.
Best regard, Hikmet.