Skip to main content
elektrolot
Visitor II
June 20, 2013
Question

STM32F0 CPAL I2C Slave

  • June 20, 2013
  • 0 replies
  • 450 views
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
This topic has been closed for replies.