2020-06-10 07:11 AM
Hi.
Regarding I2C Bus busy problem.
I am using alternative pins (PB4 and PB5), as I have the small chip with fewer pins.
Option bits are set, and verified.
However even at power up the BUSY bit is set. It is set through configuration of the I2C peripheral.
It is cleared when I active SWRST bit, but as soon as I clear it, BUSY is set again.
Is there a problem using alternative pins (or do I need to do something further than setting the option bit)?
2020-06-11 02:19 AM
Update.
Found the problem. I am using an IAR compiler with a ST-LINK emulator. I need to set the option bits after I have uploaded the program and is in break in main. If I let the program set the option bits just prior to initializing the I2C, the chip does not seem to use the alternative setting for the I2C pins.