想要用stm32f205和stm8s使用i2c通讯,目前
1:STM8s=350k、stm32f205=350k
STM8s 传值给 stm32f205 ok
stm32f205 传值给 STM8s 错误
2:STM8s=380k、stm32f205=350k
STM8s 传值给 stm32f205 ok
stm32f205 传值给 STM8s 错误
3:STM8s=100k、stm32f205=100k
STM8s 传值给 stm32f205 ok
stm32f205 传值给 STM8s ok
4:STM8s=200k、stm32f205=200k
STM8s 传值给 stm32f205 ok
stm32f205 传值给 STM8s 错误
5:STM8s=350k、stm32f205=100k
STM8s 传值给 stm32f205 ok
stm32f205 传值给 STM8s ok
好像只要将stm32f205的速度超过100k,stm8s就收不到值
目前stm8s设定如下
void I2C_Config(void)
{
Input_Clock = CLK_GetClockFreq()/1000000; //震盪器使用8Mhz
I2C_DeInit();
I2C_Init(400000, 0x6A, I2C_DUTYCYCLE_2, I2C_ACK_CURR, I2C_ADDMODE_7BIT, Input_Clock);
I2C_ITConfig((I2C_IT_EVT |I2C_IT_BUF), ENABLE);
}
请问我是哪裡少设了? |