Page 2 of 2

Re: ADS1115 PROBLEM

Posted: Wed Sep 24, 2025 5:19 pm
by mnfisher
Or wait a while 😊

The alert ready pin can be ignored - for it to function it needs to be set up in the ads registers.

Martin

Re: ADS1115 PROBLEM

Posted: Wed Sep 24, 2025 5:56 pm
by max.tisc
Hi,
I tried inserting the suggested 125mS delay for 8-sample sampling and added a very crude RDY pin handler. I'll ask mm-fisher if this is correct or if he suggests something more suitable. Testing on two channels seems to work well.

Re: ADS1115 PROBLEM

Posted: Wed Sep 24, 2025 7:39 pm
by mnfisher
Attached are two samples: Neither use the component (sorry) - but one shows how to use an interrupt to read the ADC when conversion is complete (and reads channels 1-4) (it uses a pin change interrupt on the rdy pin to signal to the program that the conversion is complete) , and one constantly reads the status register - and reads the value when the flag bit is set. (the handling of the gain is a bit inelegant - and should probably be stored rather than sent to setup reading and conversion to volts)

Your code busy waits on the rdy pin - but it needs to do this before reading the sample - then request a second channel - and wait again.

You can use a delay - depending on the sample rate set - the component used to use a 10ms delay (at 128 samples per second) - hence the code as needed to sample at 860sps...

Data Rate (SPS) Single Conversion Time
8 125 ms
16 62.5 ms
32 31.25 ms
64 15.63 ms
128 (Default) 7.81 ms
250 4.0 ms
475 2.1 ms
860 ~1.16 ms

Faster rates will give 'noisier' readings.

Martin