STM32 I2C1 Start bit not set on SR1 register
- by jramirez
Hi guys,
I am trying to program the stm32 to talk to my i2c EEprom, but it seems like everytime I say:
I2C_GenerateSTART(I2C1, ENABLE);
while( !(I2C_CheckEvent(I2C1, I2C_EVENT_MASTER_MODE_SELECT)) ); the code hangs here
I went through with the debugger and I found that the SR1 bit 0 flag (which is the start bit generated flag) is not set which is why the code hangs. I can see in the oscilloscope that the start bit was generated and this works sometimes. it usually breaks when I tried to do several writes in a row. I checked the HW is everything looks fine I checked the frequency that I am running on the i2c bus it is 100Khz well within the 24lc1025 eeprom.
any ideas,
thanks