STM32 I2C1 Start bit not set on SR1 register

Posted by jramirez on Stack Overflow See other posts from Stack Overflow or by jramirez
Published on 2010-03-31T22:04:18Z Indexed on 2010/03/31 23:53 UTC
Read the original article Hit count: 450

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about stm32

Related posts about c