MOTOROLA
9-28
ASYNCHRONOUS SERIAL COMMUNICATIONS INTERFACE
M68HC11
REFERENCE MANUAL
(10 x 16)/(9 x 16 + 9) = 160/153 =
104.56%
The equivalent calculation for 9-bit data format is
(11 x 16)/(10 x 16 + 9) = 176/169 =
104.14%
For 8-bit data format, the baud-rate variation that can be tolerated is about
±
4.5%; for
9-bit data format, the variation is about
±
4%. This analysis assumes one of the devices
was operating at the exact baud-rate frequency, and the calculations show how much
the other device could vary from this. One device operating four percent too slow can-
not communicate with another device operating four percent too fast.
9.4.3 Double-Buffered Operation
The SCI receiver in the M68HC11 is double buffered, which means that the receiver
can have up to two characters in it at any given moment. One of the characters is in a
readable parallel receive data buffer (SCDR); another could be shifting into the receive
serial shift register. This double-buffered arrangement gives software some time to no-
tice a received character and read it before the next serial character is finished. With-
out double buffering, the transmitting device would be required to insert delays
between transmitted characters to avoid a receiver overrun. An overrun occurs in a
double-buffered M68HC11 if a serial character is received and is ready to transfer into
the parallel RDR while there is still a previously received character in the RDR. The
transfer could not occur without destroying the previously received character.
9.4.4 Receive Status Flags and Interrupts
Five status flags are associated with the SCI receiver. RDRF is set and optionally gen-
erates an interrupt request when a character has been received and transferred into
the parallel RDR. The OR flag is set and optionally generates an interrupt request in-
stead of RDRF (if RDRF was already set when a new character was ready to be trans-
ferred into the parallel RDR). When an overrun takes place, the new character is lost,
and the character that was in its way in the parallel RDR is undisturbed. The NF and
FE flags provide additional information about the character in the parallel RDR. Since
NF and FE are always accompanied by RDRF and since RDRF already generates an
interrupt request, NF and FE do not. The last receiver status flag and interrupt source
comes from the IDLE flag. The RxD line is idle if it has constantly been at logic one for
a full character time. The IDLE flag is set only after the RxD line has been busy and
becomes
idle, which prevents repeated interrupts for the whole time RxD remains
idle.
Status flags are set by the SCI logic in response to specific conditions in the receiver.
These flags can be read (polled) at any time by software. Three of the flags (RDRF,
OR, and IDLE) can also optionally generate an automatic interrupt request. The RIE
is a local enable for both RDRF and OR. If RIE is set to one, RDRF and OR generate
interrupts whenever either is set to one. If RIE is zero, RDRF and OR do not generate
interrupts, and the receiver operates in polled mode. ILIE works similarly as a local en-
able for the IDLE status flag. When ILIE is set to one, an interrupt request is generated
whenever IDLE is a one. When ILIE is zero, the IDLE status flag does not generate
interrupt requests. When the receiver wake-up function is enabled (RWU = 1), setting