cancel
Showing results for 
Search instead for 
Did you mean: 

How to realize the communication between stm8l101 and mpu6050 with I2C

Myq.221
Associate

CLK_PeripheralClockConfig (CLK_Peripheral_I2C,ENABLE);//

 Delay(2);

 I2C_DeInit();

 /* I2C Peripheral Enable */

 I2C_Cmd(ENABLE);

  /* Apply I2C configuration after enabling it */

  I2C_Init((uint32_t )200000, 0xA0, I2C_DutyCycle_2, I2C_Ack_Enable, I2C_AcknowledgedAddress_7bit);

 while(I2C_GetFlagStatus(I2C_FLAG_BUSY));

it can't continue.

0 REPLIES 0