XC886/888CLM
Serial Interfaces
User’s Manual
12-2
V1.3, 2010-02
Serial Interfaces, V 1.0
12.1
UART
The UART provides a full-duplex asynchronous receiver/transmitter, i.e., it can transmit
and receive simultaneously. It is also receive-buffered, i.e., it can commence reception
of a second byte before a previously received byte has been read from the receive
register. However, if the first byte still has not been read by the time reception of the
second byte is complete, one of the bytes will be lost.
Note: The term “UART” is used to represent the serial port in general and is applicable
to both UART and UART1 modules. If it is followed by the word “module” as in
“UART module”, it is used to represent the first UART module.
12.1.1
UART Modes
The UART can be used in four different modes. In mode 0, it operates as an 8-bit shift
register. In mode 1, it operates as an 8-bit serial port. In modes 2 and 3, it operates as a
9-bit serial port. The only difference between mode 2 and mode 3 is the baud rate, which
is fixed in mode 2 but variable in mode 3. The variable baud rate is set by either the
underflow rate on the dedicated baud-rate generator, or by the overflow rate on Timer 1.
The different modes are selected by setting bits SM0 and SM1 to their corresponding
values, as shown in
.
12.1.1.1
Mode 0, 8-Bit Shift Register, Fixed Baud Rate
In mode 0, the serial port behaves as an 8-bit shift register. Data is shifted in through
RXD, and out through RXDO, while the TXD line is used to provide a shift clock which
can be used by external devices to clock data in and out.
The transmission cycle is activated by a write to SBUF. One machine cycle later, the data
has been written to the transmit shift register with a 1 at the 9th bit position. For the next
seven machine cycles, the contents of the transmit shift register are shifted right one
position and a zero shifted in from the left so that when the MSB of the data byte is at the
output position, it has a 1 and a sequence of zeros to its left. The control block then
executes one last shift before setting the TI bit.
Table 12-1
UART Modes
SM0
SM1
Operating Mode
Baud Rate
0
0
Mode 0: 8-bit shift register
f
PCLK
/2
0
1
Mode 1: 8-bit shift UART
Variable
1
0
Mode 2: 9-bit shift UART
f
PCLK
/64 or
f
PCLK
/32
1)
1)
For UART1 module, the baud rate is fixed at
f
PCLK
/64.
1
1
Mode 3: 9-bit shift UART
Variable
*
Содержание XC886CLM
Страница 1: ...User s Manual V1 3 2010 02 Microcontrollers 8 Bit XC886 888CLM 8 Bit Single Chip Microcontroller...
Страница 3: ...User s Manual V1 3 2010 02 Microcontrollers 8 Bit XC886 888CLM 8 Bit Single Chip Microcontroller...
Страница 324: ...XC886 888CLM Serial Interfaces User s Manual 12 52 V1 3 2010 02 Serial Interfaces V 1 0...
Страница 663: ...w w w i n f i n e o n c o m Published by Infineon Technologies AG...