AnsweredAssumed Answered

ack generated once in I2C slave receiver mode

Question asked by Gaston Schelotto on Aug 30, 2011
Latest reply on Sep 7, 2011 by Gaston Schelotto
Hello,

I'm using STM8L152C6 as a slave I2C device. I'm able to receive the first byte with acknowledge but successive rx data go along with NACKs. Here's my I2C configuration:

CLK_PeripheralClockConfig(CLK_Peripheral_I2C1, ENABLE);
CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1);
I2C_DeInit(I2C1);
I2C_Init(I2C1, 80000,DATACOMM_SLAVE_ADDRESS<<1, I2C_Mode_I2CI2C_DutyCycle_2, I2C_Ack_Enable, I2C_AcknowledgedAddress_7bit);

// Enable I2C Interrupt
I2C_ITConfig(I2C1,(I2C_IT_TypeDef)(I2C_IT_EVT | I2C_IT_BUF), ENABLE);
     
// Set I2C IT software priority as highest
ITC_SetSoftwarePriority(I2C1_IRQn, ITC_PriorityLevel_3);


How should assert successive ACKs after receiving the first byte?
Could someone help me with this issue?
I also attach a screenshot of the I2C timing for further information.

ACK-NACK-stm8b.gif

Thanks in advance,
Gaston

Outcomes