Microchip Technology DM164134 Data Sheet

Page of 402
© 2006 Microchip Technology Inc.
DS41159E-page 183
PIC18FXX8
18.0
ADDRESSABLE UNIVERSAL 
SYNCHRONOUS 
ASYNCHRONOUS RECEIVER 
TRANSMITTER (USART) 
The Universal Synchronous Asynchronous Receiver
Transmitter (USART) module is one of the three serial
I/O modules incorporated into PIC18FXX8 devices.
(USART is also known as a Serial Communications
Interface or SCI.) The USART can be configured as a
full-duplex asynchronous system that can communi-
cate with peripheral devices, such as CRT terminals
and personal computers, or it can be configured as a
half-duplex synchronous system that can communicate
with peripheral devices, such as A/D or D/A integrated
circuits, serial EEPROMs, etc.
The USART can be configured in the following modes:
• Asynchronous (full-duplex)
• Synchronous – Master (half-duplex)
• Synchronous – Slave (half-duplex).
The SPEN (RCSTA register) and the TRISC<7> bits
have to be set and the TRISC<6> bit must be cleared
in order to configure pins RC6/TX/CK and RC7/RX/DT
as the Universal Synchronous Asynchronous Receiver
Transmitter.
Register 18-1 shows the Transmit Status and Control
register (TXSTA) and Register 18-2 shows the Receive
Status and Control register (RCSTA).
REGISTER 18-1:
TXSTA: TRANSMIT STATUS AND CONTROL REGISTER            
R/W-0
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R-1
R/W-0
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
bit 7
bit 0
bit 7
CSRC: Clock Source Select bit
Asynchronous mode: 
Don’t care.
Synchronous mode:
1
 = Master mode (clock generated internally from BRG) 
0
 = Slave mode (clock from external source) 
bit 6
TX9: 9-bit Transmit Enable bit   
1
 = Selects 9-bit transmission
0
 = Selects 8-bit transmission 
bit 5
TXEN: Transmit Enable bit 
1
 = Transmit enabled 
0
 = Transmit disabled 
Note:
SREN/CREN overrides TXEN in Sync mode.
bit 4
SYNC: USART Mode Select bit
1
 = Synchronous mode 
0
 = Asynchronous mode 
bit 3
Unimplemented: Read as ‘0’
bit 2
BRGH: High Baud Rate Select bit
Asynchronous mode:
1
 = High speed    
0
 = Low speed 
Synchronous mode:
Unused in this mode. 
bit 1
TRMT: Transmit Shift Register Status bit
1
 = TSR empty 
0
 = TSR full 
bit 0
TX9D: 9th bit of Transmit Data
Can be address/data bit or a parity bit.
Legend:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read as ‘0’
-n = Value at POR
‘1’ = Bit is set
‘0’ = Bit is cleared
x = Bit is unknown