Hardware Reference
In-Depth Information
7
6
5
4
3
2
1
0
Reset value
= 0x00
LOOPS
SCISWAI
RSRC
M
WAKE
ILT
PE
PT
LOOPS: loop select bit
0 = loop operation disabled.
1 = loop operation enabled.
SCISWAI: SCI stop in wait mode
0 = SCI enabled in wait mode.
1 = SCI disabled in wait mode.
RSRC: receiver source bit
When LOOPS = 1, the RSRC bit determines the source for the receiver shift register.
0 = receiver input connected to the transmitter internally (not TxD pin).
1 = receiver input connected externally to the transmitter (TxD pin).
M: data format mode bit
0 = 1 start bit, 8 data bits, 1 stop bit.
1 = 1 start bit, 9 data bits, 1 stop bit.
WAKE: wake-up condition bit
0 = idle line wake-up.
1 = address mark wake-up (last data bit set).
ILT: idle line type bit
0 = idle character bit count begins after start bit.
1 = idle character bit count begins after stop bit.
PE: parity enable bit
0 = parity disabled.
1 = parity enabled.
PT: parity type bit (for both transmit and receive)
0 = even parity selected.
1 = odd parity selected.
Figure 9.9 SCI control register 1 (SCI0CR1/SC1CR1)
operate independently, although they use the same baud rate generator. The CPU monitors the
status of the SCI, writes the data to be transmitted, and processes received data.
9.6.1 Character Transmission
The block diagram of the SCI transmitter is shown in Figure 9.11. To transmit data, the
MCU writes the data bits to the SCI data registers (SCI x DRH/SCI x DRL), which in turn are
transferred to the transmit shift register. The transmit shift register then shifts a frame out
through the TxD pin, after it has prefaced the bits with a start bit and appended a stop bit. The
SCI data registers are the write-only buffers between the internal data bus and the transmit
shift register.
The SCI also sets a flag, the transmit data register empty flag (TDRE), every time it trans-
fers data from the buffer (SCI x DRH/L) to the transmit shift register. The transmit driver routine
may respond to this flag by writing another byte to the transmit buffer, while the shift register
is still shifting out the first byte.
There are three major steps in the SCI transmission.
1. Configure the SCI transmission.
a. Select a baud rate. The user must write an appropriate value to the SCI baud reg-
isters to set the baud rate. Writing to the SCI x BDH register has no effect without
also writing to the SCI x BDL register.
 
Search WWH ::




Custom Search