Verdin iMX8M Plus with Ivy carrierboard controlling ADC mode of ADS1119

Hello together,

I am trying to read the analog values of the ADS1119 on the Ivy carrierboard.
What currently happens is, that the board starts in differnet modes each time it boots.
From the documentation it says:

AINx_MODE signal is used to select between single-ended and differential measurement modes:
• AINx_MODE=0 for single-ended/voltage measurement
• AINx_MODE=1 for differential/current measurement
• AIN1_MODE is on SODIMM 216.
• AIN2_MODE is on SODIMM 218.

So the board is sometimes in differential measurment and sometimes in single-ended measurment.
Also I am not finding SODIMM 216 or 218 in the gpio info.

Has someone been able to set the mode?

Thanks and regards,
Marcel

1 Like

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Hello Marcel,

ADS1119 ADC Configuration on Ivy Carrier Board

Based on the Ivy Carrier Board documentation, you’re correct about the ADS1119 ADC configuration. The ADS1119 is accessed through the I2C4 interface (SODIMM 93 and 95) (1).

AINx_MODE Signal Configuration

The documentation confirms that:

  • AINx_MODE=0 for single-ended/voltage measurement
  • AINx_MODE=1 for differential/current measurement
  • AIN1_MODE is on SODIMM 216
  • AIN2_MODE is on SODIMM 218 (1)

Why SODIMM 216/218 Don’t Appear in GPIO Info

The reason you’re not seeing SODIMM 216 and 218 in gpioinfo is likely because these pins may not be configured as GPIO by default in the device tree, or they might be assigned to other functions. To control the ADS1119 measurement modes, you’ll need to ensure these pins are properly configured as GPIO outputs.

Solution: Device Tree Configuration

You’ll need to create a device tree overlay to:

  1. Configure SODIMM 216 and 218 as GPIO outputs
  2. Set the desired measurement mode at boot time

The ADS1119 also provides AIN1_DRDY (SODIMM 220) and AIN2_DRDY (SODIMM 222) signals that are active low digital outputs indicating when new conversion data is ready (1).

Recommended Approach

  1. Create a device tree overlay that configures SODIMM 216 and 218 as GPIO
  2. Set initial values for these pins to ensure consistent boot behavior
  3. Control the mode programmatically through GPIO manipulation in your application

This will give you deterministic control over whether the ADS1119 operates in single-ended or differential mode, eliminating the random behavior you’re experiencing at boot.

The analog inputs are accessible through connector J5 with the pinout information provided in the carrier board documentation (1).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI Thank you for your message.
Your suggestion doesnt make sense to me, because the SODIMM 216 and 218 are already defined in imx8mp-verdin-ivy.dtsi
Also in the “Manual” from the Ivy board describes the SODIMM pins already as defined.
Maybe this section from my tcbuild.yaml helps:

# >> the desired output image.
customization:
  # >> Splash screen:
  splash-screen: logo.png
  # >> Directories overlayed to the base OSTree
  filesystem:
     - changes1/
  device-tree:
    # >> Directories where to look for include files.
    include-dirs:
      - external/device-tree-overlays/overlays/
      - external/device-tree-overlays/
      - external/linux-toradex/include/
    # >> Custom device tree source:
    custom: external/linux-toradex/arch/arm64/boot/dts/freescale/imx8mp-verdin-wifi-ivy.dts
    # >> Device-tree overlays configuration:
    overlays:
      # >> Whether to ignore all overlays from the base image (or ostree
      # >> archive in the future).
      clear: true
      # >> Specific overlays not to use from base image (useful only when
      # >> clear is false and not DT has been selected).
      # remove:
        # - apalis-imx8_hdmi_overlay.dtbo
      # >> Overlays to add to output image.
      add:
        - external/device-tree-overlays/overlays/verdin-imx8mp_panel-cap-touch-10inch-dsi_overlay.dts
  kernel:
    arguments:
      - video=LVDS-1:1280x800M@60,panel_orientation=left_side_up
    # >> Custom kernel arguments.
    # arguments:
      # - key1=val1
      # - key2=val2
    # >> Modules to build and possibly load automatically.
    # modules:
      # - source-dir: virtual_touchscreen/
      #   autoload: false
 

So is there some documentation on how to set the mode and to read out the adc values properly?

Thanks and regards,
Marcel

