Difference between revisions of "UCM-iMX95 Yocto Linux: ADC"
(Created page with "= Audio= The carrier-board features WM8962 audio codec with stereo line output and line input. ===List of available sound cards=== * aplay <pre> aplay -l **** List of PLAYBACK...") |
|||
Line 1: | Line 1: | ||
− | + | The SoC features an integrated 8 channel, 12 bit analog to digital converter.<br> | |
− | The | + | <!-- |
− | + | To use the ADC, enable it in device tree e.g. in arch/arm64/boot/dts/compulab/sbc-mcm-imx93.dts: | |
− | |||
<pre> | <pre> | ||
− | + | &adc1 { | |
− | + | vref-supply = <®_vref_1v8>; | |
− | + | status = "okay"; | |
− | + | }; | |
− | |||
</pre> | </pre> | ||
− | * | + | --> |
+ | For sysfs device controls go to: | ||
+ | cd /sys/bus/iio/devices/iio\:device0/ | ||
+ | The EVK carrier board exposes ADC signals on header '''P24'''. | ||
+ | {| class="wikitable" style="text-align:center;" | ||
+ | |- | ||
+ | | '''Signal # || '''pin # | ||
+ | |- | ||
+ | |ADC_IN0 | ||
+ | |2 | ||
+ | |- | ||
+ | |ADC_IN1 | ||
+ | |4 | ||
+ | |- | ||
+ | |ADC_IN2 | ||
+ | |6 | ||
+ | |- | ||
+ | |ADC_IN3 | ||
+ | |8 | ||
+ | |- | ||
+ | |ADC_IN4 | ||
+ | |1 | ||
+ | |- | ||
+ | |ADC_IN5 | ||
+ | |3 | ||
+ | |- | ||
+ | |ADC_IN6 | ||
+ | |5 | ||
+ | |- | ||
+ | |ADC_IN7 | ||
+ | |7 | ||
+ | |- | ||
+ | |} | ||
+ | To read all values, run: | ||
+ | grep . in_voltage[0-7]* | ||
+ | Expected output is a value in range 0 - 4095 which spans over the voltage range 0 - 1.8V, e.g.: | ||
<pre> | <pre> | ||
− | + | in_voltage0_raw:2281 | |
− | + | in_voltage1_raw:2175 | |
− | + | in_voltage2_raw:2306 | |
− | + | in_voltage3_raw:2116 | |
− | + | in_voltage4_raw:1966 | |
+ | in_voltage5_raw:2041 | ||
+ | in_voltage6_raw:1967 | ||
+ | in_voltage7_raw:2128 | ||
</pre> | </pre> | ||
− | |||
− | |||
− | |||
[[Category:Linux]] | [[Category:Linux]] | ||
[[Category:Yocto]] | [[Category:Yocto]] | ||
[[Category:UCM-iMX95]] | [[Category:UCM-iMX95]] |
Latest revision as of 15:47, 9 January 2025
The SoC features an integrated 8 channel, 12 bit analog to digital converter.
For sysfs device controls go to:
cd /sys/bus/iio/devices/iio\:device0/
The EVK carrier board exposes ADC signals on header P24.
Signal # | pin # |
ADC_IN0 | 2 |
ADC_IN1 | 4 |
ADC_IN2 | 6 |
ADC_IN3 | 8 |
ADC_IN4 | 1 |
ADC_IN5 | 3 |
ADC_IN6 | 5 |
ADC_IN7 | 7 |
To read all values, run:
grep . in_voltage[0-7]*
Expected output is a value in range 0 - 4095 which spans over the voltage range 0 - 1.8V, e.g.:
in_voltage0_raw:2281 in_voltage1_raw:2175 in_voltage2_raw:2306 in_voltage3_raw:2116 in_voltage4_raw:1966 in_voltage5_raw:2041 in_voltage6_raw:1967 in_voltage7_raw:2128