Hello,
I am trying to use the full functionality of the INA233 power monitoring IC (datasheet), and I am looking for advice on the best way to do that with a Teensy 3.2.
The INA233 is a bit more special than a regular I2C chip because it implements a PMBus interface, which requires a library of standard PMBus commands, and the ability to read words from INA233-internal registers.
I found an Arduino library for the INA233 that seems perfect for modification: it has all the registers and commands mapped out, and it looks well done. Check it out here.
Unfortunately, I noticed that three of the critical functions, “wireReadBlock”, “wireReadWord”, and “wireReadByte” all use a version of the Wire library's "requestFrom" function that takes in 5 arguments. The equivalent function in the teensy libraries only has three arguments. The critical difference between these functions seems to be that the Arduino Wire "requestFrom" function handles access to remote chip internal registers.
Here is a link to the Arduino requestFrom definition in the Arduino Github.
And here's a link to the requestFrom definition in the teensy Wire library.
I realize that someone else on this forum has already been working on a PMBus library, but it looks too specific to be worth trying to port, especially since the major issue with the INA233 Arduino library seems to be confined to three functions.
However, I am an amateur, and I've come to this forum for to ask for help deciding on a path forward. I get the sense that modifying the underlying Wire libraries is not a good idea.
My question now is: If it were up to you to communicate with this INA233 with a Teensy 3.2, and you knew about the Arduino library, and its conflicts with the Teensy Wire library, what would you do?
I am trying to use the full functionality of the INA233 power monitoring IC (datasheet), and I am looking for advice on the best way to do that with a Teensy 3.2.
The INA233 is a bit more special than a regular I2C chip because it implements a PMBus interface, which requires a library of standard PMBus commands, and the ability to read words from INA233-internal registers.
I found an Arduino library for the INA233 that seems perfect for modification: it has all the registers and commands mapped out, and it looks well done. Check it out here.
Unfortunately, I noticed that three of the critical functions, “wireReadBlock”, “wireReadWord”, and “wireReadByte” all use a version of the Wire library's "requestFrom" function that takes in 5 arguments. The equivalent function in the teensy libraries only has three arguments. The critical difference between these functions seems to be that the Arduino Wire "requestFrom" function handles access to remote chip internal registers.
Here is a link to the Arduino requestFrom definition in the Arduino Github.
And here's a link to the requestFrom definition in the teensy Wire library.
I realize that someone else on this forum has already been working on a PMBus library, but it looks too specific to be worth trying to port, especially since the major issue with the INA233 Arduino library seems to be confined to three functions.
However, I am an amateur, and I've come to this forum for to ask for help deciding on a path forward. I get the sense that modifying the underlying Wire libraries is not a good idea.
My question now is: If it were up to you to communicate with this INA233 with a Teensy 3.2, and you knew about the Arduino library, and its conflicts with the Teensy Wire library, what would you do?