AnsweredAssumed Answered

STM8S-Discovery I2C problems

Question asked by LaserElettronicaSRL on Jan 12, 2017
Latest reply on Jan 18, 2017 by LaserElettronicaSRL

I have the problem with I2C comunication.

I programmed two STM8S-Discovery with example firmware available in C:\Users\u.iaquinta\Downloads\en.stsw-stm8069\STM8S_StdPeriph_Lib\Project\STM8S_StdPeriph_Examples\I2C\I2C_TwoBoards\I2C_DataExchange

One discovery is master and the second discovery is slave.

Rp1 and Rp2 is 10 K.

 

The interrupt I2C not start.

The master firmware is:

void main()
{

   /* system_clock / 1 */
   CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1);

 

  /* I2C Initialize */
  I2C_Init(I2C_SPEED, 0xA0, I2C_DUTYCYCLE_2, I2C_ACK_CURR, I2C_ADDMODE_7BIT, 16);

 

  /* Enable Buffer and Event Interrupt*/
  I2C_ITConfig((I2C_IT_TypeDef)(I2C_IT_EVT | I2C_IT_BUF) , ENABLE);

 

  enableInterrupts();

 

  .......

  .......

 ........

 

}

 

Any idea?

Thanks

Outcomes