2417104_en-US

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

2417104_en-US

2417104_en-US

imx6ull->ADC

Hi,

I am working with an i.MX6ULL-based custom SOM module. For our requirements, we are configuring the pins using Config Tools for i.MX Processors. In Config Tools, I selected Create a Standalone Project, then selected i.MX 6ULL → (6Y2...05).

Our requirement is to configure the pins using Config Tools, take the generated .dtsi file, and use the same file to build the image. However, this did not work initially.

For UART, I understood that we need to add the corresponding device node and set its status to okay. Similarly, a small modification was also required in the generated .dtsi file.

I have attached the .dtsi file generated by Config Tools. Please have a look at it. In that file, when I commented out the imx6ull-board line, the configurations started working properly.

After UART, I moved on to ADC configuration. When I checked the ADC configuration in Config Tools, I noticed that the ADC appears to use the same GPIO pin. However, I observed that when I configure one GPIO pin as GPIO and another GPIO pin as ADC, the generated IOMUX configuration looks the same. Why is this the case? Is this the expected behavior?

Could you please help me understand the correct way to configure and test the ADC on our i.MX6ULL custom SOM?

Also, our original requirement was to configure the pins using Config Tools, take the generated configuration file, and directly use it to build and flash the image. I would like to confirm whether this approach should work for our custom board or whether additional changes are required in the generated .dtsi file.

I have attached the dts and .dtsi file generated from Config Tools for your reference.

Et_MM_0-1790678732208.png

what actually does this meant by?

Re: imx6ull->ADC

Hello @Et_MM 

It seems to be a bug from Config Tools for i.MX6ULL.


Please clarify what GPIO you want as ADC and what other for GPIO function.

I can help you to generate the correct &adc1 node and the correct pinmux.


Best regards,

Salas.

Re: imx6ull->ADC

Hello @Et_MM 

Hope you are doing very well.


Yes, ADC1 is the just one available.


For your use case, please use the below to your device tree:

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

&iomuxc {
        pinctrl_adc1: adc1grp {
                fsl,pins = <
                        MX6UL_PAD_GPIO1_IO03__GPIO1_IO03        0x3000
                        MX6UL_PAD_GPIO1_IO04__GPIO1_IO04        0x3000
                >;
        };
};

That will use just the GPIO1_IO03 and GPIO1_IO04 as ADC channels.

root@imx6ul7d:/sys/bus/iio/devices/iio:device1# cat in_voltage3_raw  
75
root@imx6ul7d:/sys/bus/iio/devices/iio:device1# cat in_voltage4_raw  
0
root@imx6ul7d:/sys/bus/iio/devices/iio:device1# cat name  
2198000.adc


Best regards,

Salas.


Re: imx6ull->ADC

I want GPIO01_IO01 , GPIO01_IO02 as GPIO itself and GPIO01_IO03,GPIO01_IO04 as ADC.
when i searched the dtsi file it looked like we have only one adc that is adc1. adc2 is not available. please correct me if i am wrong.

Also guide me how can i test and verify that adc and gpio pins that we configured is working. How can i test that?

Already i have shared the dts and dtsi file that we are using. Hoping that you have already seen that. Is the configuration in mentioned for adc is wrong in that? 

Re: imx6ull->ADC

Thank you for the reply.
if i want to configure GPIO01_IO01 , GPIO01_IO02 as GPI. How does the configuration will be could you please help me with that also.

Re: imx6ull->ADC

Hello!


You can simply add the below inside the &iomux:

pinctrl_hog: hoggrp {
        fsl,pins = <
            MX6UL_PAD_GPIO1_IO01__GPIO1_IO01        0x10b0
            MX6UL_PAD_GPIO1_IO02__GPIO1_IO02        0x10b0
        >;
    };

Just be sure that is not claimed by another perupheral.


Best regards,

Salas.

Re: imx6ull->ADC

Hi, Thank you for the reply i will try this.

I have tried the ADC with the configuration you gave and when i run those commands this is my output:
root@imx6ul7d:/sys/bus/iio/devices/iio:device0# cat in_voltage1_raw
78
root@imx6ul7d:/sys/bus/iio/devices/iio:device0# cat in_voltage4_raw
74

But any other way to test this pins so i can confirm this is working.



タグ(1)
評価なし
バージョン履歴
最終更新日:
12 時間前
更新者: