imx6ulevk enable adc1 linux driver

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

imx6ulevk enable adc1 linux driver

跳至解决方案
2,418 次查看
codylacey
Contributor II

Dear All,

I have an imx6ulevk and I am trying to configure ADC1 for GPIO1_IO01__GPIO1_IO01 - GPIO1_IO03__GPIO1_IO03.  I am testing by connecting two potentiometers to GPIO_1 and GPIO_3 of header J1706 out of the Arduino headers.  I have changed the imx6ul-14x14-evk.dts to configure ADC1.  I enabled ADC1 then set the pin control and regulator.  I then disabled tsc and its pin control that was using GPIO_1 and GPIO_3.  I see /sys/bus/iio/devices/iio:device0/in_voltage1_raw and in_voltage3_raw, but their values do not change with the changing voltage.  The values seem to stay around 3100.  I have checked the voltage values with a multimeter to make sure things are connected correctly and they are.  I didn't see any place in u-boot where these pads have already been configured.  Do you know what I may be missing?

reg_adc_vref_3v3: regulator@2 {

  compatible = "regulator-fixed";

  regulator-name = "vref-3v3";

  regulator-min-microvolt = <3300000>;

  regulator-max-microvolt = <3300000>;

  };

&adc1 {

  pinctrl-names = "default";

  pinctrl-0 = <&pinctrl_adc>;

  vref-supply = <&reg_adc_vref_3v3>;

  num-channels = <4>;

  status = "okay";

};

pinctrl_adc: adcgrp {

  fsl,pins = <

  MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0xb0

  MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0xb0

  >;

  };

&tsc {

  status = "disabled";

};

/*pinctrl_tsc: tscgrp {

  fsl,pins = <

  MX6UL_PAD_GPIO1_IO01__GPIO1_IO01 0xb0

  MX6UL_PAD_GPIO1_IO02__GPIO1_IO02 0xb0

  MX6UL_PAD_GPIO1_IO03__GPIO1_IO03 0xb0

  MX6UL_PAD_GPIO1_IO04__GPIO1_IO04 0xb0

  >;

  };*/

标签 (2)
标记 (2)
0 项奖励
回复
1 解答
1,600 次查看
codylacey
Contributor II

The issue was J1706 of the Arduino headers is disconnected from GPIO_0-4 signals by resistors that were DNP.  After adding 0 Ohm resistors to R1718 and R1720 I was able to read voltage with ADC1 on adc input 1 and 3.

在原帖中查看解决方案

0 项奖励
回复
3 回复数
1,601 次查看
codylacey
Contributor II

The issue was J1706 of the Arduino headers is disconnected from GPIO_0-4 signals by resistors that were DNP.  After adding 0 Ohm resistors to R1718 and R1720 I was able to read voltage with ADC1 on adc input 1 and 3.

0 项奖励
回复
1,600 次查看
octetta
Contributor I

Cody, would you mind posting an example of reading the ADC1/3 channel here?

0 项奖励
回复
1,600 次查看
codylacey
Contributor II

I found the issue.

0 项奖励
回复