cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F407 I2C INA232 Problem

Hoi
Associate II

Hi everyone,
I am using STM32F407 to read voltage and current values from INA232 and TCA9548.
I have 8 INA232 so I used TCA9548 as I2C Switch.

I have coded as follows:
1. SET TCA9548 on Port 1
2. Read the voltage value on INA232 at port 1

The result I get is 0x00,
I think my I2C function is having problems and != HAL_OK
The return value is 0x00

I used the Oscilloscope and saw a signal on SCL and SDA.

Can you give me some suggestions to solve this problem?
Thanks everyone,



Hoi_0-1700039106263.png

Hoi_0-1700042387194.png

Hoi_1-1700042577069.png

 

1 REPLY 1
Bob S
Principal

First, please post your code by copy/paste into the forum message using the code tags (click on "..." then look for "</>" button).  Just makes it easier for everyone to read.

You don't check the HAL return codes anywhere except in INA232_GetBusVReg() function.  See if something earlier failed.  And what status DOES get returned in INA232_GetBusVReg()?  Then use our debugger and step INTO the HAL_I2C functions and see what goes wrong.