ADC0 setup and in_voltage_raw reading
Running Ubuntu 14.04 + Ubilinux kernel. ADC is enabled in BIOS.
I have 24V connected to a voltage divider (R1=68k, R2=10k) and the output connected to ADC0/GPIO4/PIN7.
Via sysfs, I export gpio4, set direction to in, and connect the output of the voltage divider.
When I read in_voltage_raw (via sysfs /sys/bus/iio...), I get "7" or "8" no matter what, unless I ground it, which I get "0".
in_voltage_scale is 12.890625.
The voltage at the ADC0 pin is around 3.2 so I am expecting (3.2*1000) / 12.89, or 3.2/255, or something, but this thing just reads the same value regardless if its 1.2V, 2.4V at the pin or 3.2V.
How do you correctly setup this ADC0 pin? Do I need to drop the resistor values to 6.8k/1k? I don't know what the desired current rating for this pin is, and I cannot find any setup information to know if I am correctly exporting, writing direction, etc or if there are more steps I need to take to configure ADC0.
Tagged
Categories
- All Categories
- 63 Announcements & News
- 51 Product News - New Product/Product Change Notice/ End-of-life
- 96 Welcome Developers!
- 51 Unboxing & Project Sharing
- 22 Tech Updates
- 3.4K UP Products
- 17 UP 7000
- 1 UP Squared i12
- 11 UP Xtreme i12
- 14 UP Squared Pro 7000
- 1 UP Element i12 Edge
- 23 UP Squared V2
- 65 UP 4000
- 23 UP Xtreme i11
- 34 UP Squared 6000
- 56 UP Squared Pro
- 136 UP Xtreme
- 820 UP Squared
- 1.4K UP Board
- 74 UP Core Plus
- 217 UP Core
- 3 UP Xtreme Lite
- 40 UP AI Edge
- 264 Starter Kits & Peripheral