Other Parts Discussed in Thread: SYSCONFIG, C2000WARE
Dear team:
When I use the routine i2c_ex6_eeprom_interrupt.c, when reading data, set the number of bytes to be read to 0, then my clock line SCL and data line SDA will remain low. After I simulate the reset again, clock line SCL will remain low while data line will remain high. At this time, the IIC bus locks and is stuck in the I2CBusScan(I2CA_BASE,pAvailableI2C_targets) while(! (I2C_getStatus(base) & I2C_STS_REG_ACCESS_RDY)); Here, I have tried to pull down SCL to keep 2ms when configuring the bus, which seems to be unable to exit the bus lock state, I have queried other processing methods on the TI forum, as follows: When I use the routine i2c_ex6_eeprom_interrupt.c, when reading data, set the number of bytes to be read to 0, then my clock line SCL and data line SDA will remain low. After I simulate the reset again, clock line SCL will remain low while data line will remain high. At this time, the IIC bus locks and is stuck in the I2CBusScan(I2CA_BASE,pAvailableI2C_targets) while(! (I2C_getStatus(base) & I2C_STS_REG_ACCESS_RDY)); Here, I have tried to pull down SCL to keep 2ms when configuring the bus, which seems to be unable to exit the bus lock state, I have queried other processing methods on the TI forum, as follows:
void I2CDeadLock(void) { // uint8_t states; I2C_disableReset(I2CA_BASE);//IICMDR.ISR = 0 DEVICE_DELAY_US(2000u); I2C_setConfig(I2CA_BASE, I2C_CONTROLLER_SEND_MODE); I2C_sendNACK(I2CA_BASE);//IICMDR. == 0 I2C_enableFdF(I2CA_BASE); //IICMDR.FDF = 1 I2C_enableLoopback(I2CA_BASE);//IICMDR.DLF = 1 I2C_setDataCount(I2CA_BASE, 1);//ICCINT.ICCINT = 1 I2C_putData(I2CA_BASE,0xFF); I2C_sendStartCondition(I2CA_BASE); DEVICE_DELAY_US(2000u); // while(!(I2C_getStatus(I2CA_BASE) & I2C_STS_REG_ACCESS_RDY)); I2C_enableReset(I2CA_BASE);//IICMDR.ISR = 1 I2C_setConfig(I2CA_BASE, I2C_CONTROLLER_SEND_MODE); I2C_enableFdF(I2CA_BASE); //IICMDR.FDF = 1 I2C_setDataCount(I2CA_BASE, 1);//ICCINT = 1 I2C_putData(I2CA_BASE,0x01); I2C_sendStartCondition(I2CA_BASE); while(!(I2C_getStatus(I2CA_BASE) & I2C_STS_REG_ACCESS_RDY)); I2C_sendNACK(I2CA_BASE); I2C_sendStopCondition(I2CA_BASE); }
With the above code, SDA and SCL can be released, but this will cause my IIC communication to be abnormal.
And when SCL, SDA has been at low power level, this time has been handling interrupt i2cFIFO_isr (), will cause my program to run other. To sum up, one is how do I exit when I am in a deadlock state, and the other is how do I operate when SCL and SDA are still on power,
Best Regards
Zhang