N76E003 在I2C从机模式时主机连续写数据时写到第二个数据时从机就不应答,导致通讯失败,是怎么回事?搜索
复制
I2C从机初始化代码如下:
//;配置I2C--------------------------------------------------
P13_Quasi_Mode; //set SCL (P13) is Quasi mode
P14_Quasi_Mode; //set SDA (P14) is Quasi mode
SDA = 1; //set SDA and SCL pins high
SCL = 1;
set_P0SR_6; //set SCL (P06) is Schmitt triggered input select.
set_EI2C; //enable I2C interrupt by setting IE1 bit 0
//set_EA;
I2ADDR = SLAVE_ADDRESS; //define own slave address
set_I2CEN; //enable I2C circuit
set_AA;
|