21ic问答首页 - N76E003 I2C从机模式时主机连续写数据不应答
N76E003 I2C从机模式时主机连续写数据不应答
yjrqway2022-08-24
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;
复制
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;
赞0
评论
2022-09-09
赞0
评论
2022-09-09
赞0
评论
2022-08-27
赞0
评论
2022-08-25
赞0
直接在官方的例子修改的。
评论
2022-08-24
赞0
评论
2022-08-24
您需要登录后才可以回复 登录 | 注册