Hello Marcel,

ADS1119 ADC Configuration on Ivy Carrier Board

You’re absolutely right that the SODIMM pins are already defined in the device tree. Looking at the Ivy Carrier Board documentation, the ADS1119 configuration is well-documented (1).

Hardware Configuration Details

According to the documentation, the ADS1119 ADC on the Ivy board has the following configuration (1):

  • AINx_MODE signal controls measurement mode selection
  • AINx_MODE=0 for single-ended/voltage measurement
  • AINx_MODE=1 for differential/current measurement
  • AIN1_MODE is on SODIMM 216
  • AIN2_MODE is on SODIMM 218

The ADC provides data ready signals (1):

  • AIN1_DRDY (SODIMM 220) and AIN2_DRDY (SODIMM 222) are active low digital outputs that notify when new conversion data is ready
  • AINx_DRDY transitions high when conversion result is latched for output transmission

I2C Interface Access

The ADS1119 is accessed through the I2C4 interface (SODIMM 93 and 95) (1).

Controlling the ADC Mode

Since you’re using the imx8mp-verdin-wifi-ivy.dts device tree and the pins are already defined, you should be able to control the AINx_MODE pins directly through GPIO. The inconsistent boot behavior suggests these pins may be floating or not properly initialized.

Recommended Solution

  1. Check GPIO availability - Verify if SODIMM 216 and 218 appear in your system’s GPIO list after boot
  2. Set initial GPIO states - Configure these pins as outputs with defined initial values to ensure consistent measurement mode
  3. Access the ADC via I2C4 - Use the I2C4 interface to communicate with the ADS1119

Since you’re using TorizonCore Builder with a custom device tree, you may need to add GPIO initialization for these mode control pins to ensure deterministic behavior at boot.

The analog inputs are accessible on connector J5 with the specific pinout detailed in the carrier board documentation (1).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI Thank you for your message.

Like I described in my inital post, I cant find SODIMM 216 and 218.

I checked my gpioinfo again and I cant find SODIMM 216 or 218. Here is the output:

gpioinfo
gpiochip0 - 32 lines:
        line   0:      unnamed   "spi1 CS1"  output   active-low [used]
        line   1:      "GPIO2"       unused   input  active-high
        line   2:      unnamed       unused   input  active-high
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      "GPIO3"       unused   input  active-high
        line   6:      unnamed   "spi1 CS2"  output   active-low [used]
        line   7:      unnamed        "mux"  output  active-high [used]
        line   8:      unnamed        "mux"  output  active-high [used]
        line   9:      unnamed       unused  output  active-high
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed       unused   input  active-high
        line  12:      unnamed "regulator-usb1-vbus" output active-high [used]
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed "regulator-usb2-vbus" output active-high [used]
        line  15:      unnamed       unused   input  active-high
        line  16:      unnamed       unused   input  active-high
        line  17:      unnamed       unused   input  active-high
        line  18:      unnamed       unused   input  active-high
        line  19:      unnamed       unused   input  active-high
        line  20:      unnamed       unused   input  active-high
        line  21:      unnamed       unused   input  active-high
        line  22:      unnamed       unused   input  active-high
        line  23:      unnamed       unused   input  active-high
        line  24:      unnamed       unused   input  active-high
        line  25:      unnamed       unused   input  active-high
        line  26:      unnamed       unused   input  active-high
        line  27:      unnamed       unused   input  active-high
        line  28:      unnamed       unused   input  active-high
        line  29:      unnamed       unused   input  active-high
        line  30:      unnamed       unused   input  active-high
        line  31:      unnamed       unused   input  active-high
