Analog input Read

I setup the I/O2 as analog input :

So, 10V on the I/O, the output value must be 1000.

When I apply 9V; the value is 160,7

With 4,5V on input, the value is 67,7

I use FX30S with the firmware 3.1.0.

Why the value is not good ?

Thank you,

Romuald

Hi Romuald,

It appears there is a bug where Octave is not taking into account that fact that the FX30 IO2 pin has hardware scaling on the ADC. The range of the actual ADC without the hardware scaling is 0V - 1.7V.

Until this is resolved, you can use this fact to calculate the scaling coefficients:

a1 = 1000mv / 1700mV ~= 0.58

Some fine tuning of the coefficent may be needed to match your hardware. This is working on my FX30:

0 - 10 V reports approximately 0 - 1000mV

Thanks,
Ian

Hi

I also noticed that whilst the ADC is actually 15 bit the Legato system LE_ADC read is only providing 1 mV resolution for the 1.7V FSD (about 11 bits ).

However the ADC1 or the FX30 signal conditioning must be pretty noisy as the FX30 user guide states a precision max of 20mV. Not sure what precision means - maybe this is the noise floor.

The FX30S User guide doesn’t have any documentation on ADC performance

In both FX30 cases there must be a voltage divider which takes the 1-1700mV ADV range to 0-10V

With the 1mV per bit ADC resolution and FX30 voltage divider this gives ~5.88mV per bit resolution.

For fun you can retrieve the real ADC readings using (not that practically helpful if the noise floor is >1mV)

root@fx30s:~# cat /sys/devices/qpnp-vadc-8/mpp4_div1
Result:1778530 Raw:a789

As you can see the FSD is > than 1.7V
Result is in uV
Raw has a massive zero offset so some work is being done in the driver to calculate the “Result”