cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F0 CPAL I2C Slave

elektrolot
Associate
Posted on June 20, 2013 at 14:18

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
CPAL_I2C_Write(&I2C2_DevStructure);
}

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

In the next frame the first byte is wrong. It looks like 17th byte from last frame. #cpal-i2c-stm32f0
0 REPLIES 0