This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

SMBUS issues

Hello everyone,
I'm actually working on the MCBSTM32E eval board which is composed of the STM32F103ZE. It is connected to a smart battery component (BQ2040 from TI). The bus between them is SMBUS, so I connected the BQ to I2C1. I have some questions about this latter. I can easily communicate with the BQ BUT :
- First : my own address is always taken by the soft as a 10-bit one instead of a 7-bit (it means that I have to put 0x03 if I want my I2C address to be 0x01) and it is the same when I want to write something in the BQ whose address is 0x0B I have to put 0x17. It seems that I have to add one extra bit (1). How can I change that ?
- Second : the example given in µvision directories (ST Examples) uses while loop to wait for an event (as required in . But when an error occurs (like a missing ack), it means that I'm stuck in the loop forever. How could I handle it ? I think when an error occur I should reset the I2C and recall the function, but I have no idea on how to recall it.
- Third : I don't know why but the BQ sends me an Ack even after the Data Byte H while it should send nothing or a Nack which would mean that I can generate my stop.
I hope my post is not that confusing cause I tried to make as clear as I can.
Thanks in advance,
Regards
Gary

0