how to use ina220 current monitor

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

how to use ina220 current monitor

1,653 次查看
odasong
Contributor I

I used the ina220 current monitor by referring to the ls1046frwy document. 

http://www1.futureelectronics.com/doc/NXP/FRWY-LS1046A-TP.pdf 

odasong_4-1697158943647.png

The ina220 current monitor result value is different from what I expected, so I want to modify the ina2xx.c code. According to the QorIQ LS1046A BSP v0.4 document, the source code location is drivers/hwmon/ina2xx.c, but hwmon is not visible in /sys/bus/i2c/drivers. I found hwmon in /sys/class, but when I entered hwmon0 inside, I couldn't find ina2xx.c. I would like to know where I can find ina2xx.c. 

https://www.nxp.com/docs/en/supporting-information/QORIQ_LS1046A_BSP_V0-4_REV-A.pdf 

odasong_1-1697158757388.png

odasong_3-1697158831517.png

 

Additionally, there is a problem that a total of 3 ina220s are used, but only 1 is captured. Is it correct to put the i2c address in channel@2 of the default node in ina2xx.c as shown in the picture below? Also, it would be nice if you could tell me where to modify the calibration register.

odasong_0-1697158664260.png

 

0 项奖励
回复
1 回复

1,607 次查看
yipingwang
NXP TechSupport
NXP TechSupport

Please enable the following options in Linux Kernel configuration file and rebuild Linux Kernel. It seems that these options are not enabled by default.

CONFIG_I2C_MPC=y

SENSORS_INA2XX=y

In the dts configuration, reg is I2C address of the device.

ina220@44 {
compatible = "ti,ina220";
reg = <0x44>;
shunt-resistor = <1000>;
};

0 项奖励
回复