MC68331
USER’S MANUAL
QUEUED SERIAL MODULE
MOTOROLA
6-25
6
6.4.1.2 Status Register
The SCI status register (SCSR) contains flags that show SCI operating conditions.
These flags are cleared either by SCI hardware or by a read/write sequence. In gen-
eral, flags are cleared by reading the SCSR, then reading (receiver status bits) or writ-
ing (transmitter status bits) the SCDR. A long-word read can consecutively access
both the SCSR and SCDR. This action clears receive status flag bits that were set at
the time of the read, but does not clear TDRE or TC flags.
If an internal SCI signal for setting a status bit comes after the CPU has read the as-
serted status bits, but before the CPU has written or read the SCDR, the newly set sta-
tus bit is not cleared. The SCSR must be read again with the bit set, and the SCDR
must be written or read before the status bit is cleared.
Reading either byte of the SCSR causes all 16 bits to be accessed, and any status bit
already set in either byte is cleared on a subsequent read or write of the SCDR.
6.4.1.3 Data Register
The SCDR contains two data registers at the same address. The RDR is a read-only
register that contains data received by the SCI serial interface. The data comes into
the receive serial shifter and is transferred to the RDR. The TDR is a write-only register
that contains data to be transmitted. The data is first written to the TDR, then trans-
ferred to the transmit serial shifter, where additional format bits are added before trans-
mission. R[7:0]/T[7:0] contain either the first eight data bits received when the SCDR
is read, or the first eight data bits to be transmitted when the SCDR is written. R8/T8
are used when the SCI is configured for 9-bit operation. When it is configured for 8-bit
operation, they have no meaning or effect.
6.4.2 SCI Pins
Two unidirectional pins, TXD (transmit data) and RXD (receive data), are associated
with the SCI. TXD can be used by the SCI or for general-purpose I/O. Function is as-
signed by the port QS pin assignment register (PQSPAR). The receive data (RXD) pin
is dedicated to the SCI.
Table 6-4
shows SCI pin function.
6.4.3 SCI Operation
SCI status flags in the SPSR support polled operation, or interrupt-driven operation
can be employed by the interrupt enable bits in SCCR1.
Table 6-4 SCI Pin Function
Pin Names
Receive Data
Mnemonics
RXD
Mode
Function
Receiver Disabled
Receiver Enabled
Transmitter Disabled
Transmitter Enabled
Not Used
Serial Data Input to SCI
General-Purpose I/O
Serial Data Output from SCI
Transmit Data
TXD