News:

PROTON pic BASIC Compilers for PIC, PIC24, dsPIC33

Main Menu

INA226 any code

Started by John Drew, Sep 17, 2025, 07:41 AM

Previous topic - Next topic

John Drew

I'm starting on a project using the INA226 by TI. It's a power/voltage/current measuring device.
It comes on a tiny board with a load resistor and the necessary parts for a few dollars. It's programmed and accessed by I2C.
Has anyone used this device successfully? If so it would save me a lot of time to get some help. The datasheet is OK but moderately complex.
I reckon I can do the fundamentals such as setting up the I2C. Data comms are 16 bit.
Best wishes
John

RGV250

Hi John,
I wonder how it differs from INA260?

Bob

John Drew

Hi Bob,
I'll check in the morning. I may have it worked out after reading the datasheet three times in between having a piece of chocolate, talking to the next door neighbour and making my wife a cup of coffee :-)
My attention span is becoming a bit short of late.
I'd be very interested in any code you might have for the other device though.
Cheers
John

RGV250


RGV250

Hi John,
I had a quick look at the datasheet and some of the registers are different (probably most) but I think the code I posted should give you a good start.

Bob

John Drew

Thanks Bob,
I'll have a good look, even if the registers are different I can be guided by your code. I've used I2C often enough to make that function work.
Cheers
John

John Drew

A very nice piece of code Bob. I can see what you're doing and it's enough to confirm I'm on the right track.
I'll also compare the data sheets in the next few days.
Thanks again for your support.
John

RGV250

Hi John,
If i am still in hospital today I will have a look and modify the definitions file if that will help.
Otherwise I will probably be bored senseless :)

Bob