ADC examples on IMX6ULL EVK

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ADC examples on IMX6ULL EVK

2,315 Views
fabio_poiatti
Contributor III

I tried to use the ADC on IMX6ULL EVK without success.

I followed the cap 56 on the linux reference manual anabling the devide driver for Freescale vf610 ADC driver but I don't se the devices ...

/sys/devices/soc0/soc.1/2200000.aips-bus/2280000.adc/iio:device0:

/sys/devices/soc0/soc.1/2200000.aips-bus/2284000.adc/iio:device1:

but in /sys/devices/soc0 

I have only soc directory with 2200000.aips-bus but without any adc directory inside 

/sys/devices/soc0/soc/2200000.aips-bus

drwxr-xr-x 7 root root 0 Jul 19 05:04 .
drwxr-xr-x 12 root root 0 Jul 19 05:04 ..
drwxr-xr-x 3 root root 0 Jul 19 05:04 2280000.dcp
drwxr-xr-x 3 root root 0 Jul 19 05:04 2284000.rngb
drwxr-xr-x 3 root root 0 Jul 19 05:04 2290000.iomuxc-snvs
drwxr-xr-x 3 root root 0 Jul 19 05:04 2294000.snvs-gpr
-rw-r--r-- 1 root root 4096 Jul 26 08:02 driver_override
-r--r--r-- 1 root root 4096 Jul 26 08:02 modalias
lrwxrwxrwx 1 root root 0 Jul 26 08:02 of_node -> ../../../../firmware/devicetree/base/soc/aips-bus@0220000
drwxr-xr-x 2 root root 0 Jul 26 08:02 power
lrwxrwxrwx 1 root root 0 Jul 19 05:04 subsystem -> ../../../../bus/platform
-rw-r--r-- 1 root root 4096 Jul 19 05:04 uevent

Any idea?

Thanks

Fabio

0 Kudos
15 Replies

1,786 Views
fabio_poiatti
Contributor III

I add the following lines in the DTS file

&adc1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_adc1>;
num-channels = <5>;
status = "ok";
};

