Hi!
I have a board with 2 ADS1115 with addresses 0b1001000 and 0b1001001
intended for 4ch single ended measurements. I2C speed is set to 100k.
I want to use them in single shot mode but it seems that they never finish
a conversion. Chip markings are: 11 BOG1
I have stripped my code (using codevision) down to:
#define ADC_1 0b1001000
#define ADC_2 0b1001001
#define CONFIG 0b00000001
#define RESULT 0b00000000
#define COMPLETE 0b10000000
conf = 0b1100000111100011;
twi_tx[0]= CONFIG;
twi_tx[1]= conf>>8;
twi_tx[2]= conf;
twi_master_trans(ADC_2, twi_tx, 3, twi_rx, 0);
delay_ms(2);
twi_tx[0]=RESULT;
twi_rx[0]=0;
twi_rx[1]=0;
twi_master_trans(ADC_2, twi_tx, 1, twi_rx, 2);
result= ((unsigned int)twi_rx[0]<<8)|twi_rx[1];
and running it gives only 0x8000
When I had:
while (!( status & COMPLETE))
{
twi_tx[0]=CONFIG;
twi_rx[0]=0;
twi_rx[1]=0;
twi_master_trans(addr, twi_tx, 1, twi_rx, 2);
status=twi_rx[0];
delay_us(100);
}
instead of 2ms delay then it never get past that loop.
I have played with the channels, sampling rate, comparator bits for no avail.
I have run out of ideas what else to check....
For me it seems that the ADS1115 chips have been damaged, but what makes it dubious
is that the I2C communication works correctly and that there are two chips in the system.
What could be the issue?