11:56:01<br />
<br />
Chapter 9<br />
Serial communication interface<br />
<br />
11:56:01<br />
<br />
9.1 USCI Overview<br />
The universal serial communication interface (USCI) modules<br />
support multiple serial communication modes. Different USCI<br />
modules support different modes.<br />
The USCI_Ax modules support:<br />
•<br />
•<br />
•<br />
•<br />
<br />
UART mode.<br />
Pulse shaping for Infrared Data Association (IrDA)<br />
communications.<br />
Automatic baud rate detection for Local Interconnect Network<br />
(LIN) communications.<br />
Serial Peripheral Interface (SPI) mode.<br />
<br />
The USCI_Bx modules support:<br />
•<br />
•<br />
<br />
Inter-Integrated Circuit (I2C or I2 C) mode.<br />
SPI mode.<br />
Microcomputer principles and applications<br />
<br />
11:56:01<br />
<br />
9.2 UART Mode<br />
UART = Universal asynchronous receiver/transmitter.<br />
UART mode (UCSYNC bit=0) features include:<br />
•<br />
•<br />
•<br />
•<br />
•<br />
•<br />
•<br />
•<br />
•<br />
•<br />
<br />
7- or 8-bit data with odd, even, or non-parity.<br />
Independent transmit and receive shift registers.<br />
Separate transmit and receive buffer registers.<br />
LSB-first or MSB-first data transmit and receive.<br />
Built-in idle-line and address-bit communication protocols for<br />
multiprocessor systems.<br />
Receiver start-edge detection for auto-wake up from LPMx<br />
modes.<br />
Programmable baud rate with modulation for fractional baud<br />
rate support.<br />
Status flags for error detection and suppression.<br />
Status flags for address detection.<br />
Independent interrupt capability for receive and transmit.<br />
Microcomputer principles and applications<br />
<br />
11:56:01<br />
<br />
9.3 UART Mode<br />
•<br />
<br />
•<br />
•<br />
<br />
•<br />
<br />
Start - Part of the serial interface’s job is to frame the bits of<br />
each data, using a start bit to indicate the start of the data. The<br />
start bit then serves to synchronize the sender and the receiver.<br />
Stop - Part of the serial interface’s job is to frame the bits of<br />
each data, using a stop bit for the end of the data.<br />
Baud rate - The start bit marks the beginning of the sender’s<br />
data. From the start bit the receiver can count clock ticks to<br />
determine when to read each data bit. The baud rate defines the<br />
time each bit exists or the time to wait between reading (or<br />
sending) each bit.<br />
A parity bit (or check bit) - a bit added to the end of a string of<br />
binary code that indicates whether the number of bits in the<br />
string with the value one is even or odd. Parity bits are used as<br />
the simplest form of error detecting code.<br />
<br />
Microcomputer principles and applications<br />
<br />
11:56:01<br />
<br />
9.3 UART Mode<br />
A start bit (0), 8 bits of data (least significant bit first), and a stop bit<br />
(1). This protocol is used for both transmitting and receiving.<br />
One frame<br />
5V<br />
<br />
b<br />
<br />
b3<br />
<br />
b<br />
<br />
b5<br />
<br />
b<br />
§<br />
<br />
b1<br />
<br />
¦<br />
<br />
b<br />
<br />
¥<br />
<br />
Start<br />
<br />
¤<br />
<br />
Serial port<br />
<br />
b7<br />
<br />
Stop<br />
0V<br />
<br />
Microcomputer principles and applications<br />
<br />