English
Language : 

PIC18F14K22LIN Datasheet, PDF (31/62 Pages) Microchip Technology – 20-Pin Flash Microcontrollers 20-Pin Flash Microcontrollers
PIC18F14K22LIN
6.0 ENHANCED UNIVERSAL
SYNCHRONOUS
ASYNCHRONOUS RECEIVER
TRANSMITTER (EUSART)
The Enhanced Universal Synchronous Asynchronous
Receiver Transmitter (EUSART) module is a serial I/O
communications peripheral. It is the same as contained
in the standard PIC18F1XK22 (See
“PIC18F1XK22/LF1XK22 Data Sheet” (DS41365) with
the following exceptions:
• The 9-bit character length and address detection
should never be selected
• Synchronous Master or Slave modes are not sup-
ported.
• Programmable clock and data polarity should not
be used.
6.1 EUSART Asynchronous LIN
Transmitter
6.1.1
ASYNCHRONOUS LIN
TRANSMISSION SETUP:
1. Initialize the SPBRGH:SPBRG register pair and
the BRGH and BRG16 bits to achieve the desired
baud rate (see Register 6-3).
2. Enable the asynchronous serial port by clearing
the SYNC bit and setting the SPEN bit.
3. Enable the transmission by setting the TXEN
control bit. This will cause the TXIF interrupt bit
to be set.
4. If interrupts are desired, set the TXIE interrupt
enable bit. An interrupt will occur immediately
provided that the GIE and PEIE bits of the
INTCON register are also set.
5. Load 8-bit data into the TXREG register. This
will start the transmission.
TABLE 6-1: REGISTERS ASSOCIATED WITH ASYNCHRONOUS TRANSMISSION
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on page
BAUDCON ABDOVF RCIDL
0
0
BRG16
—
WUE ABDEN 39
INTCON
GIE/GIEH PEIE/GIEL TMR0IE INT0IE RABIE TMR0IF INT0IF RABIF —(1)
IPR1
—
ADIP
RCIP
TXIP
1
CCP1IP TMR2IP TMR1IP —(1)
PIE1
—
ADIE
RCIE
TXIE
0
CCP1IE TMR2IE TMR1IE —(1)
PIR1
—
ADIF
RCIF
TXIF
0
CCP1IF TMR2IF TMR1IF —(1)
RCSTA
SPEN
0
0
CREN
0
FERR OERR
0
38
SPBRG
EUSART Baud Rate Generator Register, Low Byte
—(1)
SPBRGH EUSART Baud Rate Generator Register, High Byte
—(1)
TXREG
EUSART Transmit Register
—(1)
TXSTA
0
0
TXEN
0
SENDB BRGH TRMT
0
37
Legend: — = unimplemented locations read as ‘0’. Shaded cells are not used for asynchronous transmission.
0 = must always be written as ‘0’ to avoid undefined LIN operation.
Note 1: Information about these registers can be found in the “PIC18(L)F1XK22 Data Sheet” (DS41365).
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 35