analogRead OPTA in PLC IDE and analogReadResolution()

Documentation says that

https://docs.arduino.cc/tutorials/opta/getting-started#using-opta-plcs-inputs

The maximum voltage managed by the microcontroller is 3V.3

   float voltageA1 = sensorValueA1 * (3.0 / 4095.0)/0.3;

However, In PLC IDE, with that voltage the readings do not exceed 9V. When using 3.3V, they read the real value contrasted with a multimeter.

   float voltageA1 = sensorValueA1 * (3.3 / 4095.0)/0.3;

Could it be a mistake?

on the other hand, by including analogReadResolution(12); in PLC IDE, it sends part of the values ​​in negative, but with a resolution equally as if it were 16 bits. Is there information on this?

Thank you very much and very good job. It has incredible potential!

1 Like

Hello!

Internally the processor works with 3v3, but the Opta enables the processor to read signals from 0-10V

Hi HeronDA! same here, my performance with 16bit resolution (and hard averaging) equals the 12bit ADC performance on other MCUs. The 12 bit resolution selection is really a 4-bit right displacement over 16bit conversions. You can see this browsing the Opta libraries. For sure ADC accuracy margins can be improved.

About ADC Vref 3V3 is possible but not recomendable. Is better to engage a lower internal or external Vref, not shared with other onboard digital devices. I'm pretty sure MCU features this.

I'm waiting for clearance to discover the ADC setup con Opta to tweak adjustments to my interests. ST MCU is really impressing.