ADS1115 I2c Read trouble

For general Flowcode discussion that does not belong in the other sections.
Post Reply
seokgi
Posts: 217
http://meble-kuchenne.info.pl
Joined: Thu Dec 03, 2020 1:43 pm
Has thanked: 6 times
Been thanked: 7 times

Flowcode v10 ADS1115 I2c Read trouble

Post by seokgi »

Hello.

I have a question.
I'm reading nine analog values using three ADS1115s.
The ADS1115 inputs are connected correctly and the voltage output is accurate.
I'm reading them using I2C, but the values aren't being written to the correct variables.
I've tried reading them using both the voltage and raw options.
The values are read into different variables. The values are read from different variables, but they're correct.
Is there a way to fix this?

I'm reading the values via SPI, as shown in the attached project.
It's too complicated. I tried modifying it as you suggested.
This also doesn't read the values correctly.
The current method reads the values correctly.

Is there an easier way to handle this?

Thank you.
Attachments
250818-PIC24FJ512GA606_SPI_Master-forum.fcfx
(114.72 KiB) Downloaded 13 times

chipfryer27
Valued Contributor
Posts: 1677
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 373 times
Been thanked: 581 times

Re: ADS1115 I2c Read trouble

Post by chipfryer27 »

Hi

This may or may not relate to you.

Today I had need to use external ADCs and having some ADS1115 modules to hand thought to use them. I only need three channels so I thought it would be a good use.

Connected up using the FC component and tested.

The ADS1115 module has four inputs labelled A0 - A3 and the FC component has four inputs labelled An0 - An3. All good so far.....

When tesing I discovered that instead of:-

ADS / FC
A0 - An0
A1 - An1
A2 - An2
A3 - An3

On all my boards I have the following relationship

ADS / FC
A0 - An3
A1 - An0
A2 - An1
A3 - An2

I don't know if this is somehing astray within FC, or more likely the cheapo boards I have are silkscreened incorrectly. It caused a bit of a headache until I discovered....

Once connected up and I knew pin order, I found the module to be very accurate. Power at 3.3v I was out by a couple of mV against a scope/meter. Close enough for me :)

Regards

chipfryer27
Valued Contributor
Posts: 1677
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 373 times
Been thanked: 581 times

Re: ADS1115 I2c Read trouble

Post by chipfryer27 »

Hi

Further to above if the input signal goes slightly negative, when using the FC command SampleSglVolts, FC returns 8.xx volts which suggests 2's compliment in use in reading, but a possible bug in converting?

Regads

Post Reply