SCI
1640
SPNU563A – March 2018
Copyright © 2018, Texas Instruments Incorporated
Serial Communication Interface (SCI)/ Local Interconnect Network (LIN)
Module
In polling method, software can poll for the RXRDY bit and read the data from the SCIRD register once
the RXRDY bit 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.
29.2.4.1.2 Receiving Data in Multi-Buffer Mode
Multi-buffer mode is selected when the MBUF MODE bit in SCIGCR1 is set to 1. In this mode, SCI sets
the RXRDY bit after receiving the programmed number of data in the receive buffer, the complete frame.
The error condition detection logic is similar to the single-buffer mode, except that it monitors for the
complete frame. Like single-buffer mode, you can use the polling, interrupt, or DMA method to read the
data. The SCI clears the RXRDY bit after the new data in SCIRD has been read.
29.2.4.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 LINTX 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 module can transmit data in one of the following modes:
•
Single-Buffer (Normal) Mode
•
Multi-Buffered or Buffered SCI Mode
29.2.4.2.1 Transmitting Data in Single-Buffer Mode
Single-buffer mode is selected when the MBUF MODE bit in SCIGCR1 is cleared to 0. In this mode, 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.
29.2.4.2.2 Transmitting Data in Multi-Buffer Mode
Multi-buffer mode is selected when the MBUF MODE bit in SCIGCR1 is set to 1. Like single-buffer mode,
you can use the polling, interrupt, or DMA method to write the data to be transmitted. The transmitted data
has to be written to the SCITD registers. SCI waits for data to be written to the SCITD register and
transfers the programmed number of bytes to SCITXSHF to transmit one by one automatically.