Hi,
How do I read the ADC values in IMX6ULL userspace?
for your information reference voltage is 3.3v
in /sys/bus/iio/devices/iio:device0/ I have the following itemssome communities say it is done as below
awk "BEGIN{printf (\"%d\n\", (in_voltage0_raw + in_voltage_offset) * in_voltage_scale)}"
but in my case, there is no in_voltage_offset
if I choose the in_voltage_offset as 0 , only one of the readings make sense
Solved! Go to Solution.
Hi @_ZZ_,
According to the i.MX 6ULL Applications Processor Reference Manual section 13.2
ADC1_IN0 Analog channel 1 input 0 GPIO1_IO00
Also vf610 ADC driver in my Linux firmware and 12 bit resolution is used.
in my Linux user space, it is in_voltage0_raw is the corresponding sysfs file to read the value.
in_voltage_scale is 1048.575927734 (I am not sure how it has been calculated as I have not build the firmware myself).
58098 is my default sampling frequency and available sampling frequencies are below:
206250, 58098, 29676, 15000, 7541
Reference voltage is 3.3v which is an actual regulator. however, every time after I power up my board and run "dmesg" Linux command, I see few kernel warning messages related to the ADC and the reference voltage as below:
[ 2.568224] vf610-adc 2198000.adc: 2198000.adc supply vref not found, using dummy regulator
[ 2.569165] vf610-adc 2198000.adc: Linked as a consumer to regulator.0
Thanks,
Hi @_ZZ_,
@Sanket_Parekh Thanks for your reply,
Modified the device tree as instructed and resolved issue.