Pular para o conteúdo principal
Knowledgebase
Home
Renesas Brasil - Knowledgebase

What should I do to clear BBSY?

Latest Updated:03/13/2012

Question:

During master transmit or receive operation, the bus busy flag (BBSY) sometimes remains set to 1 and does not become 0, regardless of the bus free state with both SCL and SDA at high level. Writing 0 to BBSY or generating a stop condition (writing BBSY = 0 and SCP = 0) does not clear the flag. What should I do to clear BBSY?

Answer:

The bus busy flag (BBSY) is cleared by detecting a stop condition from an actual waveform. Writing 0 to BBSY directly does not clear the flag.
In the case the flag is not cleared to 0 even when a stop condition is generated (writing BBSY = 0 and SCP = 0), it is assumed that the stop condition had not been generated as an actual waveform because SCL or SDA was fixed to low level by this station or another station.
If SCL or SDA is being fixed to low level by this station, release BBSY using the following procedure:

  1. IICRST = 1 (release the SCL/SDA output latch of this station)
  2. IICRST = 0 (release the internal reset)
  3. Confirm SCL/SDA = high level (check the port input of shared pins)
  4. Generate a start condition (write BBSY = 1 and SCP = 0)
  5. Confirm the start condition is generated (confirm SCLO = 0)
  6. Transmit dummy data.
  7. Generate a stop condition (write BBSY = 0 and SCP = 0)
  8. Confirm the stop condition is generated (confirm STOP = 1)
  9. Clear the STOP flag (write STOP = 0)
Suitable Products
R8C/1A
R8C/1B
R8C/20
R8C/21
R8C/22
R8C/23
R8C/24
R8C/25
R8C/26
R8C/27
R8C/28
R8C/29
R8C/2A
R8C/2B
R8C/2C
R8C/2D
R8C/32C
R8C/33C
R8C/35C
R8C/36C
R8C/38C
R8C/3GC
R8C/3JC
R8C/38A