ADS1115 PROBLEM

For general Flowcode discussion that does not belong in the other sections.
max.tisc
Posts: 122
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Flowcode v10 ADS1115 PROBLEM

Post by max.tisc »

Hi,
I'm testing the ADS1115 component and I've noticed some strange behavior. Basically, in the code, if I select only channel A0 on the UART output, which I read with a serial program, I read the correct value as ch1. The same thing happens if I select only A1, excluding A0 from the program, I correctly read the value as ch2. However, if I activate both channels, the value I should read on ch1 (A0) is seen on ch2, and the value of ch2 (A1) is seen on ch1, as if the two channels ch1 and ch2 were reversed. I also wanted to ask how the ALERT/RDY pin is set, and if it isn't, how to set it as RDY and how to handle it correctly.
Do you have sample code for reading two or more channels? I couldn't find anything in the forum or on the wiki.
I'm attaching the code.
Thanks
Attachments
STM32F411_ADS1115_FC10.fcfx
(29.62 KiB) Downloaded 8 times

stefan.erni
Valued Contributor
Posts: 1083
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 203 times
Been thanked: 229 times

Re: ADS1115 PROBLEM

Post by stefan.erni »

Hi Max.tisc

1.Can you try out change ADS1115 to read Continus mode?
2.Set I2C clock to 400kHz and Samples per second to 64 (later back to 8 or 16)
3.Test the IRQ from the STM32F411 if it is 0.25Hz


Mode:
SNAG-0039.PNG
SNAG-0039.PNG (71.02 KiB) Viewed 159 times
I2C clock Samples per second:
2025-09-23_08-47-10.PNG
2025-09-23_08-47-10.PNG (81.84 KiB) Viewed 159 times

max.tisc
Posts: 122
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Flowcode v10 Re: ADS1115 PROBLEM

Post by max.tisc »

Hi,
1) I've already tried continuous mode with no results.
2) I've already tried 400kHz. I'll try sampling rate adjustment later.
3) Why 0.25Hz?
Thanx

stefan.erni
Valued Contributor
Posts: 1083
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 203 times
Been thanked: 229 times

Re: ADS1115 PROBLEM

Post by stefan.erni »

Hi Max.tisc

One more question: Isn't 9600 Bd a little slow for the Uart?

Your setup from the IRQ:
It shows 0.25Hz
SNAG-0040.PNG
SNAG-0040.PNG (149.58 KiB) Viewed 134 times

max.tisc
Posts: 122
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Flowcode v10 Re: ADS1115 PROBLEM

Post by max.tisc »

Hi,
I tried your suggestions. I reset it to 400kHz, sampled at 64, then went down to 16 and 8. I increased the baud rate to the maximum, set it to continuous mode, and I actually initially set the IRQ rollover value to 15600 to get 1 second. I don't know why it reverted to 65536.
The values ​​for ch1 and ch2 remain reversed. ch1 should read 0.68 and ch2 -0.25 since nothing is connected to it.
Thanks
Attachments
Screenshot 2025-09-23 175023.png
Screenshot 2025-09-23 175023.png (298.02 KiB) Viewed 127 times

stefan.erni
Valued Contributor
Posts: 1083
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 203 times
Been thanked: 229 times

Re: ADS1115 PROBLEM

Post by stefan.erni »

Hi Max.tisc

I tested it with my hardware on ESP32 and ADS1115.
You're right. Something is wrong.
Sometimes the value jumps from one channel to the another.
I suspect that 3channel is also causing problems.
2025-09-24_10-05-03.PNG
2025-09-24_10-05-03.PNG (116.67 KiB) Viewed 103 times

stefan.erni
Valued Contributor
Posts: 1083
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 203 times
Been thanked: 229 times

Re: ADS1115 PROBLEM

Post by stefan.erni »

Can you make a test?

Set Samples per second to 860 ?

On my program it helps....
Ch1, Ch2, Ch3 are ok
Attachments
2025-09-24_10-29-25.PNG
2025-09-24_10-29-25.PNG (11.81 KiB) Viewed 99 times

stefan.erni
Valued Contributor
Posts: 1083
Joined: Wed Dec 02, 2020 10:53 am
Has thanked: 203 times
Been thanked: 229 times

Re: ADS1115 PROBLEM

Post by stefan.erni »

I found this Info
2025-09-24_11-41-30.PNG
2025-09-24_11-41-30.PNG (120.97 KiB) Viewed 71 times
I think you need to leave a minimum delay between the two read values.
This depends on the samples per second you choose..

Here are the minimum values for the delay
2025-09-24_12-10-14.PNG
2025-09-24_12-10-14.PNG (17 KiB) Viewed 71 times

mnfisher
Valued Contributor
Posts: 1671
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 144 times
Been thanked: 772 times

Re: ADS1115 PROBLEM

Post by mnfisher »

You need to either wait on the alert/ready pin change, or busy wait by reading the status register and checking the 'busy' bit.

Martin

max.tisc
Posts: 122
Joined: Thu Dec 10, 2020 5:40 pm
Been thanked: 10 times

Re: ADS1115 PROBLEM

Post by max.tisc »

THANKS stefan.erni
Setting it to 860 works. One question: I'm not using the ALLERT/RDY pin right now, so can it be ignored?

Post Reply