PIC16F62X
Steps to follow when setting up a Synchronous Master
Transmission:
4. If 9-bit transmission is desired, then set bit TX9.
5. Enable the transmission by setting bit TXEN.
1. Initialize the SPBRG register for the appropriate
baud rate (Section 12.1).
6. If 9-bit transmission is selected, the ninth bit
should be loaded in bit TX9D.
2. Enable the synchronous master serial port by
setting bits SYNC, SPEN, and CSRC.
7. Start transmission by loading data to the
TXREG register.
3. If interrupts are desired, then set enable bit
TXIE.
TABLE 12-2:
REGISTERS ASSOCIATED WITH SYNCHRONOUS MASTER TRANSMISSION
Value on
POR
Value on all
Address Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
other Resets
0000 -000
0000 -00x
0000 0000
0000 -000
0000 -010
0000 0000
0000 -000
0000 -00x
0000 0000
0000 -000
0000 -010
0000 0000
0Ch
18h
19h
8Ch
98h
99h
PIR1
EEIF
CMIF RCIF
RX9
TXIF
—
CCP1IF TMR2IF TMR1IF
FERR OERR RX9D
RCSTA
SPEN
SREN CREN ADEN
TXREG USART Transmit Register
PIE1
EEIE
CMIE RCIE
TXIE
—
—
CCP1IE TMR2IE TMR1IE
BRGH TRMT TX9D
TXSTA
CSRC
TX9 TXEN SYNC
SPBRG Baud Rate Generator Register
Legend: x= unknown, -= unimplemented, read as '0'. Shaded cells are not used for Synchronous Master Transmission.
FIGURE 12-12: SYNCHRONOUS TRANSMISSION
Q1Q2 Q3Q4 Q1 Q2Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4Q1 Q2 Q3Q4
Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4
RB1/RX/DT pin
RB2/TX/CK pin
Bit 0
Bit 1
Bit 2
Bit 7
Bit 0
Bit 1
WORD 2
Bit 7
WORD 1
Write to
TXREG reg
Write word1
Write word2
TXIF bit
(Interrupt flag)
TRMT
TRMT bit
’1’
Note: Sync master mode; SPBRG = ’0’. Continuous transmission of two 8-bit words
’1’
TXEN bit
FIGURE 12-13: SYNCHRONOUS TRANSMISSION (THROUGH TXEN)
RB1/RX/DT pin
RB2/TX/CK pin
bit0
bit2
bit1
bit6
bit7
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
1999 Microchip Technology Inc.
Preliminary
DS40300B-page 85