&iomuxc {
imx6ul-ccimx6ul {
/* Uncomment specific pins of the ADC channels enabled in 'adc-ch-list' */
pinctrl_adc1: adc1grp {
fsl,pins = <
/* GPIO1_4/ADC1_IN4 (pin 7 of the expansion header) */
MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0x80
>;
};
};

and the compile to obtain the DTB file and included it in the boot configuration

So now I see under soc.0/soc/2100000.aips.bus 

the device 2198000.adc and nothing else

It is different from the manual but it seem something ...

Any suggestions to go ahead and see something also under /sys/bus/iio/devices?

Thanks

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

any news?

always in the same condition .... and I also modified the DTS file to produce the adc1 anabled ..

but always I didn't see anything in the /sys directories

Thanks

0 Kudos

1,786 Views
Yuri
NXP Employee
NXP Employee

Hello,

  please check the dts file, if adc is enabled;  by default it is disabled.

imx6ull.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

imx6ul.dtsi\dts\boot\arm\arch - linux-imx - i.MX Linux kernel 

 

Regards,

Yuri.

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

I checked and it is disabled ....

But also changed don't solve the problem ... it seems to be not used the dtsi file

or problably I have to clean something in order to recompile 

How is the sequence to change and reconfigure the project with new dtsi file?

thanks

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

Hi,

any news?

thanks

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

Hi,

I enabled the clock and now I'm able to read/write the ADC registers.

But always I don't se the correct programming interface ...

/sys/devices/soc0/soc.1/2200000.aips-bus/2280000.adc/iio:device0:

/sys/devices/soc0/soc.1/2200000.aips-bus/2284000.adc/iio:device1:

but only /sys/devices/soc0 with inside

drwxr-xr-x 9 root root 0 Jan 1 1970 .
drwxr-xr-x 9 root root 0 Jan 1 1970 ..
drwxr-xr-x 4 root root 0 Jan 1 1970 backlight
-r--r--r-- 1 root root 4096 Aug 5 12:22 family
-r--r--r-- 1 root root 4096 Aug 5 12:22 machine
drwxr-xr-x 2 root root 0 Aug 5 12:22 power
drwxr-xr-x 4 root root 0 Jan 1 1970 pxp_v4l2
drwxr-xr-x 6 root root 0 Jan 1 1970 regulators
-r--r--r-- 1 root root 4096 Aug 5 12:22 revision
drwxr-xr-x 12 root root 0 Jan 1 1970 soc
-r--r--r-- 1 root root 4096 Aug 2 14:24 soc_id
drwxr-xr-x 7 root root 0 Jan 1 1970 sound
drwxr-xr-x 4 root root 0 Jan 1 1970 spi4
lrwxrwxrwx 1 root root 0 Jan 1 1970 subsystem -> ../../bus/soc
-rw-r--r-- 1 root root 4096 Jan 1 1970 uevent

Any suggestions?

0 Kudos

1,786 Views
igorpadykov
NXP Employee
NXP Employee

in general one can also look at MX6ULL FreeRTOS adc examples in

sdk/boards/evkmcimx6ull/driver_examples/adc

"Windows installer - MCUXpresso SDK2.2 for i.MX 6ULL"

SDK2.2_iMX6ULL_WIN


Best regards
igor

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

I didn't find it :-(

do you think I have to configure something in the DTS file?

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

Hi,

the DEMO release does not start ... while also the release coming with the EVK the memtool doese not work

root@imx6ull14x14evk:~# /unit_tests/memtool ADC1.HC0.ADCH
SOC: i.MX6ULL
ADC1 Addr:0x2198000
ADC1.HC0 Addr:0x02198000 Value:0x0000001F - ADC_HC0 can be used for both software and hardware trigger mode.
ADC1.HC0.ADCH(0..4) :0x1f
This 5-bit field selects one of the input channels.

root@imx6ull14x14evk:~# /unit_tests/memtool ADC1.HC0.ADCH=0x0
SOC: i.MX6ULL
write 0x00000000 to Bit 0..4 of 0x02198000
root@imx6ull14x14evk:~# /unit_tests/memtool ADC1.HC0.ADCH
SOC: i.MX6ULL
ADC1 Addr:0x2198000
ADC1.HC0 Addr:0x02198000 Value:0x0000001F - ADC_HC0 can be used for both software and hardware trigger mode.
ADC1.HC0.ADCH(0..4) :0x1f
This 5-bit field selects one of the input channels.

There is some protected areas where is not possible to modify the registers?

Thanks

Fabio

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

any helps?

thanks!

0 Kudos

1,786 Views
igorpadykov
NXP Employee
NXP Employee

Hi Fabio

one can try Demo Images Linux Binary Demo Files - i.MX 6UltraLite, i.MX 6ULL, i.MX 7Dua

and follow sect.4.1.6 Programming Interface Linux Manual included in Linux L4.14.98_2.0.0 Documentation

Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

thanks Igor,

I already saw this chapter ... but  in my system I have this directory contents

root@imx6ull14x14evk:/sys/devices/soc0/soc/2200000.aips-bus# ls -la
drwxr-xr-x 7 root root 0 Jul 26 06:35 .
drwxr-xr-x 12 root root 0 Jul 26 06:35 ..
drwxr-xr-x 3 root root 0 Jul 26 06:35 2280000.dcp
drwxr-xr-x 3 root root 0 Jul 26 06:35 2284000.rngb
drwxr-xr-x 3 root root 0 Jul 26 06:35 2290000.iomuxc-snvs
drwxr-xr-x 3 root root 0 Jul 26 06:35 2294000.snvs-gpr
-rw-r--r-- 1 root root 4096 Jul 26 10:13 driver_override
-r--r--r-- 1 root root 4096 Jul 26 10:13 modalias
lrwxrwxrwx 1 root root 0 Jul 26 10:13 of_node -> ../../../../firmware/devicetree/base/soc/aips-bus@0220000
drwxr-xr-x 2 root root 0 Jul 26 10:13 power
lrwxrwxrwx 1 root root 0 Jul 26 06:35 subsystem -> ../../../../bus/platform
-rw-r--r-- 1 root root 4096 Jul 26 06:35 uevent

and not 

/sys/devices/soc0/soc.1/2200000.aips-bus/2280000.adc/iio:device0:
/sys/devices/soc0/soc.1/2200000.aips-bus/2284000.adc/iio:device1:

(honestly I didn't jave soc.1 directory ...)

I have to enable the ADC in someway?

0 Kudos

1,786 Views
igorpadykov
NXP Employee
NXP Employee

Hi Fabio

had you tried with Demo Image.

Best regards
igor

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

no

and also I'm not able to write the internal register with unit_test/memtool :-(

0 Kudos

1,786 Views
fabio_poiatti
Contributor III

I confirm I'm not abel to write the internal register with memtool

root@imx6ull14x14evk:/unit_tests# ./memtool 2198014 1
E
Reading 0x1 count starting at address 0x02198014

0x02198014: 00000200

root@imx6ull14x14evk:/unit_tests# ./memtool 2198014=0x20f
Writing 32-bit value 0x20F to address 0x02198014
root@imx6ull14x14evk:/unit_tests# ./memtool 2198014 1
E
Reading 0x1 count starting at address 0x02198014

0x02198014: 00000200

root@imx6ull14x14evk:/unit_tests#

the value does not change!

0 Kudos