gpiochip1 - 32 lines:
        line   0:      unnamed       unused   input  active-high
        line   1:      unnamed       unused   input  active-high
        line   2:      unnamed       unused   input  active-high
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6: "SODIMM_143"       unused   input  active-high
        line   7: "SODIMM_141"       unused   input  active-high
        line   8:      unnamed       unused   input  active-high
        line   9:      unnamed       unused   input  active-high
        line  10: "SODIMM_161"         "id"   input  active-high [used]
        line  11:      unnamed "regulator-wifi-en" output active-high [used]
        line  12:  "SODIMM_84"         "cd"   input   active-low [used]
       line  13:  "SODIMM_78"       unused   input  active-high
        line  14:  "SODIMM_74"       unused   input  active-high
        line  15:  "SODIMM_80"       unused   input  active-high
        line  16:  "SODIMM_82"       unused   input  active-high
        line  17:  "SODIMM_70"       unused   input  active-high
        line  18:  "SODIMM_72"       unused   input  active-high
        line  19:      unnamed       unused   input  active-high
        line  20:      unnamed "regulator-module-eth1phy" output active-high [used]
        line  21:      unnamed       unused   input  active-high
        line  22:      unnamed       unused   input  active-high
        line  23:      unnamed       unused   input  active-high
        line  24:      unnamed       unused   input  active-high
        line  25:      unnamed       unused   input  active-high
        line  26:      unnamed       unused   input  active-high
        line  27:      unnamed       unused   input  active-high
        line  28:      unnamed       unused   input  active-high
        line  29:      unnamed       unused   input  active-high
        line  30:      unnamed       unused   input  active-high
        line  31:      unnamed       unused   input  active-high
gpiochip2 - 32 lines:
        line   0:      unnamed       unused   input  active-high
        line   1:      unnamed       unused   input  active-high
        line   2:      unnamed       unused   input  active-high
        line   3:      unnamed       unused   input  active-high
        line   4:      unnamed       unused   input  active-high
        line   5:      unnamed       unused   input  active-high
        line   6:      "DIG_1"       unused   input  active-high
        line   7:      "DIG_2"       unused   input  active-high
        line   8:       "REL1"       unused   input  active-high
        line   9:       "REL2"       unused   input  active-high
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed       unused   input  active-high
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:       "REL4"       unused   input  active-high
        line  15:      unnamed       unused   input  active-high
        line  16:       "REL3"       unused   input  active-high
        line  17:      unnamed       unused   input  active-high
        line  18:      unnamed       unused   input  active-high
        line  19:      unnamed       unused   input  active-high
        line  20:      unnamed       unused   input  active-high
        line  21:      unnamed       unused   input  active-high
        line  22:      unnamed       unused   input  active-high
        line  23:      unnamed       unused   input  active-high
        line  24:      unnamed       unused   input  active-high
        line  25:      unnamed       unused   input  active-high
        line  26:      unnamed       unused   input  active-high
        line  27:      unnamed       unused   input  active-high
        line  28:      unnamed       unused   input  active-high
        line  29:      unnamed       unused   input  active-high
        line  30:      unnamed       unused   input  active-high
        line  31:      unnamed       unused   input  active-high
gpiochip3 - 32 lines:
        line   0: "SODIMM_252"    "Wake-Up"   input   active-low [used]
        line   1: "SODIMM_222"       unused   input  active-high
        line   2:  "SODIMM_36"       unused   input  active-high
        line   3: "SODIMM_220"       unused   input  active-high
        line   4: "SODIMM_193"       unused   input  active-high
        line   5: "SODIMM_191"       unused   input  active-high
        line   6: "SODIMM_201"       unused   input  active-high
        line   7: "SODIMM_203"       unused   input  active-high
        line   8: "SODIMM_205"       unused   input  active-high
        line   9: "SODIMM_207"       unused   input  active-high
        line  10: "SODIMM_199"       unused   input  active-high
        line  11: "SODIMM_197"       unused   input  active-high
        line  12: "SODIMM_221"       unused   input  active-high
        line  13: "SODIMM_219"       unused   input  active-high
        line  14: "SODIMM_217"       unused   input  active-high
        line  15: "SODIMM_215"       unused   input  active-high
        line  16: "SODIMM_211"       unused   input  active-high
        line  17: "SODIMM_213"       unused   input  active-high
        line  18: "SODIMM_189"       unused   input  active-high
        line  19: "SODIMM_244" "PCIe reset"  output  active-high [used]
        line  20:  "SODIMM_38"       unused   input  active-high
        line  21:      unnamed       unused   input  active-high
        line  22:  "SODIMM_76" "regulator-usdhc2" output active-high [used]
        line  23: "SODIMM_135"       unused   input  active-high
        line  24: "SODIMM_133"       unused   input  active-high
        line  25:  "SODIMM_17"       unused   input  active-high
        line  26:  "SODIMM_24"       unused   input  active-high
        line  27:  "SODIMM_26"       unused   input  active-high
        line  28:  "SODIMM_21"     "enable"  output  active-high [used]
        line  29: "SODIMM_256" "regulator-force-sleep-moci" output active-high [used]
        line  30:  "SODIMM_48"       unused   input  active-high
        line  31:  "SODIMM_44"       unused   input  active-high
