Difference between revisions of "UCM-iMX95 Yocto Linux: ADC"

From Compulab Mediawiki
Jump to: navigation, search
(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:
= Audio=
+
The SoC features an integrated 8 channel, 12 bit analog to digital converter.<br>
The carrier-board features WM8962 audio codec with stereo line output and line input.
+
<!--
===List of available sound cards===
+
To use the ADC, enable it in device tree e.g. in arch/arm64/boot/dts/compulab/sbc-mcm-imx93.dts:
* aplay
 
 
<pre>
 
<pre>
aplay -l
+
&adc1 {
**** List of PLAYBACK Hardware Devices ****
+
      vref-supply = <&reg_vref_1v8>;
card 1: wm8962audio [wm8962-audio], device 0: HiFi wm8962-0 [HiFi wm8962-0]
+
      status = "okay";
  Subdevices: 1/1
+
};
  Subdevice #0: subdevice #0
 
 
</pre>
 
</pre>
* procfs
+
-->
 +
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>
cat /proc/asound/cards
+
in_voltage0_raw:2281
0 [micfilaudio    ]: micfil-audio - micfil-audio
+
in_voltage1_raw:2175
                      compulab-CompuLabUCM_i.MX95board-
+
in_voltage2_raw:2306
1 [wm8962audio    ]: fsl-asoc-card - wm8962-audio
+
in_voltage3_raw:2116
                      compulab-CompuLabUCM_i.MX95board-
+
in_voltage4_raw:1966
 +
in_voltage5_raw:2041
 +
in_voltage6_raw:1967
 +
in_voltage7_raw:2128
 
</pre>
 
</pre>
 
===Audio Playback===
 
aplay -D hw:1,0 -vv /path/to/media.file
 
  
 
[[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