2023-05-05 06:46 AM
Hi,
I'm using STM32F429 to talk to TI BQ40Z50 via I2C, and I ran into an issue I have no clue.
First of all, the code simply reads registers, and it works on TI BQ20Z95. The same code doesn't work on BQ40Z50. The HAL library always returns HAL_BUSY, and the error code is 32 (timeout). However, the logic analyzer doesn't have any waveforms. Both SCL and SDA are held high the entire time.
The most puzzling part is that if I disconnect the BQ40Z50, let the STM read registers (reads nothing obviously) several times, and connect the chip back. It works like a charm.
any suggestions I can try?
The I2C is running at 100KHz, with internal pull-up registers.
Thanks!
Solved! Go to Solution.
2023-05-05 12:23 PM
Internal pull-ups are too weaker than I2C spec calls for. They may work, most of the time, depending on your hardware configuration. The system will be more reliable with external, lower value resistors.
What IS your hardware configuration? Is this a NUCLEO board wired to TI Eval Boards? Are you connecting GND between the boards? Are you powering the TI board from the NUCLEO?
Look at the I2C lines with a scope instead of a logic analyzer. See what voltage levels you are getting.
2023-05-05 12:23 PM
Internal pull-ups are too weaker than I2C spec calls for. They may work, most of the time, depending on your hardware configuration. The system will be more reliable with external, lower value resistors.
What IS your hardware configuration? Is this a NUCLEO board wired to TI Eval Boards? Are you connecting GND between the boards? Are you powering the TI board from the NUCLEO?
Look at the I2C lines with a scope instead of a logic analyzer. See what voltage levels you are getting.
2023-05-07 06:44 PM
Hi Bob,
Thanks for the insight. it was indeed the internal pull-up issue. it works great with external pull-ups.
Thanks!