
MOTOROLA
9-20
ASYNCHRONOUS SERIAL COMMUNICATIONS INTERFACE
M68HC11
REFERENCE MANUAL
latched port D data from half flip-flop (HFF) [3] drives the pin buffer. HFF [3] holds the
last data written to PORTD even if the transmitter was enabled at the time.
The DDRD1 control bit provides an enable for pin output buffer [1] and a select to mul-
tiplexer [4]. When PORTD is read, analog switch [5] couples the output of multiplexer
[4] onto the data bus to the CPU. Multiplexer [4] determines what will be returned on
reads of port D. If DDRD1 is one, the output of the port D bit 1 latch [3] is read. If
DDRD1 is zero, pin input buffer [6] is read. When the SCI transmitter is enabled, set-
ting DDRD1 to zero allows software to directly read the current state of the TxD pin as
data is being serially transmitted. In unusual cases, port D bit 1 latch [3] can be used
as a software flag bit that can be written and read without disturbing SCI transmis-
sions.
Probably the most commonly used aspect of the TxD pin logic is the ability to control
what the pin does after the SCI gives up control. For the pin to revert to a driven high,
write DDRD1 and port D bit 1 to ones. For the pin to revert to high impedance, write a
zero to DDRD1. This high-impedance choice is useful in multidrop systems where
more than one transmitter is connected to a common transmit line but no more than
one transmitter is ever simultaneously using the line. The high-impedance choice can
also be used to make a two-wire SCI system where the TxD and RxD pins of the
M68HC11 are tied together and data travels in only one direction at a time (half du-
plex).
Since the M68HC11 is a CMOS device, it is a good idea to select the wired-OR option
with DWOM whenever more than one output driver could potentially try to drive the
same line.
9.4 SCI Receiver
The SCI receiver is responsible for synchronization to the serial data stream and re-
covery of data characters. Since the data stream has no clock, data recovery depends
on the transmitting device and the receiving device operating at close to the same
baud rate. The SCI system can tolerate a moderate amount of system noise without
losing any information.
The SCI receive function is somewhat more difficult than the transmit function due to
the asynchronous nature of incoming serial data. A significant amount of discussion
will be devoted to the way the M68HC11 recognizes a start bit because this procedure
determines the amount of baud-rate frequency mismatch that can be tolerated and
gives an indication of how well this SCI receiver can handle noise. Second, basic dou-
ble-buffered receive functions are discussed. Finally, the two variations of the receiver
wake-up function are explained.
9.4.1 Data Sampling Technique
The receiver front-end logic uses a sampling clock that is 16 times the baud-rate fre-
quency. This sampling clock is called the RT clock in the following discussion, and one
RT is understood to be one-sixteenth of a bit time. In the following figures, the RT clock
cycles are numbered from one (start of a bit time) to 16 (end of a bit time).