gpiochip4 - 32 lines:
        line   0:  "SODIMM_42"      "reset"  output   active-low [used]
        line   1:  "SODIMM_46"     "enable"  output  active-high [used]
        line   2: "SODIMM_187"       unused   input  active-high
        line   3:  "SODIMM_20"       unused   input  active-high
        line   4:  "SODIMM_22"       unused   input  active-high
        line   5:  "SODIMM_15"       unused   input  active-high
        line   6: "SODIMM_196"       unused   input  active-high
        line   7: "SODIMM_200"       unused   input  active-high
        line   8: "SODIMM_198"       unused   input  active-high
        line   9: "SODIMM_202"   "spi1 CS0"  output   active-low [used]
        line  10:      unnamed       unused   input  active-high
        line  11:      unnamed       unused   input  active-high
        line  12:      unnamed       unused   input  active-high
        line  13:      unnamed       unused   input  active-high
        line  14:      unnamed        "scl"  output  active-high [used open-drain]
        line  15:      unnamed        "sda"   input  active-high [used open-drain]
        line  16:  "SODIMM_55"        "scl"  output  active-high [used open-drain]
        line  17:  "SODIMM_53"        "sda"   input  active-high [used open-drain]
        line  18:  "SODIMM_95"        "scl"  output  active-high [used open-drain]
        line  19:  "SODIMM_93"        "sda"   input  active-high [used open-drain]
        line  20:  "SODIMM_14"        "scl"  output  active-high [used open-drain]
        line  21:  "SODIMM_12"        "sda"   input  active-high [used open-drain]
        line  22: "SODIMM_129"       unused   input  active-high
        line  23: "SODIMM_131"       unused   input  active-high
        line  24: "SODIMM_137"       unused   input  active-high
        line  25: "SODIMM_139"       unused   input  active-high
        line  26: "SODIMM_147"       unused   input  active-high
        line  27: "SODIMM_149"       unused   input  active-high
        line  28: "SODIMM_151"       unused   input  active-high
        line  29: "SODIMM_153"       unused   input  active-high
        line  30:      unnamed       unused   input  active-high
        line  31:      unnamed       unused   input  active-high

Thanks and regards,
Marcel

Hello Marcel,

Missing SODIMM 216 and 218 GPIO Lines

You’re absolutely correct - looking at your gpioinfo output, SODIMM 216 and SODIMM 218 are indeed missing from the GPIO line names, even though they should be present according to the Ivy Carrier Board documentation (1).

Current GPIO Status

From your output, I can see that:

  • SODIMM 220 is present: line 3: "SODIMM_220" unused input active-high on gpiochip3 (2)
  • SODIMM 222 is present: line 1: "SODIMM_222" unused input active-high on gpiochip3 (2)
  • SODIMM 216 and 218 are missing from the GPIO line names

Root Cause Analysis

This appears to be a device tree configuration issue where SODIMM 216 and 218 are not properly defined with GPIO line names in the current device tree. This is similar to issues reported with other Toradex modules where GPIO line names were missing (3).

Solution Approach

Since you’re using a custom device tree (imx8mp-verdin-wifi-ivy.dts) with TorizonCore Builder, you’ll need to:

  1. Add GPIO line names for SODIMM 216 and 218 in your device tree
  2. Configure these pins as GPIO outputs with proper initialization
  3. Set default values to ensure consistent ADS1119 mode selection at boot

Device Tree Overlay Recommendation

You should create a device tree overlay that explicitly defines SODIMM 216 and 218 as GPIO lines with proper names and initial states. This will:

  • Make the pins visible in gpioinfo
  • Allow you to control the ADS1119 measurement modes consistently
  • Eliminate the random boot behavior you’re experiencing

The ADS1119 ADC configuration requires these mode control pins to be properly initialized as GPIO outputs to ensure deterministic single-ended or differential measurement mode selection (1).

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

@ToradexAI Thank you for your message.

