AnsweredAssumed Answered

Stm8 I2c Data Reception problem

Question asked by aggarwal.nitin.002 on Jun 18, 2014
Latest reply on Jun 27, 2014 by turnewitsch.vance
hi clive
I am using Stm8 for using as i2c slave Device
& stm32 as master .
From master I am Sending 2 bytes of  Data after  address
 Problem i am getting is I am getting Data Only once after that only ist byte of data .

Here is  some Lines of Codes From Handler.

INTERRUPT_HANDLER(I2C_IRQHandler, 19)
{
    uint8_t b;

  if((I2C->SR1 & 0x02 )== 0x02)
 {
  b+=I2C->SR1;
  b+=I2C->SR3;
 }
 
 if ((I2C->SR1 & 0x40) ==0x40 )
 {
  test1= I2C->DR;
 }
 //recieve[a]= I2C->DR;
 if ((I2C->SR1 & (0x40|0x04)) ==(0x40|0x04) )
 {
  b=I2C->SR1;
  test2= I2C->DR;
 }
 
  if((I2C->SR1 & 0x10)== 0x10)
 {
  b+=I2C->SR1;
  I2C->CR2|= 0x02;
 }
     
   GPIOB->ODR^=1;
  }

Outcomes