This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

[参考译文] TPS659037:Palms-gpadc 读数为0

Guru**** 2747095 points

Other Parts Discussed in Thread: TPS659037

请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

https://e2e.ti.com/support/power-management-group/power-management/f/power-management-forum/862826/tps659037-palmas-gpadc-reading-0

器件型号:TPS659037

我们有一个基于 AM57xx GPEVM 的定制板。 我们使用 TPS659037。 在电路板上、我们希望使用 TPS659037上的 GPADC 通道来读取一些电压。 如果我观察 TPS659037上的 GPADC_IN2、我会看到它的读数约为880mV。

在我的 DTS 文件中、我启用了 gpadc、正如 omap5-board-common.dtsi 中所示:

tps659038_gpadc:tps659038_gpadc{
兼容="ti、Palms-gpadc";
中断=<18 0
16 0
17 0>;
IO 通道电池=<1>;
TI、通道0电流微安=<5>;
TI、通道3电流微安=<10>;
};
根据 Palmas-gpadc.txt、可以在 Palmas GPADC 通道2、4和5上读回 GPADC 输入。 但是、当我读回这些值时、我将得到0。  我将在文件系统中直接读取这些内容:

root@rev1:/sys/devices/platform/44000000.ocp/48070000.i2c/i2c-0/0-0058/48070000.i2c:tps659038@58:tps659038_gpadc/IIO:device0# ls
dev in_voltage0_raw in_voltage14_raw in_voltage4_raw in_voltage7_raw of _node
in_temp12_raw in_voltage10_input in_voltage15_input in_voltage5_input in_voltage8_input power
in_temp13_raw in_voltage10_raw in_voltage15_raw in_voltage5_raw in_voltage8_raw 子系统
in_temp1_raw in_voltage11_input in_voltage2_input in_voltage6_input in_voltage9_input uevent
in_temp3_raw in_voltage11_raw in_voltage2_raw in_voltage6_raw in_voltage9_raw
in_voltage0_input in_voltage14_input in_voltage4_input in_voltage7_input name
root@rev1:/sys/devices/platform/44000000.ocp/48070000.i2c/i2c-0/0-0058/48070000.i2c:tps659038@58:tps659038_gpadc/IIO:device0# cat in_voltage5_raw
7.
root@rev1:/sys/devices/platform/44000000.ocp/48070000.i2c/i2c-0/0-0058/48070000.i2c:tps659038@58:tps659038_gpadc/IIO:device0# cat in_voltage5_input
0

我在内核中将调试代码放在 Palmas gpadc.c 中、我可以看到这些读取尝试会从 PMIC 生成 i2c 读取、我看到这些 i2c 行上有活动。
我是否遗漏了什么? 我是否从 Palms-gpadc 读取了错误的频道?
  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    Chris、

    通道2是用于 GPAD_IN2的正确 GPADC 通道。 您是否看过我们使用 GPADC 的用户指南? 它位于以下位置: http://www.ti.com/lit/pdf/slia087

    请告诉我您在本指南中完成了哪些步骤、以及您是否正在进行软件转换我们的自动转换。

    谢谢、

    纳斯塔莎

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    谢谢。 这就是问题所在-通道2是要读取的、而不是通道5。

    我已经阅读了该文档、但错过了这样一个事实、即不同的 Palms-gpadc 兼容器件的通道映射必须不同。 我假设它们都与内核的 palmas-gpadc.txt 文档中记录的一样、但实际上并不是。 现在、我在 TPS659037数据表中看到 GPADC 通道映射。

    我现在都在正确读取电压。  谢谢!

  • 请注意,本文内容源自机器翻译,可能存在语法或其它翻译错误,仅供参考。如需获取准确内容,请参阅链接中的英语原文或自行翻译。

    很棒! 很高兴它现在可以正常工作。 我正在关闭此主题、但如果您有任何其他问题、请随时再次发帖。

    谢谢、

    纳斯塔莎