Professional Documents
Culture Documents
Embedded Systems — Hadassah College — Spring 2012 PIC Microcontroller Dr. Martin Land 2
USART
Parity bit
Transmit Speed
Embedded Systems — Hadassah College — Spring 2012 PIC Microcontroller Dr. Martin Land 5
USART Receive Operation
Data
RX pin bit FIFO RSR RCREG byte
Framing
Identify data between stop bits
Check for parity error Overrun Error Framing Error
Continuous Receive Enable
Sample + FIFO
Parity bit
Port Enable
RCREG full
Embedded Systems — Hadassah College — Spring 2012 PIC Microcontroller Dr. Martin Land 6
USART
TXSTA,
RCSTA and
SPBRG.
We will only look at four bits from TXSTA and 1 bit on RCSTA.
The formula used to compute for the baud rate is different in high
speed or low speed mode shown below:
X is the contents of the register SPBRG
USART - EXAMPLE
TRMT (bit 1) is a flag that sets if the data has been sent.
SPEN (bit 7) of the RCSTA register enables RC6 and RC7 as serial port
pins. This is the bit you need to set to enable serial communication.