Posted on January 03, 2014 at 15:25The original post was too long to process during our migration. Please click on the attachment to read the original post.
if (I2C_GetITStatus(I2C1, I2C_IT_TXIS)) { jTX++; I2C_ClearITPendingBit(I2C1, I2C_IT_TXI); if (jTX > 2) { // without this delay below, the byte sent previously was gone !! uint16_t delay; for (delay = 0; delay < 0x100; delay++) {} // brutally kill I2C device and ressurect it // maybe not so nasty/stinky because it only // needed to be done once, after MCU's resetted I2C_Cmd(I2C1,DISABLE); I2C_Cmd(I2C1,ENABLE); } else I2C_SendData(I2C1,jTX); return 0; } is it a solution .. or not ? please advice... update : it is not a solution. after killing I2C and ressurect it, the I2C becomes screwed !!
i'm really very glad to see you in my thread, clive1
i just need a very little advice/info .. : => usually we send something using I2C_SendData(I2Cx, Data) in order to suppress TXI interruption.... my question is : how to CLEAR the TXI flag (Transmit Interrupt) without sending something .. !! ?? !!