The bus busy flag (BBSY) clears to 0 when a stop condition is detected from an actual waveform. You cannot clear BBSY by writing 0 to it directly.
If issuing the stop condition (writing BBSY = 0 and SCP = 0) is not clearing the condition, this may be because this station or another station is fixing SCL or SDA to low level, and the stop condition is not being properly issued as an actual waveform.
If this station is the one that is fixing SCL/SDA to low level, you can use the following procedure to clear BBSY.
1) Write CLR2 = 1 and CLR1 or CLR0 = 1 (IIC internal latch clear of this station).
2) Confirm that SCL/SDA = high (check port input of shared pin).
3) Enter master transmit mode (write MST = 1, TRS = 1)
4) Issue start condition (write BBSY = 1 and SCP = 0).
5) Confirm that start condition issued (confirm that IRIC = 1).
6) Issue stop condition (write BBSY = 0 and SCP = 0).
7) Confirm that stop condition issued (confirm that STOP = 1).
8) Clear the STOP flag (write STOP = 0).
|H8S/2630, 2639, 2638, 2636, 2635|
|H8S/2472, 2463, 2462|
|H8S/2258, 2239, 2238, 2237, 2227|