Question:
Question about the serial port control register (SCON).
Will the Receive Buffers Full (BBF) bit
read 0 or 1 when the receive buffer register (RBR)
is full but the receive shift register (RSR)
is empty?
Answer:
It should read 0. This bit is a flag that will get set
when both of these registers are full. Basic operation is
that a data word comes into the RSR and
when all bits have come in, the data word is written into
the RBR. Then the program should come
and read the word out of RBR while
another data word is coming into RSR. If
the RSR fills up and the RBR
has not been read (emptied) yet, then you don't want the RSR
to overwrite the RBR, which would cause
data loss. In this instance, the BBF bit
gets set to indicate that both the RSR
and RBR are full, and receive operation
ceases.
|