2014-03-31 10:58 PM
we have been facing problem in I2C communication in STM32F407/417 discovery board. when RCC_APB1PeriphClockCmd(RCC_APB1Periph_I2C1,ENABLE); command is initialized busy flag in SR2 register is set and no other communication is happening . no other flags like SB , TxE , RxNE are being set in SR1 register.
2014-04-01 08:06 AM
2014-04-04 03:16 AM
2014-04-11 06:44 AM
it would be very better if you post your code.
i think if you have busy flag problem , there are 3 assumptions :1- you never stop your and (I2C_GenerateSTOP(I2Cx, ENABLE);)try to reset your board. if it pass busy flag line i think the problem is i mentioned .2- you stop the line but it the busy flag is set again. try : while(!I2C_CheckEvent(I2Cx, I2C_EVENT_MASTER_BYTE_TRANSMITTED)); after I2C_GenerateSTOP(I2Cx, ENABLE); if program hanged in while the problem is your acknowledge . that you never send to slave.3- you may send wrong address in the bus. not that if your slave address is 0x01 you have to send 0x02 for writing on slave and 0x03 for reading from it.