AnsweredAssumed Answered

STM32F0 CPAL I2C Slave

Question asked by stysiak.dawid on Jun 20, 2013
I have found strange behavior of CPAL library when device is in slave mode. I use interrupt mode. When I'm waiting for read from master, I prepare data by:

if ((I2C2_DevStructure.CPAL_State == CPAL_STATE_READY) && (TransmitMode == STATE_OFF))
        I2C2_DevStructure.wCPAL_Timeout = 500; //timeout 500ms

during first read data by master all is fine, except that wNumData is one more less that actually read. I have logic analyzer and I see that for example Master read 16 and from wNumData it appears that 17.

In the next frame the first byte is wrong. It looks like 17th byte from last frame.