V
9  
Tags
There are no tags for this page.
Attachments
Dobrica Pavlinušić's random unstructured stuff
INA3221
ina3221.pdf

OUT INA3221 KACITRAN.jpg



i2c addresses

When I had more than one module, it was necessary to add solder bridges on all modules (even default gnd one) to make than all work, otherwise 0x40 won't work reliably.

all grounds tied together, single input voltage

I have two versions of this modules purple and black, and they seem to have same problem:

Alternative source with better pictures of modifications for multi-voltage support:

simplest modifications with just three holes and three wires

ina3221-800px.jpg

Cutting traces on both sides of board seemed like too much for me, so I decided to use hand drill to scratch top side of board at three places
and disconnect ground and power input from resistors. Add three wires to connect new pin to connect load to or just connect any dupont wire
to use it as 10-bit voltage adc.

Linux setup

root@cubieboard:/home/dpavlin# modinfo ina3221
filename:       /lib/modules/4.19.25-sunxi/kernel/drivers/hwmon/ina3221.ko
license:        GPL v2
description:    Texas Instruments INA3221 HWMon Driver
author:         Andrew F. Davis <afd@ti.com>
alias:          of:N*T*Cti,ina3221C*
alias:          of:N*T*Cti,ina3221
alias:          i2c:ina3221
depends:
intree:         Y
name:           ina3221
vermagic:       4.19.25-sunxi SMP mod_unload ARMv7 thumb2 p2v8

root@cubieboard:/home/dpavlin# i2cdetect -y 2
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: 40 -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         

root@cubieboard:/home/dpavlin# echo ina3221 0x40 > /sys/bus/i2c/devices/i2c-2/new_device 
[Sun May 12 14:23:20 2019] i2c i2c-2: new_device: Instantiated device ina3221 at 0x40

root@cubieboard:/home/dpavlin# sensors
pcf8591-i2c-2-48
Adapter: mv64xxx_i2c adapter
in0:          +2.13 V  
in1:          +2.55 V  
in2:          +0.01 V  
in3:          +1.32 V  

ina3221-i2c-2-40
Adapter: mv64xxx_i2c adapter
in1:          +0.02 V  
in2:          +0.02 V  
in3:          +0.02 V  
in4:          +0.00 V  
in5:          +0.00 V  
in6:          +0.00 V  
curr1:        +0.00 A  (max = +16.38 A, crit max = +16.38 A)
curr2:        +0.00 A  (max = +16.38 A, crit max = +16.38 A)
curr3:        +0.00 A  (max = +16.38 A, crit max = +16.38 A)

# setup correct resistors:

root@cubieboard:/home/dpavlin# grep -A 2 ina3221 /etc/rc.local
echo ina3221 0x40 > /sys/bus/i2c/devices/i2c-2/new_device
sleep 1
ls /sys/devices/platform/soc/*.i2c/i2c-2/2-0040/hwmon/hwmon1/shunt*_resistor | xargs -i sh -cx 'echo 100000 > {}'



 

Upload Files

Click "Browse" to find the file you want to upload. When you click "Upload file" your file will be uploaded and added to the list of attachments for this page.

Maximum file size: 50MB

 
 
 
File Name Author Date Uploaded Size

Save Page As

Enter a meaningful and distinctive title for your page.

Page Title:

Tip: You'll be able to find this page later by using the title you choose.

Page Already Exists

There is already a page named XXX. Would you like to:

Save with a different name:

Save the page with the name "XXX"

Append your text to the bottom of the existing page named: "XXX"

Upload Files

Click "Browse" to find the file you want to upload. When you click "Add file" this file will be added to the list of attachments for this page, and uploaded when you save the page.

 
 
 
Add Tags

Enter a tag and click "Add tag". The tag will be saved when you save the page.

Tag: 

Suggestions: