English
Language : 

PIC16F627A Datasheet, PDF (79/168 Pages) Microchip Technology – FLASH-Based 8-Bit CMOS Microcontrollers
PIC16F627A/628A/648A
FIGURE 12-5:
USART TRANSMIT BLOCK DIAGRAM
TXIE
TXIF
Interrupt
MSb
(8)
Data Bus
TXREG register
8
LSb
²²²
0
TSR register
Pin Buffer
and Control
RB2/TX/CK pin
TXEN Baud Rate CLK
SPBRG
Baud Rate Generator
TX9
TX9D
TRMT
SPEN
Follow these steps when setting up an Asynchronous
Transmission:
1. TRISB<1> bit needs to be set and TRISB<2> bit
cleared in order to configure pins RB2/TX/CK
and RB1/RX/DT as the Universal Synchronous
Asynchronous Receiver Transmitter pins.
2. Initialize the SPBRG register for the appropriate
baud rate. If a high-speed baud rate is desired,
set bit BRGH. (Section 12.1)
3. Enable the asynchronous serial port by clearing
bit SYNC and setting bit SPEN.
4. If interrupts are desired, then set enable bit
TXIE.
5. If 9-bit transmission is desired, then set transmit
bit TX9.
6. Enable the transmission by setting bit TXEN,
which will also set bit TXIF.
7. If 9-bit transmission is selected, the ninth bit
should be loaded in bit TX9D.
8. Load data to the TXREG register (starts trans-
mission).
FIGURE 12-6:
Write to TXREG
BRG output
(shift clock)
RB2/TX/CK (pin)
TXIF bit
(Transmit buffer
reg. empty flag)
ASYNCHRONOUS TRANSMISSION
Word 1
START Bit
Bit 0
Bit 1
WORD 1
Bit 7/8 STOP Bit
TRMT bit
(Transmit shift
reg. empty flag)
WORD 1
Transmit Shift Reg
 2002 Microchip Technology Inc.
Preliminary
DS40044A-page 77