ADC
Overview¶
The i.MX 91 includes a 12-bit analog-to-digital converter (ADC) supporting a sample rate of up to 1 MS/s. The DART-MX91 exposes four ADC inputs with a 1.8V reference. Raw conversion results range from 0 at 0V to 4095 at 1.8V.
The ADC inputs are available on the DART-MX91 and Sonata-Board connectors as follows:
| ADC input | DART-MX91 connector | Sonata-Board connector |
|---|---|---|
| ADC_IN0 | J3.76 | J23.24 |
| ADC_IN1 | J3.78 | J23.26 |
| ADC_IN2 | J3.80 | J23.36 |
| ADC_IN3 | J3.82 | J23.38 |
An unconnected ADC input is floating and may read near mid-scale. Do not use a floating-channel reading as a voltage measurement.
Reading the ADC Inputs¶
Use the following script to read all four inputs through the Linux IIO sysfs interface:
#!/bin/sh
D=/sys/bus/iio/devices/iio:device0
echo "== Raw readings =="
echo "ADC_IN0: DART-MX91 J3.76, Sonata J23.24, raw $(cat $D/in_voltage0_raw)"
echo "ADC_IN1: DART-MX91 J3.78, Sonata J23.26, raw $(cat $D/in_voltage1_raw)"
echo "ADC_IN2: DART-MX91 J3.80, Sonata J23.36, raw $(cat $D/in_voltage2_raw)"
echo "ADC_IN3: DART-MX91 J3.82, Sonata J23.38, raw $(cat $D/in_voltage3_raw)"
The input voltage can be estimated from the raw value:
Testing ADC_IN0 on the Sonata-Board¶
Power off the board before adding or removing jumper wires. Do not apply more than 1.8V to an ADC input.
Short J23.24 to J23.2 (GND), boot the board, and run the script:
== Raw readings ==
ADC_IN0: DART-MX91 J3.76, Sonata J23.24, raw 0
ADC_IN1: DART-MX91 J3.78, Sonata J23.26, raw 1898
ADC_IN2: DART-MX91 J3.80, Sonata J23.36, raw 1997
ADC_IN3: DART-MX91 J3.82, Sonata J23.38, raw 2032
Short J23.24 to J23.56 (1.8V), boot the board, and run the script:
== Raw readings ==
ADC_IN0: DART-MX91 J3.76, Sonata J23.24, raw 4088
ADC_IN1: DART-MX91 J3.78, Sonata J23.26, raw 1898
ADC_IN2: DART-MX91 J3.80, Sonata J23.36, raw 1997
ADC_IN3: DART-MX91 J3.82, Sonata J23.38, raw 2032
Leave J23.24 floating, boot the board, and run the script: