Apalis IMX8 Continuous ADC

I am trying to capture ADC values with the Apalis IMX8 module. I can read Single Shot fine.

I am wondering about support for continuous mode? I see that the veridan module has support but i cannot find any mention in documentation or through playing with the torizon core. am i missing something?

  • Does the NXP i.MX8QXP ADC driver not support continuous mode?
  • Do i need to use an external ADC for the faster Data reads to be benefiting from the continuous mode?

Hi @BadTalent

Are you sure you are using the Apalis iMX8X? This module is deprecated.

Aren’t you using the Apalis iMX8QM?

Could you please share the following information:

  • Full name of the module with its version
  • Which version of TorizonCore are you using? You can share the output of cat /etc/os-release from the module.

Best regards,

Thanks for the reply.

I have attached the /etc/os-release file content.

ID=torizon
NAME="TorizonCore"
VERSION="5.7.1-devel-20221116154936+build.0 (dunfell)"
VERSION_ID=5.7.1-devel-20221116154936-build.0
PRETTY_NAME="TorizonCore 5.7.1-devel-20221116154936+build.0 (dunfell)"
DISTRO_CODENAME="dunfell"
BUILD_ID="0"
ANSI_COLOR="1;34"

You are correct i am using the Apalis IMX8QM.

Hi @BadTalent !

Could you please share its full name with its version?

Best regards,

This is a custom variant (with little changes regarding the ADC’s) and i will not be sharing the VARIANT variable.

Hi @BadTalent ,

I have been following this project of yours, also with your colleagues in NA.

just to be clear you have an off the shelf version of our Apalis iMX8. There is nothing customized from the hardware perspective on this module. Can you share what you mean by “custom variant”.

Best regards,

This is an off the shelf module. By Custom i mean this is a custom yocto build of the the torizon core.
We have added some product specific scripts/applications.

@henrique.tx @michael.tx any response on the ADC?

Hello @BadTalent ,
In our developer website we have an article about ADC running in continuous mode in TorizonCore:

You can build and run the example container by following the instructions provided and then let us know about your results.

Best regards,
Josep

@josep.tx i have been using these articles as a reference. However in the article it shows in the Continuous Mode a folder named scan_elements i have attached a copy of my iio:device folders. There is no such folder. This is what leads me to believe that the Continuous mode is NOT supported by the current drivers from the TorizonCore. The article seems to be written in such a way that the Continuous mode is reffering to the Verdin modules.

root@06548570:/sys/bus/iio/devices$ ls -lrt iio\:device?/
iio:device1/:
total 0
-rw-r--r-- 1 root root 4096 Jan  1  1970 uevent
-r--r--r-- 1 root root 4096 Jan 11 10:49 suppliers
drwxr-xr-x 2 root root    0 Jan 11 10:49 power
-r--r--r-- 1 root root 4096 Jan 11 10:49 name
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage_scale
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage_sampling_frequency
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage7_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage6_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage5_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage4_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage3_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage2_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage1_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage0_raw
-r--r--r-- 1 root root 4096 Jan 11 10:49 dev
-r--r--r-- 1 root root 4096 Jan 11 10:49 consumers
lrwxrwxrwx 1 root root    0 Jan 11 10:49 subsystem -> ../../../../../bus/iio
lrwxrwxrwx 1 root root    0 Jan 11 10:49 of_node -> ../../../../../firmware/devicetree/base/bus@5a000000/adc@5a890000

iio:device0/:
total 0
-rw-r--r-- 1 root root 4096 Jan  1  1970 uevent
-r--r--r-- 1 root root 4096 Jan 11 10:49 suppliers
drwxr-xr-x 2 root root    0 Jan 11 10:49 power
-r--r--r-- 1 root root 4096 Jan 11 10:49 name
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage_scale
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage_sampling_frequency
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage7_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage6_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage5_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage4_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage3_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage2_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage1_raw
-rw-r--r-- 1 root root 4096 Jan 11 10:49 in_voltage0_raw
-r--r--r-- 1 root root 4096 Jan 11 10:49 dev
-r--r--r-- 1 root root 4096 Jan 11 10:49 consumers
lrwxrwxrwx 1 root root    0 Jan 11 10:49 subsystem -> ../../../../../bus/iio
lrwxrwxrwx 1 root root    0 Jan 11 10:49 of_node -> ../../../../../firmware/devicetree/base/bus@5a000000/adc@5a880000

Hey @BadTalent

I don’t see any scan_index members in the channel def inside imx8qxp_adc.c « adc « iio « drivers - linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules, so I doubt it supports continuous mode. That might be a little bleeding-edge or something for that adc code. Continuous mode seems to be one of the last things that gets done with those iio adc drivers.

I guess depending on your speed requirements, you can cycle thru the channels in one shot mode using your own driver or even userland stuff.

@DaveM Thanks for your reply! Your right i dont see anything relating to the scan_index. I Believe the Verdin Modules also utalize the ti-ads1015 external adc That would explain the scan_elements being present on the verdin module. I think this has answered my question. I believe that i will have to implement an external ADC that is capable of using a continuous mode.

1 Like

You know @BadTalent , before you go that route with an external adc sitting on the i2c bus, you could try wiring your inputs up to the internal adc and handle your “continuous” mode using some sort of timer-based deal to just cycle thru the one shot results (and re-enable when done) and make those results available? Again, it just depends on your specific requirements though.

Good luck!

@DaveM thanks that’s what i was currently doing. it unfortunately is not sufficient for my needs.
I will probably look towards an SPI external ADC since i require sample rates that exceed the i2c bus capabilities.

1 Like