我有I2C
通信的问题。
我在C: Users u.iaquinta Downloads en.stsw-stm8069 STM8S_StdPeriph_Lib Project STM8S_StdPeriph_Examples I2C I2C_TwoBoards I2C_DataExchange中编写了两个带有示例固件的STM8S-Discovery
一个发现是主,第二个发现是奴隶。
Rp1和Rp2是10K。
中断I2C无法启动。
主固件是:
void main()
{/ * system_clock / 1 * /
CLK_HSIPrescalerConfig(CLK_PRESCALER_HSIDIV1); / * I2C初始化* /
I2C_Init(I2C_SPEED,0xA0,I2C_DUTYCYCLE_2,I2C_ACK_CURR,I2C_ADDMODE_7BIT,16); / *启用缓冲区和事件中断* /
I2C_ITConfig((I2C_IT_TypeDef)(I2C_IT_EVT | I2C_IT_BUF),ENABLE); enableInterrupts();
.......
.......
........
}
任何想法?
谢谢
以上来自于谷歌翻译
以下为原文
I have the problem with I2C comunica
tion.
I programmed two STM8S-Discovery with example firmware available in C:Usersu.iaquintaDownloadsen.stsw-stm8069STM8S_StdPeriph_LibProjectSTM8S_StdPeriph_ExamplesI2CI2C_TwoBoardsI2C_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