MOTOROLA
9-16
ASYNCHRONOUS SERIAL COMMUNICATIONS INTERFACE
M68HC11
REFERENCE MANUAL
by simply making T8 equals one or T8 equals zero, respectively. Odd and even parity
require software calculations with the resulting parity-bit value stored in T8. A new T8
value will have to be calculated for each serial character.
9.3.2 Interrupts and Status Flags
Two status flags are associated with the SCI transmitter. These flags are read by soft-
ware to tell when the corresponding condition exists. This technique is called polling.
Alternatively, a local interrupt enable bit can be set to enable each of these status con-
ditions to generate interrupt requests when the corresponding condition is present.
This technique is called an interrupt-driven operation. Status flags are automatically
set by hardware logic conditions, but software clears these flags, which provides an
interlock mechanism for logic to know when software has noticed the status indication.
The software clearing sequence for these status flags is automatic in that functions
normally performed in response to the status flags also satisfy the conditions of the
clearing sequence.
When the transmitter is first enabled (TE written to one), the TDRE and TC flags are
normally already set. The SCI transmitter should be initialized in such a manner that
the system can handle these interrupts before the TE bit is written to one because an
immediate interrupt can occur from these sources.
The TDRE flag indicates that there is room in the transmit queue to store another data
character in the TDR. The TIE bit is the local interrupt mask for TDRE. When TIE is
zero, TDRE must be polled; when TIE is one, an interrupt is requested whenever
TDRE is one. To clear TDRE, the user must read SCSR while TDRE is one, then write
to SCDR.
The TC flag indicates that the transmitter has finished transmitting everything in its
queue, including any idle preamble or break character that has been queued. The
TCIE bit is the local interrupt mask for TC. When TCIE is zero, TC must be polled;
when TCIE is one, an interrupt is requested whenever TC is one. To clear TC, the user
must read SCSR while TC is one, then write to SCDR.
One interrupt vector is associated with the SCI system; therefore, the interrupt service
routine must begin by reading the SCSR to determine which interrupt(s) caused the
service routine to be called. Possible interrupt sources include the two transmitter
sources previously discussed and three receiver-related sources.
9.3.3 Send Break
In the M68HC11, break characters are character-length periods where the TxD line
goes to zero. The character length for all characters, including idle and break charac-
ters, is influenced by the M bit in SCCR1. When M equals zero, all characters are 10
bit times long; when M equals one, all characters are 11 bit times long. Break charac-
ters have no start or stop bits. As long as the SBK control bit is one, break characters
will be queued and sent. The TxD line will continuously remain at zero while break
characters are being sent. When SBK is written back to zero, at least one bit time of
logic one will appear on the TxD line as soon as the last break character is finished.
This high bit time assures that a receiver can detect the falling edge at the beginning