Other Parts Discussed in Thread: TCA6424A
Hello there,
We have a setup with the MCU I2C module configured in master mode, 400 kbps, RM=0 and is connected to the TI TCA6424A I/O expander device. Bus signal is perfect and somehow our setup works rather well, except that during multi-hours operation, the BB bit in the status register don't want to release from busy for about 0.5% to 0.6% of the time.
Before confirming BB=1 is a problem, there is a timeout of 2ms, which is very long. When BB doesn't want to release itself, we perform I2CMDR_bit.nIRS = 0; then I2CMDR_bit.nIRS = 1; and we're good to go again, until the next occurrence, after which the next checking is always bus released, which means that the BB=1 would never occur in a consecutive manner.
Just an idea for the number of accesses, the checking to the BB bit is performed 3 times each 50ms (20 Hz), every time when a new write or read operation is about to initiated.
It happens for both read or write to the device. Below is the called functions before each write or read operation:
void SetTxMode(u8 count) { I2CCNT = count; //method 1: working fine except bus busy problem I2CMDR_bit.MST = 1; // master mode I2CMDR_bit.TRX = 1; // transmit mode I2CMDR_bit.STT = 1; // send START condition + slave address + TRX state I2CMDR_bit.STP = 1; // send STOP condition once I2CCNT reaches 0 } void SetRxMode(u8 count) { I2CCNT = count; //method 1: working fine except bus busy problem I2CMDR_bit.MST = 1; // master mode I2CMDR_bit.TRX = 0; // receive mode I2CMDR_bit.STT = 1; // send START condition + slave address + TRX state I2CMDR_bit.STP = 1; // send STOP condition once I2CCNT reaches 0 }
We're in this since many months now. Could anyone help please?