SCI Configurations
www.ti.com
1730
SPNU563A–March 2018
Submit Documentation Feedback
Copyright © 2018, Texas Instruments Incorporated
Serial Communication Interface (SCI) Module
30.5.1 Receiving Data
The SCI receiver is enabled to receive messages if both the RX FUNC bit and the RXENA bit are set to 1.
If the RX FUNC bit is not set, the SCIRX pin functions as a general-purpose I/O pin rather than as an SCI
function pin. After a valid idle period is detected, data is automatically received as it arrives on the SCIRX
pin.
SCI sets the RXRDY bit when it transfers newly received data from SCIRXSHF to SCIRD. The SCI clears
the RXRDY bit after the new data in SCIRD has been read. Also, as data is transferred from SCIRXSHF
to SCIRD, the SCI sets the FE, OE, or PE flags if any of these error conditions were detected in the
received data. These error conditions are supported with configurable interrupt capability. The wake-up
and break-detect status bits are also set if one of these errors occurs, but they do not necessarily occur at
the same time that new data is being loaded into SCIRD.
You can receive data by:
1. Polling Receive Ready Flag
2. Receive Interrupt
3. DMA
In polling method, software can poll for the RXRDY bit and read the data from SCIRD register once
RXRDY is set high. The CPU is unnecessarily overloaded by selecting the polling method. To avoid this,
you can use either the interrupt or DMA method. To use the interrupt method, the SET RX INT bit is set.
To use the DMA method, the SET RX DMA bit is set. Either an interrupt or a DMA request is generated
the moment the RXRDY bit is set.
30.5.2 Transmitting Data
The SCI transmitter is enabled if both the TX FUNC bit and the TXENA bit are set to 1. If the TX FUNC bit
is not set, the SCITX pin functions as a general-purpose I/O pin rather than as an SCI function pin. Any
value written to the SCITD before TXENA is set to 1 is not transmitted. Both of these control bits allow for
the SCI transmitter to be held inactive independently of the receiver.
SCI waits for data to be written to SCITD, transfers it to SCITXSHF, and transmits the data. The TXRDY
and TX EMPTY bits indicate the status of the transmit buffers. That is, when the transmitter is ready for
data to be written to SCITD, the TXRDY bit is set. Additionally, if both SCITD and SCITXSHF are empty,
then the TX EMPTY bit is also set.
You can transmit data by:
1. Polling Transmit Ready Flag
2. Transmit Interrupt
3. DMA
In polling method, software can poll for the TXRDY bit to go high before writing the data to the SCITD
register. The CPU is unnecessarily overloaded by selecting the polling method. To avoid this, you can use
either the interrupt or DMA method. To use the interrupt method, the SET TX INT bit is set. To use the
DMA method, the SET TX DMA bit is set. Either an interrupt or a DMA request is generated the moment
the TXRDY bit is set. When the SCI has completed transmission of all pending frames, the SCITXSHF
register and SCITD are empty, the TXRDY bit is set, and an interrupt/DMA request is generated, if
enabled. Because all data has been transmitted, the interrupt/DMA request should be halted. This can
either be done by disabling the transmit interrupt (CLR TX INT) / DMA request (CLR TX DMA bit) or by
disabling the transmitter (clear TXENA bit).
NOTE: The TXRDY flag cannot be cleared by reading the corresponding interrupt offset in the
SCIINTVECT0 or SCIINTVECT1 register.