Set scale for ADC

can you please help me with setting of scale for measuring voltage? Now is there default value 0.439453125, but I am not able to measure 3V with this scale, so I want to set 1.000 or just higher than default. But your manual here :How to Use ADC on Torizon OS | Toradex Developer Center for this is little bit different. I don’t have so many files on my board. So how to do that?
I have revision 1.3A for Ixora and 1.1A for Apalis. Everything is up to date.

torizon@apalis-imx8-14904105:/sys/devices/platform/bus@5a000000/5a880000.adc/iio:device0$ ls
in_voltage0_raw in_voltage2_raw in_voltage4_raw in_voltage6_raw in_voltage_sampling_frequency name power uevent
in_voltage1_raw in_voltage3_raw in_voltage5_raw in_voltage7_raw in_voltage_scale of_node subsystem
torizon@apalis-imx8-14904105:/sys/devices/platform/bus@5a000000/5a880000.adc/iio:device0$ sudo echo 1.000 > in_voltage_scale
-sh: in_voltage_scale: Permission denied
torizon@apalis-imx8-14904105:/sys/devices/platform/bus@5a000000/5a880000.adc/iio:device0$ sudo su
root@apalis-imx8-14904105:/sys/devices/platform/bus@5a000000/5a880000.adc/iio:device0# echo 1.000 > in_voltage_scale
sh: echo: write error: Invalid argument

I believe the max voltage is 1.8V. Take a look here: Measuring battery charging level

The maximum ADC input voltage is 1.8V. Applying 3V to an ADC pin can damage the SOC!
Please use a voltage divider based on resistors or an operational amplifier (OpAmp) to adjust the voltage you are measuring to the 0-1.8V range.

The ‘in_voltage_scale’ is not updateable; it simply displays the system scale for the ADC. To obtain the actual voltage in mV, you need to take the raw voltage reading and multiply it by the scale value.
In the case of using a voltage divider, you will also need to multiply the actual voltage measured by the ADC by the division coefficient

Hello @alex.tx
Thanks for clarification.
I’m basing it on this reply where your colleague wrote that up to 3.3V is supported

Hello @Micka,

That post was about the Apalis iMX6, which has a different ADC voltage range than the Apalis iMX8.

Please make sure to always check the specific SoM datasheet for the ADC voltage range, as it can vary between modules.

Best Regards,