libdriver / ina219

INA219 full function driver library for general MCU and Linux.
https://www.libdriver.com
MIT License
35 stars 10 forks source link

Possible error while setting the calibration register #10

Closed ernestguillem closed 1 year ago

ernestguillem commented 1 year ago

Version

No response

Describe the bug

The calibration register is shifted left by 1 bit before being written. I'm assuming this is because the datasheet explicitly says that bit 0 in the calibration register is not used in the calculation. However never says that the calculated calibration value needs to be shifted. In fact, when using the driver i get the currents multiplied by 2 unless I do not shift this calibration value.

Could this be an error? Has anyone else experienced it?

Reproduce

No response

Expected behavior

No response

Additional context

For context, I've found this in the Texas Instruments forum: https://e2e.ti.com/support/amplifiers-group/amplifiers/f/amplifiers-forum/660458/ina219-ina219-calibration-register

ernestguillem commented 1 year ago

Thank you. PR #11 closes this