I am a bit confused, I bought the Ivy carrier board from Toradex and I use the official files provided by Toradey without changing them. So I assume they should work. Why do I have to fix the issue? Isnt that a general problem with the devicetree of the Ivy board and iMX8MP Verdin?

Thanks and regards,
Marcel

Hello Marcel,

You're Absolutely Right - This Should Work Out of the Box

You're completely correct to be confused. You purchased an official Toradex Ivy Carrier Board and are using the official Toradex device tree files - this should work without requiring custom modifications.

The Issue You've Identified

Looking at your gpioinfo output, the missing SODIMM 216 and 218 GPIO line names while SODIMM 220 and 222 are present suggests there may be an issue with the official device tree configuration for the Verdin iMX8M Plus + Ivy combination.

According to the Ivy Carrier Board documentation, these pins are essential for ADS1119 operation [(1)](https://docs.toradex.com/116798-ivy_carrier_board_datasheet.pdf#page=13):

  • AIN1_MODE is on SODIMM 216
  • AIN2_MODE is on SODIMM 218
  • AIN1_DRDY (SODIMM 220) and AIN2_DRDY (SODIMM 222) are data ready signals

This Appears to be a Product Issue

Since you're using:

  • Official Toradex hardware (Verdin iMX8M Plus + Ivy Carrier Board)
  • Official Toradex device tree files (imx8mp-verdin-wifi-ivy.dts)
  • Standard TorizonCore Builder configuration

The fact that SODIMM 216 and 218 are missing from the GPIO lines while being documented as essential for ADC mode control suggests this may be a device tree configuration issue in the official BSP.

Similar Issues in the Community

This type of issue has been reported before with other Toradex carrier board combinations where GPIO line names or functionality wasn't properly exposed in the device tree [(2)](https://community.toradex.com/t/verdin-imx8mp-ivy-board-leds/28082).

Recommended Next Steps

Since this appears to be a product-level issue with the official BSP rather than a user configuration problem, I recommend:

  1. Verify the issue - Confirm that the ADS1119 mode control functionality is indeed not working as documented
  2. Check for BSP updates - Ensure you're using the most recent device tree files
  3. Report the issue - This should be reported as a product issue since the official hardware + software combination isn't providing the documented functionality

You're right to expect that official Toradex hardware with official Toradex software should work as documented without requiring custom device tree modifications.

Best regards, Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Hello @mvo,

One important thing that you are doing right is to use the Ivy device tree.
Without it the needed configuration is not present.

The configuration is done in such a way that the GPIOs that change the input modes do not need to be directly manipulated.
When a read is done for either current or voltage, the mode will be changed.

For example:

cat /sys/devices/platform/voltage-divider-ain1/iio\:device*/in_voltage0_raw 
cat /sys/devices/platform/voltage-divider-ain2/iio\:device*/in_voltage0_raw 
cat /sys/devices/platform/current-sense-shunt-ain1/iio\:device*/in_current0_raw 
cat /sys/devices/platform/current-sense-shunt-ain2/iio\:device*/in_current0_raw

If you want to support a single mode of operation that suits you application, the device tree could be simplified to have the mode fixed and the value could be read directly from the sysfs interface provided by the ADS1119.

Best Regards,
Bruno

Hello @bruno.tx,

your solution did work. Thank you!
Out of curiosity, why is it not working if I use the commands from How to Use ADC on Torizon OS?
Also, how can I set the sample frequency using your approach?

Thanks and regards,
Marcel

Hello @mvo,

The hardware setup to allow for both modes on the Ivy carrier board is a bit more complex, as you can see on the schematics: Ivy Carrier Board | Toradex Developer Center
Therefore the page you reference does not apply to it.
I will raise this internally so this is documented.

Regarding the sample rate, you can configure them through the sysfs interface for the iio device.
For example, for voltage on AIN1:

echo 90 > /sys/bus/i2c/devices/2-0040/iio\:device*/in_voltage0-voltage1_sampling_frequency

AIN2 is on address 2-0041.
Available frequencies are under /sys/bus/i2c/devices/2-0040/iio\:device*/sampling_frequency_available.
For more information on the configuration here, you can have a look at the device tree: imx8mp-verdin-ivy.dtsi « freescale « dts « boot « arm64 « arch - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules

Best Regards,
Bruno

Hello @bruno.tx,

Thank you very much for your replies, they were really helpfull!

Thanks and regards,
Marcel

1 Like