Other Parts Discussed in Thread: BQ25601
Hi ,
I have strange conditions with BQ24250, which hangs I2C line.
I have a project , which includes BQ24250 (Charger) , STM32L4R5 (MCU) , 3 x CY3866LTI(PSoC) and bq27421(fuel gauge) , all together shares same I2C line . MCU is a master and all other ICs are slaves .
PSoCs have 0x21,0x22,0x23 addresses and according to datasheet , Charger have 0x6A address .
The commination from MCU to all peripherals includes REPEATED START condition , and most of time performs OK . But once in a while , when MCU requests data from any of PSoCs ,after PSoC responded , Charger hangs the I2C line for ~542 ms.
How do I know is a Charger ? I've made investigation ,and found the condition when I2C hangs.
I have tried disconnecting Charger and Fuel Gauge from the line ,and problem disappears when Chargeris disconnected , and Fuel Gauge connected.
The condition when Changer hangs I2C :
The problem happening , when MCU communicates with any of PSoC and PSoC responds with 0xD4 value as first byte.
In a picture , you can see communication among MCU and PSoCs when PSoCs firmware modified in a such way ,that it forced to respond with 0xD4 ,and I2C hangs .When Charger physically disconnected from the I2C line , the problem disappears .
After that , I've made dirty modification of the PSoCs is a such way that it will never response with 0xD4 as first byte, Charger connected back to the I2C line , and problem disappeared.
Another clue why it is Charger ,is because 0xD4 value is shifted left 0x6A , i.e. 0x6A << 1 = 0xD4 .And 0x6A is Charger's I2C address , so when 0xD4 appears on the line , charger "thinks" that somebody tries to communicate him ,therefore Charger hangs the line waiting for commands.
So my question is : why it's happening ?
My thought about this , is because there REPEATED START condition , but according to Charger's datasheet , page 33 , is compatible to work in such conditions.
So , any help : problem confirmation or explanation why it's happening , will be appreciated.