MICROCHIP PIC18F14K22LIN

PIC18F14K22LIN
Data Sheet
20-Pin Flash Microcontrollers
with Integrated LIN Transceiver and
Voltage Regulator
 2011 Microchip Technology Inc.
Preliminary
DS41580A
Note the following details of the code protection feature on Microchip devices:
•
Microchip products meet the specification contained in their particular Microchip Data Sheet.
•
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
•
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our
knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip’s Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
•
Microchip is willing to work with the customer who is concerned about the integrity of their code.
•
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as “unbreakable.”
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION,
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR
FITNESS FOR PURPOSE. Microchip disclaims all liability
arising from this information and its use. Use of Microchip
devices in life support and/or safety applications is entirely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless Microchip from any and all damages, claims,
suits, or expenses resulting from such use. No licenses are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
KEELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART,
PIC32 logo, rfPIC and UNI/O are registered trademarks of
Microchip Technology Incorporated in the U.S.A. and other
countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL and The Embedded Control
Solutions Company are registered trademarks of Microchip
Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard,
dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN,
ECONOMONITOR, FanSense, HI-TIDE, In-Circuit Serial
Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified
logo, MPLIB, MPLINK, mTouch, Omniscient Code
Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit,
PICtail, REAL ICE, rfLAB, Select Mode, Total Endurance,
TSHARC, UniWinDriver, WiperLock and ZENA are
trademarks of Microchip Technology Incorporated in the
U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated
in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
© 2011, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
ISBN: 978-1-61341-171-1
Microchip received ISO/TS-16949:2002 certification for its worldwide
headquarters, design and wafer fabrication facilities in Chandler and
Tempe, Arizona; Gresham, Oregon and design centers in California
and India. The Company’s quality system processes and procedures
are for its PIC® MCUs and dsPIC® DSCs, KEELOQ® code hopping
devices, Serial EEPROMs, microperipherals, nonvolatile memory and
analog products. In addition, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
DS41580A-page 2
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
20-Pin Flash Microcontrollers with Integrated LIN Transceiver
and Voltage Regulator
Cross-referenced Material:
Special Microcontroller Features:
This data sheet refers heavily to the following Microchip
data sheets:
• Full 5.5V Operation
• Self-Reprogrammable under Software Control
• Power-on Reset (POR), Power-up Timer (PWRT)
and Oscillator Start-up Timer (OST)
• Programmable Brown-out Reset (BOR)
• Extended Watchdog Timer (WDT) with On-Chip
Oscillator and Software Enable
• Programmable Code Protection
• In-Circuit Serial Programming™ (ICSP™) via
Two Pins
• In-Circuit Debug via Two Pins
• PIC18F1XK22/LF1XK22 Data Sheet (DS41365)
• MCP2021/2, LIN Tranceiver with Voltage Regulator Data Sheet (DS22018)
Please have these documents available when reading
this device specification. Only deviations from the data
sheets listed above will be noted.
Devices Included In This Data Sheet:
• PIC18F14K22LIN
Power Managed Modes:
High-Performance RISC CPU:
• RUN – CPU on, Peripherals on
• IDLE – CPU off, Peripherals on
• Sleep – CPU off, Peripherals off
•
•
•
•
•
•
•
•
•
C Compiler Optimized Architecture/Instruction Set
256 Bytes Data EEPROM
Linear Program Memory Addressing to 16 Kbytes
Linear Data Memory Addressing to 512 Bytes
Up to 16 MIPS Operation
16-bit Wide Instructions, 8-bit Wide Data Path
Priority Levels for Interrupts
31-Level, Software Accessible Hardware Stack
8 x 8 Single-Cycle Hardware Multiplier
Flexible Oscillator Structure:
• Precision 16 MHz Internal Oscillator Block:
- Factory calibrated to ±1%
- Software selectable frequencies range of
31 kHz to 16 MHz
- 64 MHz performance available using PLL –
no external components required
• Four Crystal modes up to 64 MHz
• Two External Clock modes up to 64 MHz
• 4X Phase-Lock Loop (PLL)
• Secondary Oscillator using Timer1 @ 32 kHz
• Fail-Safe Clock Monitor:
- Allows for safe shutdown if peripheral clock
stops
• Two-Speed Oscillator Start-up
 2011 Microchip Technology Inc.
Analog Features:
• Analog-to-Digital (A/D) Converter module:
- 10-bit resolution
- 9 analog input channels
- Auto acquisition capability
- Conversion available during Sleep
• Analog Comparator module with:
- Two rail-to-rail analog comparators
- Comparator inputs and outputs externally
accessible and configurable
• Voltage Reference module with:
- Programmable on-chip voltage reference
(CVREF) module (% of VDD)
- Fixed Voltage Reference (FVR) with multiple
reference voltages
Peripheral Features:
• 12 I/O pins and 1 Input Only Pin:
- High current sink/source 25 mA/25 mA
- Individually programmable weak pull-ups
- Individually programmable interrupt-on-pin
change
• Three External Interrupt Pins
• Four Timer modules:
- 3 16-bit timers/counters with prescaler
- 1 8-bit timer/counter with 8-bit period register,
prescaler and postscaler
- Dedicated, low-power Timer1 oscillator
Preliminary
DS41580A-page 3
PIC18F14K22LIN
• Enhanced Capture/Compare/PWM (ECCP)
module with:
- One, two or four PWM outputs
- Selectable polarity
- Programmable dead time
- Auto-shutdown and Auto-restart
- PWM output steering control
• Enhanced Universal Synchronous Asynchronous
Receiver Transmitter module (EUSART):
- Supports RS-232, RS-485 and LIN 2.0
- Auto-Baud Detect
- Auto Wake-up on Start bit
• SR Latch (555 Timer) module with:
- Configurable inputs and outputs
- Supports mTouch™ capacitive sensing
applications
• On-board Voltage Regulator:
- Output voltage of 5.0V with tolerances of
±3% over temperature range
- Maximum continuous input voltage of 30V
- Internal thermal overload protection
- Internal short circuit current limit
- External components limited to filter
capacitor only and load capacitor
- Automatic thermal shutdown
• Internal Bus Transceiver Compliant with LIN Bus
Specifications 1.3, 2.0 and 2.1 and are Compliant
to SAE J2602:
- Support Baud Rates up to 20 Kbaud
- 43V load dump protected
- Very low EMI meets stringent OEM requirements
- Wide supply voltage, 6.0V-18.0V continuous:
- Internal pull-up resistor and diode
- Protected against ground shorts
- Protected against loss of ground
- High current drive
- Automatic thermal shutdown
• Extended Temperature Range: -40 to +125°C
DS41580A-page 4
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
Note 1:
16K
8K
13
9-ch
2
1/3
1
1
Data Memory
Pins
Data
SRAM
EEPROM
(bytes)
(bytes)
512
256
20
SR Latch
Words
EUSART(1)
PIC18F14K22LIN
Bytes
I/O
ECCP
Device
Timers
8-bit/16-bit
Program
Memory
Comparators
DEVICE OVERVIEW
10-bit A/D
Channels
TABLE 1:
Other Features
Yes LIN Transceiver, Voltage
Regulator
EUSART dedicated to LIN communications.
Pin Diagrams
VDD
RA5/OSC1/CLKIN/T13CKI
RA4/AN3/OSC2/CLKOUT
RA3/MCLR/VPP
RC5/CCP1/P1A
RC4/C2OUT/P1B/SRQ
RC3/AN7/C12IN3-/P1C/PGM
Vss
LBUS
VREG
 2011 Microchip Technology Inc.
1
2
3
4
5
6
7
8
9
10
PIC18F14K22LIN
20-PIN SSOP
Preliminary
20
19
18
17
16
15
14
13
12
11
VSS
RA0/AN0/CVREF/VREF-/C1IN+/INT0/PGD
RA1/AN1/C12IN0-/VREF+/INT1/PGC
RA2/AN2/C1OUT/T0CKI/INT2/SRQ
RC0/AN4/C2IN+
RC1/AN5/C12IN1RC2/AN6/C12IN2-/P1D
RB4/AN10
FAULT/TXE
VBAT
DS41580A-page 5
PIC18F14K22LIN
FIGURE 1:
PIC18F14K22LIN BLOCK DIAGRAM
Data Bus<8>
Table Pointer<21>
Data Latch
8
8
inc/dec logic
PCLATU PCLATH
21
PORTA
RA0
RA1
RA1
RA3
RA4
RA5
Data Memory
(512/768 bytes)
Address Latch
20
PCU PCH PCL
Program Counter
12
Data Address<12>
31-Level Stack
4
BSR
Address Latch
STKPTR
Program Memory
12
FSR0
FSR1
FSR2
Data Latch
4
Access
Bank
12
PORTB
8
inc/dec
logic
Table Latch
RB4
Address
Decode
ROM Latch
Instruction Bus <16>
RB6
IR
ENABLE
8
Instruction
Decode and
Control
VBAT
Voltage
Regulator
RESET
State machine
control signals
RC7
RC0
RC1
RC2
RC3
RC4
RC5
RC6
NC
8 x 8 Multiply
3
OSC1(2)
LFINTOSC
Oscillator
(2)
OSC2
16 MHz
Oscillator
MCLR(1)
Single-Supply
Programming
VDD, VSS
LDO
Regulator
VSS
PRODH PRODL
PORTC
Internal
Oscillator
Block
VREG
8
W
BITOP
8
Power-up
Timer
8
8
8
8
Oscillator
Start-up Timer
ALU<8>
Power-on
Reset
8
Watchdog
Timer
Fail-Safe
Clock Monitor
Precision
Band Gap
Reference
FVR
LBUS
FAULT/
TXE
Transceiver
BOR
Data
EEPROM
Timer0
Timer1
Timer2
Timer3
RB5
RB7
TX
RX
EUSART
FVR
CVREF Comparator
Note
FVR
ADC
10-bit
ECCP1
CVREF
1:
RA3 is only available when MCLR functionality is disabled.
2:
OSC1/CLKIN and OSC2/CLKOUT are only available in select Oscillator modes and when these pins are not being used
as digital I/O. Refer to DS41365, “PIC18(L)F1XK22 Data Sheet”, Section 2.0 “Oscillator Module” for additional information.
DS41580A-page 6
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
I/O
Analog
Comparator
Reference
ECCP
EUSART
SR Latch
Timers
Interrupts
Pull-up
Basic
PIC18F14K22LIN PIN SUMMARY
20-PiN SSOP
TABLE 2:
19
RA0
AN0
C1IN+
VREF-/CVREF
—
—
—
—
IOC/INT0
Y
PGD
18
RA1
AN1
C12IN0-
VREF+
—
—
—
—
IOC/INT1
Y
PGC
17
RA2
AN2
C1OUT
—
—
—
SRQ
T0CKI
IOC/INT2
Y
—
4
RA3
—
—
—
—
—
—
—
IOC
Y
MCLR/VPP
3
RA4
AN3
—
—
—
—
—
—
IOC
Y
OSC2/CLKOUT
2
RA5
—
—
—
—
—
—
T13CKI
IOC
Y
OSC1/CLKIN
13
RB4
AN10
—
—
—
—
—
—
IOC
Y
—
Note
RB5
—
—
—
—
RXD
—
—
—
—
—
Note
RB6
—
—
—
—
—
—
—
—
—
CS/LWAKE
Note
RB7
—
—
—
—
TXD
—
—
—
—
—
16
RC0
AN4
C2IN+
—
—
—
—
—
—
—
—
15
RC1
AN5
C12IN1-
—
—
—
—
—
—
—
—
14
RC2
AN6
C12IN2-
—
P1D
—
—
—
—
—
—
AN7
C12IN3-
—
P1C
—
—
—
—
—
PGM
C2OUT
—
P1B
—
SRQ
—
—
—
—
—
7
RC3
6
RC4
5
RC5
—
—
—
CCP1/P1A
—
—
—
—
—
Note
RC6
—
—
—
—
—
—
—
—
—
no connection
Note
RC7
—
—
—
—
—
—
—
—
—
RESET input from
Voltage Regulator
12
FAULT/
TXE
—
—
—
—
—
—
—
—
—
11
VBAT
—
—
—
—
—
—
—
—
—
10
VREG
—
—
—
—
—
—
—
—
—
9
LBUS
—
—
—
—
—
—
—
—
—
8
—
—
—
—
—
—
—
—
—
—
VSS
1
—
—
—
—
—
—
—
—
—
—
VDD
—
—
—
—
—
—
—
—
—
—
VSS
20
Note
1:
Internal connection. No associated external pin.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 7
PIC18F14K22LIN
Table of Contents
1.0 Using the MCP200X in LIN Bus Applications ............................................................................................................................... 9
2.0 Memory Organization ................................................................................................................................................................. 17
3.0 I/O Ports ..................................................................................................................................................................................... 23
4.0 Master Synchronous Serial Port (MSSP) Module ...................................................................................................................... 31
5.0 Analog-to-Digital Converter (ADC) Module ................................................................................................................................ 33
6.0 Enhanced Universal Synchronous Asynchronous Receiver Transmitter (EUSART) ................................................................. 35
7.0 LIN/J2602 Transceiver and Voltage Regulator .......................................................................................................................... 41
8.0 Electrical Specifications.............................................................................................................................................................. 43
9.0 DC and AC Characteristics Graphs and Tables ......................................................................................................................... 49
10.0 Development Support................................................................................................................................................................. 51
11.0 Packaging Information................................................................................................................................................................ 55
Appendix A: Revision History............................................................................................................................................................... 59
TO OUR VALUED CUSTOMERS
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined and
enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via
E-mail at [email protected] or fax the Reader Response Form in the back of this data sheet to (480) 792-4150. We
welcome your feedback.
Most Current Data Sheet
To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at:
http://www.microchip.com
You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page.
The last character of the literature number is the version number, (e.g., DS30000A is version A of document DS30000).
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
• Microchip’s Worldwide Web site; http://www.microchip.com
• Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
Customer Notification System
Register on our web site at www.microchip.com to receive the most current information on all of our products.
DS41580A-page 8
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
1.0
USING THE MCP200X IN LIN
BUS APPLICATIONS
Note:
1.1
The MCP200X internal connections are optimized to
reduce the number of components in a typical LIN/
J2602 node in a LIN bus system. Some features and
modules of the stand-alone PIC18F14K22 are no
longer available or their functionality has changed.
Failure to follow the recommended setup
and initialization may result in improper or
unknown LIN operation.
FIGURE 1-1:
Hardware
TYPICAL LIN NETWORK CONFIGURATION
40m
+ Return
LIN bus
1 k
VBB
LIN bus
MCP202X
LIN bus
MCP202X
LIN bus
PIC18F1XK22LIN
LIN bus
MCP202X
Slave 2
µC
Slave n <16
µC
Slave 1
µC
Master
µC
For this reason, the following (Example 1-1) is a
recommended block diagram. Note the microcontroller
is powered by the internal voltage regulator and an
external connection must be made between VREG and
VBB along with a load capacitor. FAULT/TXE can be
monitored or controlled by any I/O pin.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 9
PIC18F14K22LIN
EXAMPLE 1-1:
TYPICAL PIC18F14K22LIN APPLICATION
+12
RTP(3)
43V(3)
CF (1)
VBB
CG
VREG
Master Node Only
+12
VDD
FAULT/TXE
I/O
1 k
LIN Bus
LBUS
27V (2)
VSS
VSS
Note 1: CF is the filter capacitor for the external voltage supply.
2: Transient suppressor diode. VCLAMP L = 27V.
3: These components are required for additional load dump protection above 43V.
1.2
Software
Please refer to the sections of this data sheet to determine what facilities have changed and what register
values need to be properly initialized. Failure to follow
these guidelines may result in improper operation.
1.2.1
TYPICAL INITIALIZATION CODE
InitialiseIOports
MOVLB
0xF
MOVLW
0x04
ANDWF
ANSELH,f
MOVLW
0xC0
IORWF
TRISB,f
MOVLW
0xCF
ANDWF
TRISB,f
BSF
LINCS
MOVLW
0x80
IORWF
TRISC,f
RETURN
SetupLINUSART
MOVLB
MOVLW
MOVWF
MOVLW
MOVWF
DS41580A-page 10
0x0F
B'10010000'
RCSTA
B'00000100'
TXSTA
;point the F bank
;disable AN8:9,11
;PORTB7:6 must be inputs
;PORTB5:4 must be outputs
;Chip Select Transceiver
;PORTC7 is an input
;Register Bank 0xF
;UART enabled,8-bit,continuous receive
;8-bit, asynchronous, high-baudrate
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
MOVLW
MOVWF
CLRF
MOVLW
MOVWF
BSF
RETURN
1.3
B'00001000'
BAUDCON
SPBRGH
0x31
SPBRG
LINCS
;16-bit Baud Rate Generator
;setup initially for 20KBaud @ 4.0MHz, BRGH=1, BRG16=1
;to enable transceiver
Sample Transmit Software
This routine is called when PIR1<TXIF> = 1:
PutDATAbyte
MOVF
MOVWF
INCF
DECFSZ
RETURN
1.4
INDF0,w
TXREG
FSR0, f
MESSAGE_COUNTER, f
; copy data byte into w-register
; point to next location
; decrement Message Counter by one
Sample Receive Software
The following routines are called when PIR1<RCIF> = 1:
GetBREAK
BTFSS
GOTO
MOVF
BTFSS
GOTO
DECF
BTFSS
GOTO
BSF
RETURN
BadBREAKchar
MOVF
RETURN
RCSTA,FERR
;
BadBREAKchar
;
RCREG,w
;
STATUS,Z
BadBREAKchar
;
MESSAGE_COUNTER
LINRX
$-2
BAUDCTL,ABDEN ;
RCREG,w
was BREAK character longer than 8 bits?
no, not a valid BREAK, too short
dump break character, reset RCIF and FERR
no, not a valid BREAK, not zero
enable AutoBaud
; dump break character, reset RCIF and FERR
GetSYNC
BTFSC
GOTO
BTFSC
GOTO
DECF
MOVF
DECF
RETURN
BadSYNCchar
BCF
MOVLW
MOVWF
RETURN
GetDATAbyte
MOVF
MOVWF
MOVWF
INCF
DECF
RETURN
BAUDCTL,ABDOVF; did baud rate generator overflow?
BadSYNCchar; yes, bad sync character
RCSTA,FERR; was there a Framing Error?
BadSYNCchar; yes, bad sync character
SPBRG
RCREG,w
; dump sync character, reset RCIF
MESSAGE_COUNTER
BAUDCTL,ABDOVF; clear the overflow condition
.12
; reset the state machine
MESSAGE_COUNTER
RCREG,w
;
RXTX_REG
;
INDF0
;
FSR0, f
;
MESSAGE_COUNTER,
 2011 Microchip Technology Inc.
get character, reset RCIF and FERR
copy data into w-register
copy data into data area
point to next location
f ; decrement number of bytes to receive by one
Preliminary
DS41580A-page 11
PIC18F14K22LIN
NOTES:
DS41580A-page 12
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
2.0
MEMORY ORGANIZATION
See DS41365, “PIC18F1XK22/LF1XK22 Data Sheet”
for descriptions of program memory, Data RAM and
Data EEPROM.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 17
PIC18F14K22LIN
TABLE 2-1:
Address
FFFh
SPECIAL FUNCTION REGISTER MAP FOR PIC18F14K22LIN DEVICES
Name
Address
TOSU
FD7h
Name
Address
TMR0H
FAFh
Name
Address
SPBRG
Name
Address
Name
F87h
—
(2)
F5Fh
—(2)
F5Eh
—(2)
FFEh
TOSH
FD6h
TMR0L
FAEh
RCREG
F86h
—(2)
FFDh
TOSL
FD5h
T0CON
FADh
TXREG
F85h
—(2)
F5Dh
—(2)
F84h
—
(2)
F5Ch
—(2)
F83h
—(2)
FFCh
FFBh
STKPTR
FD4h
PCLATU
FD3h
—
(2)
OSCCON
(3)
FACh
TXSTA
FABh
RCSTA(3)
F5Bh
—(2)
(3)
F5Ah
—(2)
FFAh
PCLATH
FD2h
OSCCON2
FAAh
EEADRH
F82h
PORTC
FF9h
PCL
FD1h
WDTCON
FA9h
EEADR
F81h
PORTB(3)
F59h
—(2)
FF8h
TBLPTRU
FD0h
RCON
FA8h
EEDATA
F80h
PORTA
F58h
—(2)
F57h
—(2)
FF7h
TBLPTRH
FCFh
TMR1H
FA7h
FF6h
TBLPTRL
FCEh
TMR1L
FA6h
FF5h
TABLAT
FCDh
T1CON
FF4h
FF3h
PRODH
FCCh
TMR2
PR2
(3)
F7Fh
ANSELH
EECON1
F7Eh
ANSEL
F56h
—(2)
FA5h
—(2)
F7Dh
—(2)
F55h
—(2)
FA4h
—
(2)
F7Ch
—
(2)
F54h
—(2)
—
(2)
F7Bh
—
(2)
F53h
—(2)
FA3h
EECON2
(1)
PRODL
FCBh
FF2h
INTCON
FCAh
T2CON
FA2h
IPR2
F7Ah
IOCB
FF1h
INTCON2
FC9h
SSPBUF(3)
FA1h
PIR2
F79h
IOCA
(3)
FF0h
INTCON3
FC8h
SSPADD
FA0h
PIE2
F78h
WPUB
FEFh
INDF0(1)
FC7h
SSPSTAT(3)
F9Fh
IPR1(3)
F77h
WPUA
FEEh
POSTINC0(1)
FC6h SSPCON1(3)
F9Eh
PIR1(3)
F76h
SLRCON
FEDh POSTDEC0(1)
FC5h SSPCON2(3)
F9Dh
PIE1(3)
F75h
—(2)
F74h
—(2)
FECh
PREINC0(1)
FC4h
ADRESH
F9Ch
—(2)
FEBh
(1)
FC3h
ADRESL
F9Bh
OSCTUNE
PLUSW0
F73h
—(2)
(2)
F72h
—(2)
FEAh
FSR0H
FC2h
ADCON0
F9Ah
—
FE9h
FSR0L
FC1h
ADCON1
F99h
—(2)
F71h
—(2)
F98h
—
(2)
F70h
—(2)
F97h
—
(2)
F6Fh
SSPMASK(3)
F6Eh
—(2)
F6Dh
CM1CON0
FE8h
FE7h
WREG
INDF1
FC0h
(1)
FBFh
ADCON2
CCPR1H
POSTINC1(1)
FBEh
CCPR1L
F96h
—(2)
FE5h POSTDEC1(1)
FBDh
CCP1CON
F95h
—(2)
FE6h
FE4h
PREINC1
(1)
F94h
TRISC
(3)
FBCh
VREFCON2
FE3h
PLUSW1(1)
FBBh
VREFCON1
F6Ch
CM2CON1
F93h
TRISB(3)
F6Bh
CM2CON0
FE2h
FSR1H
FBAh
VREFCON0
F92h
TRISA
F6Ah
—(2)
FE1h
FSR1L
FB9h
PSTRCON
F91h
—(2)
F69h
SRCON1
F90h
—(2)
F68h
SRCON0
F8Fh
—(2)
F67h
—(2)
(2)
F66h
—(2)
FE0h
BSR
FB8h
BAUDCON(3)
FDFh
INDF2(1)
FB7h
PWM1CON
(1)
FB6h
ECCP1AS
F8Eh
—
FDDh POSTDEC2(1)
FB5h
—(2)
F8Dh
—(2)
F65h
—(2)
FB4h
(2)
F8Ch
(2)
FDEh
FDCh
FDBh
POSTINC2
PREINC2
PLUSW2
(1)
(1)
FB3h
—
TMR3H
F64h
—(2)
F8Bh
LATC
(3)
F63h
—(2)
F62h
—(2)
—
FDAh
FSR2H
FB2h
TMR3L
F8Ah
LATB(3)
FD9h
FSR2L
FB1h
T3CON
F89h
LATA
F61h
—(2)
F88h
—(2)
F60h
—(2)
FD8h
Legend:
Note 1:
STATUS
FB0h
SPBRGH
= Unimplemented data memory locations, read as ‘0’,
This is not a physical register.
2:
Unimplemented registers are read as ‘0’.
3:
Registers in BOLD have functional differences. Please refer to appropriate chapters for details.
DS41580A-page 18
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
TABLE 2-2:
File Name
TOSU
REGISTER FILE SUMMARY (PIC18F14K22LIN)
Bit 7
Bit 6
Bit 5
—
—
—
TOSH
Top-of-Stack, High Byte (TOS<15:8>)
TOSL
Top-of-Stack, Low Byte (TOS<7:0>)
STKPTR
STKOVF
STKUNF
—
PCLATU
—
—
—
PCLATH
Holding Register for PC<15:8>
PCL
PC, Low Byte (PC<7:0>)
TBLPTRU
—
—
Bit 4
Bit 3
Bit 2
Bit 1
Value on POR,
BOR
Bit 0
Top-of-Stack Upper Byte (TOS<20:16>)
---0 0000
0000 0000
0000 0000
SP4
SP3
SP2
SP1
SP0
00-0 0000
Holding Register for PC<20:16>
---0 0000
0000 0000
0000 0000
—
Program Memory Table Pointer Upper Byte (TBLPTR<20:16>)
---0 0000
TBLPTRH
Program Memory Table Pointer, High Byte (TBLPTR<15:8>)
0000 0000
TBLPTRL
Program Memory Table Pointer, Low Byte (TBLPTR<7:0>)
0000 0000
TABLAT
Program Memory Table Latch
0000 0000
PRODH
Product Register, High Byte
xxxx xxxx
PRODL
Product Register, Low Byte
xxxx xxxx
INTCON
GIE/GIEH
PEIE/GIEL
TMR0IE
INT0IE
RABIE
TMR0IF
INT0IF
RABIF
INTCON2
RABPU
INTEDG0
INTEDG1
INTEDG2
—
TMR0IP
—
RABIP
1111 -1-1
INTCON3
INT2IP
INT1IP
—
INT2IE
INT1IE
—
INT2IF
INT1IF
11-0 0-00
0000 000x
INDF0
Uses contents of FSR0 to address data memory – value of FSR0 not changed (not a physical register)
N/A
POSTINC0
Uses contents of FSR0 to address data memory – value of FSR0 post-incremented (not a physical register)
N/A
POSTDEC0
Uses contents of FSR0 to address data memory – value of FSR0 post-decremented (not a physical register)
N/A
PREINC0
Uses contents of FSR0 to address data memory – value of FSR0 pre-incremented (not a physical register)
N/A
PLUSW0
Uses contents of FSR0 to address data memory – value of FSR0 pre-incremented (not a physical register) – value of
FSR0 offset by W
N/A
FSR0H
—
—
—
—
Indirect Data Memory Address Pointer 0, High Byte
---- 0000
FSR0L
Indirect Data Memory Address Pointer 0, Low Byte
xxxx xxxx
WREG
Working Register
xxxx xxxx
INDF1
Uses contents of FSR1 to address data memory – value of FSR1 not changed (not a physical register)
N/A
POSTINC1
Uses contents of FSR1 to address data memory – value of FSR1 post-incremented (not a physical register)
N/A
POSTDEC1
Uses contents of FSR1 to address data memory – value of FSR1 post-decremented (not a physical register)
N/A
PREINC1
Uses contents of FSR1 to address data memory – value of FSR1 pre-incremented (not a physical register)
N/A
PLUSW1
Uses contents of FSR1 to address data memory – value of FSR1 pre-incremented (not a physical register) – value of
FSR1 offset by W
N/A
FSR1H
—
FSR1L
—
—
—
Indirect Data Memory Address Pointer 1, High Byte
---- 0000
Indirect Data Memory Address Pointer 1, Low Byte
BSR
—
—
—
—
xxxx xxxx
Bank Select Register
---- 0000
INDF2
Uses contents of FSR2 to address data memory – value of FSR2 not changed (not a physical register)
N/A
POSTINC2
Uses contents of FSR2 to address data memory – value of FSR2 post-incremented (not a physical register)
N/A
POSTDEC2
Uses contents of FSR2 to address data memory – value of FSR2 post-decremented (not a physical register)
N/A
PREINC2
Uses contents of FSR2 to address data memory – value of FSR2 pre-incremented (not a physical register)
N/A
PLUSW2
Uses contents of FSR2 to address data memory – value of FSR2 pre-incremented (not a physical register) – value of
FSR2 offset by W
N/A
FSR2H
—
FSR2L
—
—
—
Indirect Data Memory Address Pointer 2, High Byte
---- 0000
Indirect Data Memory Address Pointer 2, Low Byte
STATUS
Legend:
Note 1:
2:
3:
—
—
—
N
xxxx xxxx
OV
Z
DC
C
---x xxxx
x = unknown, u = unchanged, — = unimplemented, q = value depends on condition
The SBOREN bit is only available when the BOREN<1:0> Configuration bits = 01; otherwise it is disabled and reads as ‘0’. Refer to
DS41365, “PIC18(L)F1XK22 Data Sheet”, Section 21.4 “Brown-out Reset (BOR)” for additional information
The RA3 bit is only available when Master Clear Reset is disabled (MCLRE Configuration bit = 0). Otherwise, RA3 reads as ‘0’. This bit
is read-only.
Rows highlighted in black show required values for normal LIN protocol applications.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 19
PIC18F14K22LIN
TABLE 2-2:
File Name
REGISTER FILE SUMMARY (PIC18F14K22LIN) (CONTINUED)
Bit 7
Bit 6
TMR0H
Timer0 Register, High Byte
TMR0L
Timer0 Register, Low Byte
T0CON
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on POR,
BOR
0000 0000
xxxx xxxx
TMR0ON
T08BIT
T0CS
T0SE
PSA
T0PS2
T0PS1
T0PS0
1111 1111
OSCCON
IDLEN
IRCF2
IRCF1
IRCF0
OSTS
HFIOFS
SCS1
SCS0
0011 qq00
OSCCON2
—
—
—
—
—
PRI_SD
HFIOFL
LFIOFS
---- -10x
WDTCON
—
—
—
—
—
—
—
SWDTEN
--- ---0
IPEN
SBOREN(1)
—
RI
TO
PD
POR
BOR
0q-1 11q0
RCON
TMR1H
Timer1 Register, High Byte
xxxx xxxx
TMR1L
Timer1 Register, Low Bytes
xxxx xxxx
T1CON
RD16
T1RUN
TMR2
Timer2 Register
PR2
Timer2 Period Register
T1CKPS1
T1CKPS0
T1OSCEN
T1SYNC
TMR1CS
TMR1ON
0000 0000
0000 0000
1111 1111
T2CON
—
T2OUTPS3
T2OUTPS2
T2OUTPS1
T2OUTPS0
TMR2ON
T2CKPS1
T2CKPS0
-000 0000
SSPBUF(3)
x
x
x
x
x
x
x
x
xxxx xxxx
SSPADD(3)
0
0
0
0
0
0
0
0
0000 0000
SSPSTAT(3)
0
0
0
0
0
0
0
0
0000 0000
(3)
SSPCON1
0
0
0
0
0
0
0
0
0000 0000
SSPCON2(3)
0
0
0
0
0
0
0
0
0000 0000
ADRESH
A/D Result Register, High Byte
ADRESL
A/D Result Register, Low Byte
—
—
ADCON1
—
—
ADCON2
ADFM
—
ADCON0
xxxx xxxx
xxxx xxxx
CHS3
CHS2
CHS1
CHS0
GO/DONE
ADON
--00 0000
—
—
PVCFG1
PVCFG0
NVCFG1
NVCFG0
---- 0000
ACQT2
ACQT1
ACQT0
ADCS2
ADCS1
ADCS0
0-00 0000
CCPR1H
Capture/Compare/PWM Register 1, High Byte
CCPR1L
Capture/Compare/PWM Register 1, Low Byte
CCP1CON
P1M1
P1M0
xxxx xxxx
xxxx xxxx
DC1B1
DC1B0
CCP1M3
CCP1M2
CCP1M1
CCP1M0
0000 0000
DAC1R4
DAC1R3
DAC1R2
DAC1R1
DAC1R0
---0 0000
VREFCON2
—
—
—
VREFCON1
D1EN
D1LPS
DAC1OE
---
D1PSS1
D1PSS0
—
D1NSS
000- 00-0
VREFCON0
FVR1EN
FVR1ST
FVR1S1
FVR1S0
—
—
—
—
0001 ----
PSTRCON
—
—
—
STRSYNC
STRD
STRC
STRB
STRA
---0 0001
ABDOVF
RCIDL
0
0
BRG16
—
WUE
ABDEN
0100 0-00
PWM1CON
PRSEN
PDC6
PDC5
PDC4
PDC3
PDC2
PDC1
PDC0
0000 0000
ECCP1AS
ECCPASE
ECCPAS2
ECCPAS1
ECCPAS0
PSSAC1
PSSAC0
PSSBD1
PSSBD0
0000 0000
BAUDCON(3)
TMR3H
Timer3 Register, High Byte
TMR3L
Timer3 Register, Low Byte
RD16
T3CON
Legend:
Note 1:
2:
3:
—
xxxx xxxx
xxxx xxxx
T3CKPS1
T3CKPS0
T3CCP1
T3SYNC
TMR3CS
TMR3ON
0-00 0000
x = unknown, u = unchanged, — = unimplemented, q = value depends on condition
The SBOREN bit is only available when the BOREN<1:0> Configuration bits = 01; otherwise it is disabled and reads as ‘0’. Refer to
DS41365, “PIC18(L)F1XK22 Data Sheet”, Section 21.4 “Brown-out Reset (BOR)” for additional information
The RA3 bit is only available when Master Clear Reset is disabled (MCLRE Configuration bit = 0). Otherwise, RA3 reads as ‘0’. This bit
is read-only.
Rows highlighted in black show required values for normal LIN protocol applications.
DS41580A-page 20
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
TABLE 2-2:
File Name
REGISTER FILE SUMMARY (PIC18F14K22LIN) (CONTINUED)
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Value on POR,
BOR
Bit 0
SPBRGH
EUSART Baud Rate Generator Register, High Byte
0000 0000
SPBRG
EUSART Baud Rate Generator Register, Low Byte
0000 0000
RCREG
EUSART Receive Register
0000 0000
TXREG
EUSART Transmit Register
0000 0000
TXSTA(3)
0
0
TXEN
0
SENDB
BRGH
TRMT
0
0000 0010
RCSTA(3)
SPEN
0
0
CREN
0
FERR
OERR
0
0000 000x
EEADR7
EEADR6
EEADR5
EEADR4
EEADR3
EEADR2
EEADR1
EEADR0
0000 0000
—
—
—
—
—
—
EEADR9
EEADR8
EEADR
EEADRH
EEDATA
EEPROM Data Register
EECON2
EEPROM Control Register 2 (not a physical register)
---- --00
0000 0000
0000 0000
EECON1
EEPGD
CFGS
—
FREE
WRERR
WREN
WR
RD
xx-0 x000
IPR2
OSCFIP
C1IP
C2IP
EEIP
BCLIP
—
TMR3IP
—
1111 111-
PIR2
OSCFIF
C1IF
C2IF
EEIF
BCLIF
—
TMR3IF
—
0000 000-
TMR3IE
—
0000 000-
PIE2
OSCFIE
C1IE
C2IE
EEIE
BCLIE
—
(3)
IPR1
—
ADIP
RCIP
TXIP
1
CCP1IP
TMR2IP
TMR1IP
-111 1111
PIR1(3)
—
ADIF
RCIF
TXIF
0
CCP1IF
TMR2IF
TMR1IF
-000 0000
(3)
—
ADIE
RCIE
TXIE
0
CCP1IE
TMR2IE
TMR1IE
-000 0000
OSCTUNE
INTSRC
PLLEN
TUN5
TUN4
TUN3
TUN2
TUN1
TUN0
0000 0000
TRISC(3)
TRISC7
—
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
1111 1111
TRISB(3)
TRISB7
TRISB6
TRISB5
TRISB4
—
—
—
—
1111 ----
—
—
TRISA5
TRISA4
—
TRISA2
TRISA1
TRISA0
--11 -111
LINRESET
—
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
xxxx xxxx
—
—
—
—
xxxx ----
PIE1
TRISA
LATC(3)
LATB(3)
LATA
PORTC(3)
PORTB(3)
LATB7
LATB6
LATB5
LATB4
—
—
LATA5
LATA4
—
LATA2
LATA1
LATA0
--xx -xxx
LINRESET
—
RC5
RC4
RC3
RC2
RC1
RC0
xxxx xxxx
RB4
—
—
—
—
xxxx ----
LINTX
LINCS
PORTA
—
—
RA5
RA4
RA3(2)
RA2
RA1
RA0
--xx xxxx
ANSELH(3)
—
—
—
—
0
ANS10
0
0
---- 1111
ANSEL
ANS7
ANS6
ANS5
ANS4
ANS3
ANS2
ANS1
ANS0
1111 1111
IOCB
IOCB7
IOCB6
IOCB5
IOCB4
—
—
—
—
0000 ----
IOCA
—
—
IOCA5
IOCA4
IOCA3
IOCA2
IOCA1
IOCA0
--00 0000
WPUB
WPUB7
WPUB6
WPUB5
WPUB4
—
—
—
—
1111 ----
WPUA
—
—
WPUA5
WPUA4
WPUA3
WPUA2
WPUA1
WPUA0
--11 1111
SLRCON
—
—
—
—
—
Reserved
Reserved
Reserved
---- -111
SSPMSK(3)
1
1
1
1
1
1
1
1
1111 1111
CM1CON0
C1ON
C1OUT
C1OE
C1POL
C1SP
C1R
C1CH1
C1CH0
0000 1000
CM2CON1
MC1OUT
MC2OUT
C1RSEL
C2RSEL
C1HYS
C2HYS
C1SYNC
C2SYNC
0000 0000
CM2CON0
SRCON1
SRCON0
Legend:
Note 1:
2:
3:
LINRX
C2ON
C2OUT
C2OE
C2POL
C2SP
C2R
C2CH1
C2CH0
0000 1000
SRSPE
SRSCKE
SRSC2E
SRSC1E
SRRPE
SRRCKE
SRRC2E
SRRC1E
0000 0000
SRLEN
SRCLK2
SRCLK1
SRCLK0
SRQEN
SRNQEN
SRPS
SRPR
0000 0000
x = unknown, u = unchanged, — = unimplemented, q = value depends on condition
The SBOREN bit is only available when the BOREN<1:0> Configuration bits = 01; otherwise it is disabled and reads as ‘0’. Refer to
DS41365, “PIC18(L)F1XK22 Data Sheet”, Section 21.4 “Brown-out Reset (BOR)” for additional information
The RA3 bit is only available when Master Clear Reset is disabled (MCLRE Configuration bit = 0). Otherwise, RA3 reads as ‘0’. This bit
is read-only.
Rows highlighted in black show required values for normal LIN protocol applications.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 21
PIC18F14K22LIN
NOTES:
DS41580A-page 22
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
3.0
I/O PORTS
3.1
PORTB, TRISB and LATB
Registers
EXAMPLE 3-1:
PORTB is a 4-bit wide, bidirectional port. It functions
the same as described in the “PIC18F1XK22/LF1XK22
Data Sheet” (DS41365) with the following differences.
Three bits are dedicated to the LIN transceiver. No pins
are associated with this function. Only RB4 is available
on a pin. The corresponding data direction register is
TRISB. The TRISB bits must be set as ‘001x 0000’.
The PORTB Data Latch register (LATB) is also memory
mapped. Read-modify-write operations on the LATB
register read and write the latched output value for
PORTB.
REGISTER 3-1:
MOVLW
0C0h
MOVWF
PORTB
CLRF
LATB
MOVLW
030h
MOVWF
TRISB
INITIALIZING PORTB
;
;
;
;
;
;
;
;
;
;
;
;
;
set RB6 and RB7
high
Initialize PORTB by
clearing output
data latches
Alternate method
to clear output
data latches
Value used to
initialize data
direction
Set RB<7:6> as outputs
and RB<5:4> as inputs
.
Note:
On a Power-on Reset, RB<5:4> are
configured as analog inputs by default and
read as ‘0’.
PORTB: PORTB REGISTER
R/W-x
R/W-x
R/W-x
R/W-x
U-0
U-0
U-0
U-0
LINTX
LINCS
LINRX
RB4
—
—
—
—
bit 7
bit 0
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
bit 7
LINTX: Dedicated to the LIN Transceiver Transmit Function
bit 6
LINCS: Dedicated to the LIN Transceiver Chip Select Function
bit 5
LINRX: Dedicated to the LIN Transceiver Receive Function
bit 4
RB4: PORTB I/O Pin bit
1 = Port pin is >VIH
0 = Port pin is <VIL
bit 3-0
Unimplemented: Read as ‘0’
 2011 Microchip Technology Inc.
Preliminary
x = Bit is unknown
DS41580A-page 23
PIC18F14K22LIN
REGISTER 3-2:
TRISB: PORTB TRI-STATE REGISTER
R/W-1
R/W-1
R/W-1
R/W-1
U-0
U-0
U-0
U-0
TRISB7
TRISB6
TRISB5
TRISB4
—
—
—
—
bit 7
bit 0
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
bit 7-6
TRISB<7:6>: PORTB Tri-State Control bits
Initialize as 0 = PORTB pin configured as an output
bit 5-4
TRISB<5:4>: PORTB Tri-State Control bits
Initialize as 1 = PORTB pin configured as an input (tri-stated)
bit 3-0
Unimplemented: Read as ‘0’
REGISTER 3-3:
x = Bit is unknown
LATB: PORTB DATA LATCH REGISTER
R/W-x
R/W-x
R/W-x
R/W-x
U-0
U-0
U-0
U-0
LATB7
LATB6
LATB5
LATB4
—
—
—
—
bit 7
bit 0
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
bit 7
LATB7: Dedicated to the LIN Transceiver Transmit Function
bit 6
LATB6: Dedicated to the LIN Transceiver Chip Select Function
bit 5
LATB5: Dedicated to the LIN Transceiver Receive Function
bit 4
LATB4: RB<7:4> Port I/O Output Latch Register bits
bit 3-0
Unimplemented: Read as ‘0’
DS41580A-page 24
Preliminary
x = Bit is unknown
 2011 Microchip Technology Inc.
PIC18F14K22LIN
REGISTER 3-4:
WPUB: WEAK PULL-UP PORTB REGISTER
R/W-1
R/W-1
R/W-1
R/W-1
U-0
U-0
U-0
U-0
WPUB7
WPUB6
WPUB5
WPUB4
—
—
—
—
bit 7
bit 0
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
bit 7-4
WPUB<7:4>: Weak Pull-up Enable bit
1 = Pull-up enabled
0 = Pull-up disabled
bit 3-0
Unimplemented: Read as ‘0’
REGISTER 3-5:
x = Bit is unknown
IOCB: INTERRUPT-ON-CHANGE PORTB REGISTER
R/W-0
R/W-0
R/W-0
R/W-0
U-0
U-0
U-0
U-0
IOCB7
IOCB6
IOCB5
IOCB4
—
—
—
—
bit 7
bit 0
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
bit 7-4
IOCB<7:4>: Interrupt-on-Change bits
1 = Interrupt-on-change enabled
0 = Interrupt-on-change disabled
bit 3-0
Unimplemented: Read as ‘0’
TABLE 3-1:
Pin
RB4/AN10/SDI/
SDA
RB5/AN11/RX/DT
x = Bit is unknown
PORTB I/O SUMMARY
Function
TRIS
Setting
I/O
I/O
Type
RB4
0
O
DIG
Description
LATB<4> data output.
1
I
TTL
PORTB<4> data input; Programmable weak pull-up.
AN10
1
I
ANA
ADC input channel 10.
RB5
0
O
DIG
LATB<5> data output.
PORTB<5> data input; Programmable weak pull-up.
1
I
TTL
RX
1
I
ST
Asynchronous serial receive data input (USART module).
RB6/SCK/SCL
RB6
0
O
DIG
LATB<6> data output.
1
I
TTL
PORTB<6> data input; Programmable weak pull-up.
RB7/TX/CK
RB7
0
O
DIG
LATB<7> data output.
1
I
TTL
PORTB<7> data input; Programmable weak pull-up.
1
O
DIG
Asynchronous serial transmit data output (USART module).
TX
Legend:
DIG = Digital level output; TTL = TTL input buffer; ST = Schmitt Trigger input buffer; ANA = Analog level input/output;
x = Don’t care (TRIS bit does not affect port direction or is overridden for this option).
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 25
PIC18F14K22LIN
TABLE 3-2:
SUMMARY OF REGISTERS ASSOCIATED WITH PORTB
Name
ANSELH
INTCON
INTCON2
Bit 7
Bit 6
—
—
GIE/GIEH PEIE/GIEL
RABPU
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on page
—
—
0
ANS10
0
0
30
TMR0IE
INT0IE
RABIE
TMR0IF
INT0IF
RABIF
—(1)
—
TMR0IP
—
RABIP
—(1)
—
—
—
24
23
INTEDG0 INTEDG1 INTEDG2
IOCB
IOCB7
IOCB6
IOCB5
IOCB4
LATB
LATB7
LATB6
LATB5
LATB4
—
25
PORTB
LINTX
LINCS
LINRX
RB4
—
—
—
—
RCSTA
SPEN
0
0
CREN
0
FERR
OERR
0
38
SLRCON
Reserved
—(1)
SSPCON1
Reserved
—(1)
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
—
—
—
—
24
TXSTA
0
0
TXEN
0
SENDB
BRGH
TRMT
0
37
WPUB
WPUB7
WPUB6
WPUB5
WPUB4
—
—
—
—
25
Legend: — = unimplemented, read as ‘0’. Shaded cells are not used by PORTB.
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).
DS41580A-page 26
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
3.2
PORTC, TRISC and LATC
Registers
Note:
PORTC is an 8-bit wide, bidirectional port. It functions
the same as described in the “PIC18F1XK22/LF1XK22
Data Sheet” (DS41365) with the following differences.
One bit is dedicated to the LIN transceiver and one bit
is not available. No pins are associated with this function. Only RC<5:0> are available on pins. The corresponding data direction register is TRISC. The TRISC
bits must be set as ‘1xxx xxxx’.
The PORTC Data Latch register (LATC) is also memory mapped. Read-modify-write operations on the
LATC register read and write the latched output value
for PORTC.
REGISTER 3-6:
On a Power-on Reset, RC<7:6> and
RC<3:0> are configured as analog inputs
and read as ‘0’.
EXAMPLE 3-2:
CLRF
PORTC
CLRF
LATC
MOVLW
0FFh
MOVWF
TRISC
INITIALIZING PORTC
;
;
;
;
;
;
;
;
;
;
;
;
Initialize PORTC by
clearing output
data latches
Alternate method
to clear output
data latches
Value used to
initialize data
direction
Set RC<3:0> as inputs
RC<5:4> as outputs
RC<7:6> as inputs
PORTC: PORTC REGISTER
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
LINRESET
—
RC5
RC4
RC3
RC2
RC1
RC0
bit 7
bit 0
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
bit 7
LINRESET: LIN Reset Input bit
1 = LIN Reset not asserted
0 = LIN Reset asserted
bit 6
RC6: No function
bit 5-0
RC<5:0>: PORTC I/O Pin bits
1 = Port pin is > VIH
0 = Port pin is < VIL
 2011 Microchip Technology Inc.
Preliminary
x = Bit is unknown
DS41580A-page 27
PIC18F14K22LIN
REGISTER 3-7:
TRISC: PORTC TRI-STATE REGISTER
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
TRISC7
—
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
bit 7
bit 0
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
bit 7
TRISC7: PORTC Tri-State Control bits
1 = PORTC pin configured as LIN Reset input (tri-stated)
0 = Do not use to avoid internal contention
bit 6
TRISC6: Don’t care
bit 5-0
TRISC<5:0>: PORTC Tri-State Control bits
1 = PORTC pin configured as an input (tri-stated)
0 = PORTC pin configured as an output
REGISTER 3-8:
x = Bit is unknown
LATC: PORTC DATA LATCH REGISTER
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
R/W-x
LINRESET
—
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
bit 7
bit 0
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
bit 7
LINRESET: LIN Reset Input bit
1 = LIN Reset not asserted
0 = LIN Reset asserted
bit 6
LATC6: No function
bit 5-0
LATC<5:0>: RB<7:0> Port I/O Output Latch Register bits
DS41580A-page 28
Preliminary
x = Bit is unknown
 2011 Microchip Technology Inc.
PIC18F14K22LIN
TABLE 3-3:
Pin
RC0/AN4/C2IN+
RC1/AN5/
C12IN1-
RC2/AN6/
C12IN2-/P1D
RC3/AN7/
C12IN3-/P1C/
PGM
RC4/C2OUT/P1B
RC5/CCP1/P1A
PORTC I/O SUMMARY
Function
TRIS
Setting
I/O
I/O
Type
RC0
0
O
DIG
1
I
ST
AN4
1
I
ANA
A/D input channel 4.
C2IN+
1
I
ANA
Comparators C2 non-inverting input.
RC1
0
O
DIG
LATC<1> data output.
1
I
ST
AN5
1
I
ANA
A/D input channel 5.
C12IN1-
1
I
ANA
Comparators C1 and C2 inverting input, channel 1.
RC2
0
O
DIG
LATC<2> data output.
1
I
ST
AN6
1
I
ANA
A/D input channel 6.
C12IN2-
1
I
ANA
Comparators C1 and C2 inverting input, channel 2.
Legend:
PORTC<0> data input.
PORTC<1> data input.
PORTC<2> data input.
P1D
0
O
DIG
ECCP1 Enhanced PWM output, channel D.
0
O
DIG
LATC<3> data output.
1
I
ST
AN7
1
I
ANA
A/D input channel 7.
Comparators C1 and C2 inverting input, channel 3.
PORTC<3> data input.
C12IN3-
1
I
ANA
P1C
0
O
DIG
ECCP1 Enhanced PWM output, channel C.
PGM
x
I
ST
Single-Supply Programming mode entry (ICSP™). Enabled by LVP
Configuration bit; all other pin functions disabled.
RC4
0
O
DIG
LATC<4> data output.
1
I
ST
PORTC<4> data input.
C2OUT
0
O
DIG
Comparator 2 output.
P1B
0
O
DIG
ECCP1 Enhanced PWM output, channel B.
RC5
0
O
DIG
LATC<5> data output.
P1A
RC7
LATC<0> data output.
RC3
CCP1
RC6
Description
1
I
ST
PORTC<5> data input.
0
O
DIG
ECCP1 compare or PWM output.
1
I
ST
ECCP1 capture input.
0
0
DIG
ECCP1 Enhanced PWM output, channel A.
RC6
RC7
unavailable
1
I
ST
PORTC<7> data input.
DIG = Digital level output; TTL = TTL input buffer; ST = Schmitt Trigger input buffer; ANA = Analog level input/output;
x = Don’t care (TRIS bit does not affect port direction or is overridden for this option).
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 29
PIC18F14K22LIN
TABLE 3-4:
Name
ANSEL
SUMMARY OF REGISTERS ASSOCIATED WITH PORTC
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on page
ANS7
ANS6
ANS5
ANS4
ANS3
ANS2
ANS1
ANS0
—(1)
—
—
—
—
0
ANS10
0
0
30
P1M1
P1M0
DC1B1
DC1B0
CCP1M0
—(1)
PSSBD1
PSSBD0
—(1)
ANSELH
CCP1CON
CCP1M3 CCP1M2 CCP1M1
ECCP1AS
ECCPASE ECCPAS2 ECCPAS1 ECCPAS0 PSSAC1 PSSAC0
INTCON
GIE/GIEH PEIE/GIEL
TMR0IE
INT0IE
RABIE
TMR0IF
INT0IF
RABIF
—(1)
INTCON2
RABPU
INTEDG0
INTEDG1
INTEDG2
—
TMR0IP
—
RABIP
—(1)
INTCON3
INT2IP
INT1IP
—
INT2IE
INT1IE
—
INT2IF
INT1IF
—(1)
LATC
LINRESET
—
LATC5
LATC4
LATC3
LATC2
LATC1
LATC0
28
PORTC
LINRESET
—
RC5
RC4
RC3
RC2
RC1
RC0
27
PSTRCON
—
—
—
STRSYNC
STRD
STRC
STRB
STRA
—(1)
VREFCON1
D1EN
D1LPS
DAC1OE
---
D1PSS1
D1PSS0
---
D1NSS
—(1)
—
—
—
—
—
SSPCON1
WCOL
SSPOV
SSPEN
CKP
SSPM3
SSPM2
SSPM1
SSPM0
—(1)
TRISC
TRISC7
—
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
28
T1CON
RD16
T1RUN
T3CON
RD16
—
SLRCON
—(1)
Reserved Reserved Reserved
T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON
—(1)
T3CKPS1 T3CKPS0
—(1)
T3CCP1
T3SYNC TMR3CS TMR3ON
Legend: — = unimplemented, read as ‘0’. Shaded cells are not used by PORTB.
0 = must always be written as ‘0’ to avoid undefined LIN operation.
Note 1:
3.3
Information about these registers can be found in the “PIC18(L)F1XK22 Data Sheet” (DS41365).
Port Analog Control
REGISTER 3-9:
ANSELH: ANALOG SELECT HIGH REGISTER
U-0
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
R/W-1
—
—
—
—
0
ANS10
0
0
bit 7
bit 0
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
bit 7-4
Unimplemented: Read as ‘0’
bit 3
Must be ‘0’
bit 2
ANS10: RB4 Analog Select Control bit
1 = Digital input buffer of RB4 is disabled
0 = Digital input buffer of RB4 is enabled
bit 1-0
Must be ‘0’
DS41580A-page 30
Preliminary
x = Bit is unknown
 2011 Microchip Technology Inc.
PIC18F14K22LIN
4.0
MASTER SYNCHRONOUS
SERIAL PORT (MSSP)
MODULE
4.1
Master SSP (MSSP) Module
Overview
The Master Synchronous Serial Port (MSSP) module is
not to be used as its operation conflicts with LIN pin
functions.
TABLE 4-1:
REGISTERS ASSOCIATED WITH MSSP OPERATION
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on page
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)
TRISC7
—
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
28
0
0
0
0
0
0
0
0
—(1)
Name
TRISC
SSPADD
SSPBUF
—(1)
Don’t care
SSPCON1
0
0
0
0
0
0
0
0
—(1)
SSPCON2
0
0
0
0
0
0
0
0
—(1)
SSPMSK
1
1
1
1
1
1
1
1
—(1)
SSPSTAT
0
0
0
0
0
0
0
0
—(1)
Legend: Shaded cells are not used by the MSSP in SPI mode.
Register bits shown above must not be changed from their initial values and read as shown.
Note 1:
Information about these registers can be found in the “PIC18(L)F1XK22 Data Sheet” (DS41365).
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 31
PIC18F14K22LIN
NOTES:
DS41580A-page 32
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
5.0
ANALOG-TO-DIGITAL
CONVERTER (ADC) MODULE
The Analog-to-Digital Converter (ADC) allows conversion of an analog input signal to a 10-bit binary representation of that signal. It functions the same as
described in the “PIC18F1XK22/LF1XK22 Data Sheet”
(DS41365) with the following differences.
FIGURE 5-1:
ADC BLOCK DIAGRAM
NVCFG[1:0] = 00
AVSS
NVCFG[1:0] = 01
VREF-
AVDD
PVCFG[1:0] = 00
Note: Analog channels marked
reserved are not available
to pins.
VREF+
PVCFG[1:0] = 01
FVR
AN0
0000
AN1
0001
AN2
0010
AN3
0011
AN4
0100
AN5
0101
AN6
0110
AN7
0111
Reserved
1000
Reserved
1001
AN10
1010
Reserved
1011
Unused
1100
Unused
1101
DAC
1110
FVR
1111
PVCFG[1:0] = 10
ADC
10
GO/DONE
ADFM
0 = Left Justify
1 = Right Justify
ADON
10
VSS
ADRESH
ADRESL
CHS<3:0>
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 33
PIC18F14K22LIN
TABLE 5-1:
Name
REGISTERS ASSOCIATED WITH A/D OPERATION
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on page
ADRESH
A/D Result Register, High Byte
—(1)
ADRESL
A/D Result Register, Low Byte
—(1)
ADCON0
—
—
CHS3
CHS2
CHS1
CHS0
GO/DONE
ADON
—(1)
ADCON1
—
—
—
—
PVCFG1
PVCFG0
NVCFG1
NVCFG0
—(1)
ADCON2
ADFM
—
ACQT2
ACQT1
ACQT0
ADCS2
ADCS1
ADCS0
—(1)
ANSEL
ANS7
ANS6
ANS5
ANS4
ANS3
ANS2
ANS1
ANS0
—(1)
—
—
ANSELH
INTCON
GIE/GIEH PEIE/GIEL
—
—
0
ANS10
0
0
30
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)
TRISA
–
–
TRISA5
TRISA4
–
TRISA2
TRISA1
TRISA0
—(1)
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
–
–
–
–
24
TRISC
TRISC7
—
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
28
Legend:
— = unimplemented, read as ‘0’. Shaded cells are not used for A/D conversion
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).
DS41580A-page 34
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
6.0
ENHANCED UNIVERSAL
SYNCHRONOUS
ASYNCHRONOUS RECEIVER
TRANSMITTER (EUSART)
6.1
6.1.1
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:
1.
3.
4.
5.
Name
ASYNCHRONOUS LIN
TRANSMISSION SETUP:
Initialize the SPBRGH:SPBRG register pair and
the BRGH and BRG16 bits to achieve the desired
baud rate (see Register 6-3).
Enable the asynchronous serial port by clearing
the SYNC bit and setting the SPEN bit.
Enable the transmission by setting the TXEN
control bit. This will cause the TXIF interrupt bit
to be set.
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.
Load 8-bit data into the TXREG register. This
will start the transmission.
2.
• The 9-bit character length and address detection
should never be selected
• Synchronous Master or Slave modes are not supported.
• Programmable clock and data polarity should not
be used.
TABLE 6-1:
EUSART Asynchronous LIN
Transmitter
REGISTERS ASSOCIATED WITH ASYNCHRONOUS TRANSMISSION
Bit 7
Bit 6
BAUDCON
ABDOVF
RCIDL
INTCON
GIE/GIEH PEIE/GIEL
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on page
0
0
BRG16
—
WUE
ABDEN
39
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)
SPEN
0
0
CREN
0
FERR
OERR
0
38
RCSTA
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
PIC18F14K22LIN
6.1.2
EUSART ASYNCHRONOUS LIN
RECEIVER
6.1.2.1
1.
2.
3.
4.
5.
Asynchronous Reception Setup:
Initialize the SPBRGH:SPBRG register pair and
the BRGH and BRG16 bits to achieve the
desired baud rate (see Register 6-3).
Enable the serial port by setting the SPEN bit
and the RX/DT pin TRIS bit. The SYNC bit must
be clear for asynchronous operation.
If interrupts are desired, set the RCIE interrupt
enable bit and set the GIE and PEIE bits of the
INTCON register.
TABLE 6-2:
6.
7.
8.
REGISTERS ASSOCIATED WITH ASYNCHRONOUS RECEPTION
Name
Bit 7
Bit 6
BAUDCON
ABDOVF
RCIDL
INTCON
Enable reception by setting the CREN bit.
The RCIF interrupt flag bit will be set when a
character is transferred from the RSR to the
receive buffer. An interrupt will be generated if
the RCIE interrupt enable bit was also set.
Read the RCSTA register to get the error flags
and, if 9-bit data reception is enabled, the ninth
data bit.
Get the received 8 Least Significant data bits
from the receive buffer by reading the RCREG
register.
If an overrun occurred, clear the OERR flag by
clearing the CREN receiver enable bit.
GIE/GIEH PEIE/GIEL
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Reset
Values
on page
0
0
BRG16
—
WUE
ABDEN
39
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)
RCREG
RCSTA
—(1)
EUSART Receive Register
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)
TRISC
TRISC7
—
TRISC5
TRISC4
TRISC3
TRISC2
TRISC1
TRISC0
—(1)
TXSTA
0
0
TXEN
0
SENDB
BRGH
TRMT
0
37
Legend: — = unimplemented locations read as ‘0’. Shaded cells are not used for asynchronous reception.
Note 1: Information about these registers can be found in “PIC18(L)F1XK22 Data Sheet” (DS41365).
DS41580A-page 36
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
REGISTER 6-1:
TXSTA: TRANSMIT STATUS AND CONTROL REGISTER
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R-1
R/W-0
0
0
TXEN(1)
0
SENDB
BRGH
TRMT
0
bit 7
bit 0
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
bit 7
Must be ‘0’
bit 6
Must be ‘0’
bit 5
TXEN: Transmit Enable bit(1)
1 = Transmit enabled
0 = Transmit disabled
bit 4
Must be ‘0’
bit 3
SENDB: Send Break Character bit
1 = Send Sync Break on next transmission (cleared by hardware upon completion)
0 = Sync Break transmission completed
bit 2
BRGH: High Baud Rate Select bit
Asynchronous mode:
1 = High speed
0 = Low speed
bit 1
TRMT: Transmit Shift Register Status bit
1 = TSR empty
0 = TSR full
bit 0
Must be ‘0’
Note 1:
SREN/CREN overrides TXEN in Sync mode.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 37
PIC18F14K22LIN
REGISTER 6-2:
RCSTA: RECEIVE STATUS AND CONTROL REGISTER(1)
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R-0
R-0
R-x
SPEN
0
0
CREN
0
FERR
OERR
0
bit 7
bit 0
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
bit 7
SPEN: Serial Port Enable bit
1 = Serial port enabled (configures RX/DT and TX/CK pins as serial port pins)
0 = Serial port disabled (held in Reset)
bit 6
Must be ‘0’
bit 5
Don’t care
bit 4
CREN: Continuous Receive Enable bit
1 = Enables receiver
0 = Disables receiver
bit 3
Must be ‘0’
bit 2
FERR: Framing Error bit
1 = Framing error (can be updated by reading RCREG register and receive next valid byte)
0 = No framing error
bit 1
OERR: Overrun Error bit
1 = Overrun error (can be cleared by clearing bit CREN)
0 = No overrun error
bit 0
Don’t care
DS41580A-page 38
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
REGISTER 6-3:
BAUDCON: BAUD RATE CONTROL REGISTER
R-0
R-1
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
ABDOVF
RCIDL
0
0
BRG16
—
WUE
ABDEN
bit 7
bit 0
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
bit 7
ABDOVF: Auto-Baud Detect Overflow bit
Asynchronous mode:
1 = Auto-baud timer overflowed
0 = Auto-baud timer did not overflow
Synchronous mode:
Don’t care
bit 6
RCIDL: Receive Idle Flag bit
Asynchronous mode:
1 = Receiver is Idle
0 = Start bit has been detected and the receiver is active
Synchronous mode:
Don’t care
bit 5
Must be ‘0’
bit 4
Must be ‘0’
bit 3
BRG16: 16-bit Baud Rate Generator bit
1 = 16-bit Baud Rate Generator is used (SPBRGH:SPBRG)
0 = 8-bit Baud Rate Generator is used (SPBRG)
bit 2
Unimplemented: Read as ‘0’
bit 1
WUE: Wake-up Enable bit
Asynchronous mode:
1 = Receiver is waiting for a falling edge. No character will be received but RCIF will be set on the
falling edge. WUE will automatically clear on the rising edge.
0 = Receiver is operating normally
Synchronous mode:
Don’t care
bit 0
ABDEN: Auto-Baud Detect Enable bit
Asynchronous mode:
1 = Auto-Baud Detect mode is enabled (clears when auto-baud is complete)
0 = Auto-Baud Detect mode is disabled
Synchronous mode:
Don’t care
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 39
PIC18F14K22LIN
NOTES:
DS41580A-page 40
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
7.0
LIN/J2602 TRANSCEIVER AND
VOLTAGE REGULATOR
Please refer to “MCP2021/2, LIN Transceiver with Voltage Regulator Data Sheet” (DS22018). Only differences in the PIC18F14K22LIN are noted here.
The LIN/J2602 Transceiver provides a physical interface to a LIN half-duplex bus. It is intended for automotive and industrial applications with serial bus speeds
up to 20 Kbaud.
The PIC18F14K22LIN provides a +5V 50 mA regulated
power output.
7.1
7.1.1
Pin Descriptions
POWER OUTPUT (VREG)
Positive Supply Voltage Regulator Output pin.
7.1.2
GROUND (VSS)
Ground pin.
7.1.3
BATTERY (VBB)
Battery Positive Supply Voltage pin. This pin is also the
input for the Internal Voltage Regulator.
7.1.4
LIN BUS
The bidirectional LIN bus Interface pin is the driver unit
for the LIN pin.
7.1.5
FAULT/TXE
Fault Detect output and Transmitter Enable input
bidirectional pin.
7.2
7.2.1
Internal Connections
TRANSMIT DATA INPUT (TXD)
The Transmit Data Input pin has an internal pull-up to
VREG. The LIN pin is low (dominant) when TXD is low.
Internally connected to PORTB<7>.
7.2.2
RECEIVE DATA OUTPUT (RXD)
The Receive Data Output pin is a standard CMOS
output and follows the state of the LIN pin. It is internally
connected to PORTB<5>.
7.2.3
CS/LWAKE
Chip Select Input pin. It is internally connected to
PORTB<6>.
7.2.4
RESET
RESET is an open-drain output. It is internally
connected to PORTC<7>.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 41
PIC18F14K22LIN
NOTES:
DS41580A-page 42
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
8.0
ELECTRICAL SPECIFICATIONS
Absolute Maximum Ratings(†)
Ambient temperature under bias....................................................................................................... -40°C to +125°C
Storage temperature ........................................................................................................................ -65°C to +150°C
Voltage on VDD with respect to VSS, PIC18F1XK22 ........................................................................... -0.3V to +6.0V
Voltage on VDD with respect to VSS, PIC18LF1XK22 ......................................................................... -0.3V to +4.0V
Voltage on MCLR with respect to VSS ................................................................................................. -0.3V to +9.0V
Voltage on all other pins with respect to VSS .............................................................................-0.3V to (VDD + 0.3V
Total power dissipation(1) ............................................................................................................................... 800 mW
Maximum current out of VSS pin ...................................................................................................................... 95 mA
Maximum current into VDD pin ......................................................................................................................... 95 mA
Clamp current, IK (VPIN < 0 or VPIN > VDD)20 mA
Maximum output current sunk by any I/O pin.................................................................................................... 25 mA
Maximum output current sourced by any I/O pin .............................................................................................. 25 mA
Maximum current sunk by all ports ................................................................................................................... 90 mA
Maximum current sourced by all ports ............................................................................................................. 90 mA
Note 1:
Power dissipation is calculated as follows: PDIS = VDD x {IDD –  IOH} +  {(VDD – VOH) x IOH} + (VOl x
IOL).
† NOTICE: Stresses above those listed under “Absolute Maximum Ratings” may cause permanent damage to the
device. This is a stress rating only and functional operation of the device at those or any other conditions above those
indicated in the operation listings of this specification is not implied. Exposure above maximum rating conditions for
extended periods may affect device reliability.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 43
PIC18F14K22LIN
FIGURE 8-1:
HFINTOSC FREQUENCY ACCURACY OVER DEVICE VDD AND TEMPERATURE
125
± 6%
Temperature (°C)
85
60
± 3%
25
0
-20
± 6%
-40
1.8
2.0
2.5
3.5
3.0
4.0
4.5
5.0
5.5
VDD (V)
8.1
DC Characteristics: RC Run Supply Current, PIC18F14K22LIN
PIC18F14K22LIN
Param
No.
Device Characteristics
D008
D009
D010
Standard Operating Conditions (unless otherwise stated)
Operating temperature
-40°C  TA  +125°C for extended
Typ.
Max.
15.5
19.5
A
-40°C
16.5
20.5
A
+25°C
20.5
29.5
A
+85°C
30.5
35.5
A
+125°C
0.98
0.98
mA
-40°C TO +125°C
4.0
4.7
Units
mA
Conditions
-40°C TO +125°C
VDD = 5.0V
VDD = 5.0V
VDD = 5.0V
FOSC = 31 kHz(4)
(RC_RUN mode,
LFINTOSC source)
FOSC = 1 MHz
(RC_RUN mode,
HFINTOSC source)
FOSC = 16 MHz
(RC_RUN mode,
HF-INTOSC source)
* These parameters are characterized but not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O pin loading
and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current
consumption.
3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be extended
by the formula IR = VDD/2REXT (mA) with REXT in k
4: FVR and BOR are disabled.
5: When a single temperature range is provided for a parameter, the specification applies to both industrial and extended
temperature devices.
DS41580A-page 44
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
8.2
DC Characteristics: RC Idle Supply Current, PIC18F14K22LIN
PIC18F14K22LIN
D011
Standard Operating Conditions (unless otherwise stated)
Operating temperature
-40°C  TA  +125°C for extended
8.5
12.5
A
-40°C
9.5
14.5
A
+25°C
13.5
24.5
A
+85°C
24.5
30.5
A
+125°C
VDD = 5.0V
D012
630
780
A
-40°C to +125°C
VDD = 5.0V
D013
1.8
2.2
mA
-40°C to +125°C
VDD = 5.0V
FOSC = 31 kHz(4)
(RC_IDLE mode,
LFINTOSC source)
FOSC = 1 MHz
(RC_IDLE mode,
HF-INTOSC source)
FOSC = 16 MHz
(RC_IDLE mode,
HF-INTOSC source)
* These parameters are characterized but not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O pin loading
and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact on the current
consumption.
3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be extended
by the formula IR = VDD/2REXT (mA) with REXT in k
4: FVR and BOR are disabled.
5: When a single temperature range is provided for a parameter, the specification applies to both industrial and extended
temperature devices.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 45
PIC18F14K22LIN
8.3
DC Characteristics: Primary Run Supply Current, PIC18F14K22LIN
PIC18F14K22LIN
Param
No.
Device Characteristics
Standard Operating Conditions (unless otherwise stated)
Operating temperature
-40°C  TA  +125°C for extended
Typ.
Max.
Units
Conditions
D014
.30
.42
mA
-40°C to +125°C
VDD = 5.0V
D015
3.9
4.4
mA
-40°C to +125°C
VDD = 5.0V
D016
12.1
14.6
mA
-40°C to +125°C
VDD = 5.0V
D017
3.8
4.8
mA
-40°C to +125°C
VDD = 5.0V
12.6
15.6
mA
-40°C to +125°C
VDD = 5.0V
D018
FOSC = 1 MHz
(PRI_RUN,
EC Med Osc)
FOSC = 16 MHz
(PRI_RUN,
EC High Osc)
FOSC = 64 MHz
(PRI_RUN,
EC High Osc)
FOSC = 4 MHz
16 MHz Internal
(PRI_RUN HS+PLL)
FOSC = 16 MHz
64 MHz Internal
(PRI_RUN HS+PLL)
* These parameters are characterized but not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O pin
loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact
on the current consumption.
3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be
extended by the formula IR = VDD/2REXT (mA) with REXT in k
4: FVR and BOR are disabled.
5:
When a single temperature range is provided for a parameter, the specification applies to both industrial and extended
temperature devices.
DS41580A-page 46
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
8.4
DC Characteristics: Primary Idle Supply Current, PIC18F14K22LIN
PIC18F14K22LIN
Param
No.
Device Characteristics
Standard Operating Conditions (unless otherwise stated)
Operating temperature
-40°C  TA  +125°C for extended
Typ.
Max.
Units
Conditions
D019
FOSC = 1 MHz
(PRI_IDLE mode,
EC Med Osc)
420
455
A
-40°C to +125°C
VDD = 5.0V
4.0
4.2
mA
-40°C to +125°C
VDD = 5.0V
FOSC = 16 MHz
(PRI_IDLEmode,
EC High Osc)
5.3
6.3
mA
-40°C to +125°C
VDD = 5.0V
FOSC = 64 MHz
(PRI_IDLEmode,
EC High Osc)
D020
D021
* These parameters are characterized but not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O pin
loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact
on the current consumption.
3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be
extended by the formula IR = VDD/2REXT (mA) with REXT in k
4:
5:
8.5
FVR and BOR are disabled.
When a single temperature range is provided for a parameter, the specification applies to both industrial and extended
temperature devices.
DC Characteristics: Secondary Run Supply Current, PIC18F14K22LIN
PIC18F14K22LIN
Param
No.
Device Characteristics
D022
Standard Operating Conditions (unless otherwise stated)
Operating temperature
-40°C  TA  +125°C for extended
Typ.
Max.
Units
Conditions
15.5
19.5
A
-40°C
16.5
20.5
A
+25°C
20.5
29.5
A
+85°C
30.5
35.5
A
+125°C
VDD = 5.0V
FOSC = 32 kHz(3)
(SEC_RUN mode,
Timer1 as clock)
* These parameters are characterized but not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O pin
loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact
on the current consumption.
3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be
extended by the formula IR = VDD/2REXT (mA) with REXT in k
4: FVR and BOR are disabled.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 47
PIC18F14K22LIN
8.6
DC Characteristics: Secondary Idle Supply Current, PIC18F14K22LIN
Standard Operating Conditions (unless otherwise stated)
Operating temperature
-40°C  TA  +125°C for extended
PIC18F14K22LIN
Param
No.
Device Characteristics
Typ.
Max.
Units
8.5
12.5
A
-40°C
9.5
14.5
A
+25°C
13.5
24.5
A
+85°C
24.5
30.5
A
+125°C
D023
Conditions
VDD = 5.0V
FOSC = 32 kHz(3)
(SEC_IDLE mode,
Timer1 as clock)
* These parameters are characterized but not tested.
Note 1: The test conditions for all IDD measurements in active operation mode are: OSC1 = external square wave, from
rail-to-rail; all I/O pins tri-stated, pulled to VDD; MCLR = VDD; WDT disabled.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors, such as I/O pin
loading and switching rate, oscillator type, internal code execution pattern and temperature, also have an impact
on the current consumption.
3: For RC oscillator configurations, current through REXT is not included. The current through the resistor can be
extended by the formula IR = VDD/2REXT (mA) with REXT in k
4: FVR and BOR are disabled.
8.7
Thermal Considerations
Standard Operating Conditions (unless otherwise stated)
Operating temperature -40°C  TA  +125°C
Param
No.
Sym.
Characteristic
Typ.
Units
Conditions
TH01
JA
Thermal Resistance Junction to Ambient
108.1
C/W
20-pin SSOP package
TH02
JC
Thermal Resistance Junction to Case
24
C/W
20-pin SSOP package
TH03
TJMAX
Maximum Junction Temperature
150
C
TH04
PD
Power Dissipation
—
W
PD = PINTERNAL + PI/O
TH05
PINTERNAL Internal Power Dissipation
—
W
PINTERNAL = IDD x VDD(1)
TH06
PI/O
I/O Power Dissipation
—
W
PI/O =  (IOL * VOL) +  (IOH * (VDD - VOH))
TH07
PDER
Derated Power
—
W
PDER = PDMAX (TJ - TA)/JA(2)
Legend:
Note 1:
2:
3:
TBD = To Be Determined
IDD is current to run the chip alone without driving any load on the output pins.
TA = Ambient Temperature.
TJ = Junction Temperature.
DS41580A-page 48
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
9.0
DC AND AC
CHARACTERISTICS GRAPHS
AND TABLES
Graphs and tables are not available at this time.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 49
PIC18F14K22LIN
NOTES:
DS41580A-page 50
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
10.0
DEVELOPMENT SUPPORT
10.1
The PIC® microcontrollers and dsPIC® digital signal
controllers are supported with a full range of software
and hardware development tools:
• Integrated Development Environment
- MPLAB® IDE Software
• Compilers/Assemblers/Linkers
- MPLAB C Compiler for Various Device
Families
- HI-TECH C for Various Device Families
- MPASMTM Assembler
- MPLINKTM Object Linker/
MPLIBTM Object Librarian
- MPLAB Assembler/Linker/Librarian for
Various Device Families
• Simulators
- MPLAB SIM Software Simulator
• Emulators
- MPLAB REAL ICE™ In-Circuit Emulator
• In-Circuit Debuggers
- MPLAB ICD 3
- PICkit™ 3 Debug Express
• Device Programmers
- PICkit™ 2 Programmer
- MPLAB PM3 Device Programmer
• Low-Cost Demonstration/Development Boards,
Evaluation Kits, and Starter Kits
MPLAB Integrated Development
Environment Software
The MPLAB IDE software brings an ease of software
development previously unseen in the 8/16/32-bit
microcontroller market. The MPLAB IDE is a Windows®
operating system-based application that contains:
• A single graphical interface to all debugging tools
- Simulator
- Programmer (sold separately)
- In-Circuit Emulator (sold separately)
- In-Circuit Debugger (sold separately)
• A full-featured editor with color-coded context
• A multiple project manager
• Customizable data windows with direct edit of
contents
• High-level source code debugging
• Mouse over variable inspection
• Drag and drop variables from source to watch
windows
• Extensive on-line help
• Integration of select third party tools, such as
IAR C Compilers
The MPLAB IDE allows you to:
• Edit your source files (either C or assembly)
• One-touch compile or assemble, and download to
emulator and simulator tools (automatically
updates all project information)
• Debug using:
- Source files (C or assembly)
- Mixed C and assembly
- Machine code
MPLAB IDE supports multiple debugging tools in a
single development paradigm, from the cost-effective
simulators, through low-cost in-circuit debuggers, to
full-featured emulators. This eliminates the learning
curve when upgrading to tools with increased flexibility
and power.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 51
PIC18F14K22LIN
10.2
MPLAB C Compilers for Various
Device Families
The MPLAB C Compiler code development systems
are complete ANSI C compilers for Microchip’s PIC18,
PIC24 and PIC32 families of microcontrollers and the
dsPIC30 and dsPIC33 families of digital signal controllers. These compilers provide powerful integration
capabilities, superior code optimization and ease of
use.
For easy source level debugging, the compilers provide
symbol information that is optimized to the MPLAB IDE
debugger.
10.3
HI-TECH C for Various Device
Families
For easy source level debugging, the compilers provide
symbol information that is optimized to the MPLAB IDE
debugger.
The compilers include a macro assembler, linker, preprocessor, and one-step driver, and can run on multiple
platforms.
MPASM Assembler
The MPASM Assembler is a full-featured, universal
macro assembler for PIC10/12/16/18 MCUs.
The MPASM Assembler generates relocatable object
files for the MPLINK Object Linker, Intel® standard HEX
files, MAP files to detail memory usage and symbol
reference, absolute LST files that contain source lines
and generated machine code and COFF files for
debugging.
The MPASM Assembler features include:
MPLINK Object Linker/
MPLIB Object Librarian
The MPLINK Object Linker combines relocatable
objects created by the MPASM Assembler and the
MPLAB C18 C Compiler. It can link relocatable objects
from precompiled libraries, using directives from a
linker script.
The MPLIB Object Librarian manages the creation and
modification of library files of precompiled code. When
a routine from a library is called from a source file, only
the modules that contain that routine will be linked in
with the application. This allows large libraries to be
used efficiently in many different applications.
The object linker/library features include:
The HI-TECH C Compiler code development systems
are complete ANSI C compilers for Microchip’s PIC
family of microcontrollers and the dsPIC family of digital
signal controllers. These compilers provide powerful
integration capabilities, omniscient code generation
and ease of use.
10.4
10.5
• Efficient linking of single libraries instead of many
smaller files
• Enhanced code maintainability by grouping
related modules together
• Flexible creation of libraries with easy module
listing, replacement, deletion and extraction
10.6
MPLAB Assembler, Linker and
Librarian for Various Device
Families
MPLAB Assembler produces relocatable machine
code from symbolic assembly language for PIC24,
PIC32 and dsPIC devices. MPLAB C Compiler uses
the assembler to produce its object file. The assembler
generates relocatable object files that can then be
archived or linked with other relocatable object files and
archives to create an executable file. Notable features
of the assembler include:
•
•
•
•
•
•
Support for the entire device instruction set
Support for fixed-point and floating-point data
Command line interface
Rich directive set
Flexible macro language
MPLAB IDE compatibility
• Integration into MPLAB IDE projects
• User-defined macros to streamline
assembly code
• Conditional assembly for multi-purpose
source files
• Directives that allow complete control over the
assembly process
DS41580A-page 52
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
10.7
MPLAB SIM Software Simulator
10.9
The MPLAB SIM Software Simulator allows code
development in a PC-hosted environment by simulating the PIC MCUs and dsPIC® DSCs on an instruction
level. On any given instruction, the data areas can be
examined or modified and stimuli can be applied from
a comprehensive stimulus controller. Registers can be
logged to files for further run-time analysis. The trace
buffer and logic analyzer display extend the power of
the simulator to record and track program execution,
actions on I/O, most peripherals and internal registers.
The MPLAB SIM Software Simulator fully supports
symbolic debugging using the MPLAB C Compilers,
and the MPASM and MPLAB Assemblers. The software simulator offers the flexibility to develop and
debug code outside of the hardware laboratory environment, making it an excellent, economical software
development tool.
10.8
MPLAB REAL ICE In-Circuit
Emulator System
MPLAB REAL ICE In-Circuit Emulator System is
Microchip’s next generation high-speed emulator for
Microchip Flash DSC and MCU devices. It debugs and
programs PIC® Flash MCUs and dsPIC® Flash DSCs
with the easy-to-use, powerful graphical user interface of
the MPLAB Integrated Development Environment (IDE),
included with each kit.
The emulator is connected to the design engineer’s PC
using a high-speed USB 2.0 interface and is connected
to the target with either a connector compatible with incircuit debugger systems (RJ11) or with the new highspeed, noise tolerant, Low-Voltage Differential Signal
(LVDS) interconnection (CAT5).
The emulator is field upgradable through future firmware
downloads in MPLAB IDE. In upcoming releases of
MPLAB IDE, new devices will be supported, and new
features will be added. MPLAB REAL ICE offers
significant advantages over competitive emulators
including low-cost, full-speed emulation, run-time
variable watches, trace analysis, complex breakpoints, a
ruggedized probe interface and long (up to three meters)
interconnection cables.
 2011 Microchip Technology Inc.
MPLAB ICD 3 In-Circuit Debugger
System
MPLAB ICD 3 In-Circuit Debugger System is Microchip's most cost effective high-speed hardware
debugger/programmer for Microchip Flash Digital Signal Controller (DSC) and microcontroller (MCU)
devices. It debugs and programs PIC® Flash microcontrollers and dsPIC® DSCs with the powerful, yet easyto-use graphical user interface of MPLAB Integrated
Development Environment (IDE).
The MPLAB ICD 3 In-Circuit Debugger probe is connected to the design engineer's PC using a high-speed
USB 2.0 interface and is connected to the target with a
connector compatible with the MPLAB ICD 2 or MPLAB
REAL ICE systems (RJ-11). MPLAB ICD 3 supports all
MPLAB ICD 2 headers.
10.10 PICkit 3 In-Circuit Debugger/
Programmer and
PICkit 3 Debug Express
The MPLAB PICkit 3 allows debugging and programming of PIC® and dsPIC® Flash microcontrollers at a
most affordable price point using the powerful graphical
user interface of the MPLAB Integrated Development
Environment (IDE). The MPLAB PICkit 3 is connected
to the design engineer's PC using a full speed USB
interface and can be connected to the target via an
Microchip debug (RJ-11) connector (compatible with
MPLAB ICD 3 and MPLAB REAL ICE). The connector
uses two device I/O pins and the reset line to implement in-circuit debugging and In-Circuit Serial Programming™.
The PICkit 3 Debug Express include the PICkit 3, demo
board and microcontroller, hookup cables and CDROM
with user’s guide, lessons, tutorial, compiler and
MPLAB IDE software.
Preliminary
DS41580A-page 53
PIC18F14K22LIN
10.11 PICkit 2 Development
Programmer/Debugger and
PICkit 2 Debug Express
10.13 Demonstration/Development
Boards, Evaluation Kits, and
Starter Kits
The PICkit™ 2 Development Programmer/Debugger is
a low-cost development tool with an easy to use interface for programming and debugging Microchip’s Flash
families of microcontrollers. The full featured
Windows® programming interface supports baseline
(PIC10F,
PIC12F5xx,
PIC16F5xx),
midrange
(PIC12F6xx, PIC16F), PIC18F, PIC24, dsPIC30,
dsPIC33, and PIC32 families of 8-bit, 16-bit, and 32-bit
microcontrollers, and many Microchip Serial EEPROM
products. With Microchip’s powerful MPLAB Integrated
Development Environment (IDE) the PICkit™ 2
enables in-circuit debugging on most PIC® microcontrollers. In-Circuit-Debugging runs, halts and single
steps the program while the PIC microcontroller is
embedded in the application. When halted at a breakpoint, the file registers can be examined and modified.
A wide variety of demonstration, development and
evaluation boards for various PIC MCUs and dsPIC
DSCs allows quick application development on fully functional systems. Most boards include prototyping areas for
adding custom circuitry and provide application firmware
and source code for examination and modification.
The PICkit 2 Debug Express include the PICkit 2, demo
board and microcontroller, hookup cables and CDROM
with user’s guide, lessons, tutorial, compiler and
MPLAB IDE software.
10.12 MPLAB PM3 Device Programmer
The MPLAB PM3 Device Programmer is a universal,
CE compliant device programmer with programmable
voltage verification at VDDMIN and VDDMAX for
maximum reliability. It features a large LCD display
(128 x 64) for menus and error messages and a modular, detachable socket assembly to support various
package types. The ICSP™ cable assembly is included
as a standard item. In Stand-Alone mode, the MPLAB
PM3 Device Programmer can read, verify and program
PIC devices without a PC connection. It can also set
code protection in this mode. The MPLAB PM3
connects to the host PC via an RS-232 or USB cable.
The MPLAB PM3 has high-speed communications and
optimized algorithms for quick programming of large
memory devices and incorporates an MMC card for file
storage and data applications.
DS41580A-page 54
The boards support a variety of features, including LEDs,
temperature sensors, switches, speakers, RS-232
interfaces, LCD displays, potentiometers and additional
EEPROM memory.
The demonstration and development boards can be
used in teaching environments, for prototyping custom
circuits and for learning about various microcontroller
applications.
In addition to the PICDEM™ and dsPICDEM™ demonstration/development board series of circuits, Microchip
has a line of evaluation kits and demonstration software
for analog filter design, KEELOQ® security ICs, CAN,
IrDA®, PowerSmart battery management, SEEVAL®
evaluation system, Sigma-Delta ADC, flow rate
sensing, plus many more.
Also available are starter kits that contain everything
needed to experience the specified device. This usually
includes a single application and debug capability, all
on one board.
Check the Microchip web page (www.microchip.com)
for the complete list of demonstration, development
and evaluation kits.
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
11.0
PACKAGING INFORMATION
11.1
Package Marking Information
20-Lead SSOP (5.30 mm)
Example
PIC18F14K22
LIN-I/SS
1110017
Legend: XX...X
Y
YY
WW
NNN
e3
*
Note:
Customer-specific information
Year code (last digit of calendar year)
Year code (last 2 digits of calendar year)
Week code (week of January 1 is week ‘01’)
Alphanumeric traceability code
Pb-free JEDEC designator for Matte Tin (Sn)
This package is Pb-free. The Pb-free JEDEC designator ( e3 )
can be found on the outer packaging for this package.
In the event the full Microchip part number cannot be marked on one line, it will
be carried over to the next line, thus limiting the number of available
characters for customer-specific information.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 55
PIC18F14K22LIN
11.2
Package Details
The following section give the technical details of the package.
/HDG3ODVWLF6KULQN6PDOO2XWOLQH66±PP%RG\>6623@
1RWH
)RUWKHPRVWFXUUHQWSDFNDJHGUDZLQJVSOHDVHVHHWKH0LFURFKLS3DFNDJLQJ6SHFLILFDWLRQORFDWHGDW
KWWSZZZPLFURFKLSFRPSDFNDJLQJ
D
N
E
E1
NOTE 1
1 2
e
b
c
A2
A
φ
A1
L1
8QLWV
'LPHQVLRQ/LPLWV
1XPEHURI3LQV
L
0,//,0(7(56
0,1
1
120
0$;
3LWFK
H
2YHUDOO+HLJKW
$
±
%6&
±
0ROGHG3DFNDJH7KLFNQHVV
$
6WDQGRII
$
±
±
2YHUDOO:LGWK
(
0ROGHG3DFNDJH:LGWK
(
2YHUDOO/HQJWK
'
)RRW/HQJWK
/
)RRWSULQW
/
5()
/HDG7KLFNQHVV
F
±
)RRW$QJOH
ƒ
ƒ
ƒ
/HDG:LGWK
E
±
1RWHV
3LQYLVXDOLQGH[IHDWXUHPD\YDU\EXWPXVWEHORFDWHGZLWKLQWKHKDWFKHGDUHD
'LPHQVLRQV'DQG(GRQRWLQFOXGHPROGIODVKRUSURWUXVLRQV0ROGIODVKRUSURWUXVLRQVVKDOOQRWH[FHHGPPSHUVLGH
'LPHQVLRQLQJDQGWROHUDQFLQJSHU$60(<0
%6& %DVLF'LPHQVLRQ7KHRUHWLFDOO\H[DFWYDOXHVKRZQZLWKRXWWROHUDQFHV
5() 5HIHUHQFH'LPHQVLRQXVXDOO\ZLWKRXWWROHUDQFHIRULQIRUPDWLRQSXUSRVHVRQO\
0LFURFKLS 7HFKQRORJ\ 'UDZLQJ &%
DS41580A-page 56
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
Note:
For the most current package drawings, please see the Microchip Packaging Specification located at
http://www.microchip.com/packaging
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 57
PIC18F14K22LIN
NOTES:
DS41580A-page 58
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
APPENDIX A:
REVISION HISTORY
Revision A (April 2011)
Initial release of this document.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 59
PIC18F14K22LIN
NOTES:
DS41580A-page 60
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
INDEX
A
A/D
Associated Registers .................................................. 34
Absolute Maximum Ratings ................................................ 43
ADC
Block Diagram............................................................. 33
ANSELH Register ............................................................... 30
Assembler
MPASM Assembler..................................................... 52
B
BAUDCON Register............................................................ 39
Block Diagrams
ADC ............................................................................ 33
PIC18F14K22LIN-500................................................... 6
C
C Compilers
MPLAB C18 ................................................................ 52
Code Examples
Initializing PORTB....................................................... 23
Initializing PORTC....................................................... 27
Customer Change Notification Service ............................... 63
Customer Notification Service............................................. 63
Customer Support ............................................................... 63
PORTB Register ........................................................... 23, 27
PORTC
Associated Registers.................................................. 30
PORTC Register......................................................... 27
R
RCSTA Register ................................................................. 38
Reader Response............................................................... 64
Register File Summary ................................................. 13, 19
Registers
ANSELH (Analog Select High) ................................... 30
BAUDCON (EUSART Baud Rate Control) ................. 39
IOCB (Interrupt-on-Change PORTB).......................... 25
LATB (PORTB Data Latch) ........................................ 24
LATC (PORTC Data Latch) ........................................ 28
PORTB ................................................................. 23, 27
RCSTA (Receive Status and Control) ........................ 38
TRISB (Tri-State PORTB) .................................... 24, 28
WPUB (Weak Pull-up PORTB)................................... 25
Revision History.................................................................. 59
S
D
Software Simulator (MPLAB SIM) ...................................... 53
Special Function Registers
Map............................................................................. 12
SPI Mode (MSSP)
Associated Registers.................................................. 31
Development Support ......................................................... 51
T
E
Thermal Considerations...................................................... 48
TRISB Register............................................................. 24, 28
Electrical Specifications ...................................................... 43
Enhanced Universal Synchronous Asynchronous
Receiver Transmitter (EUSART)................................. 35
EUSART
Asynchronous LIN Receiver ....................................... 36
Asynchronous Mode
Associated Registers, Receive ........................... 36
Associated Registers, Transmit .......................... 35
W
WPUB Register................................................................... 25
WWW Address ................................................................... 63
WWW, On-Line Support ....................................................... 8
I
I/O Ports .............................................................................. 23
Internet Address.................................................................. 63
IOCB Register ..................................................................... 25
L
LATB Register..................................................................... 24
LATC Register .................................................................... 28
LIN/J2602 Transceiver and Voltage Regulator ................... 41
M
Master Synchronous Serial Port (MSSP). See MSSP.
Memory Organization.......................................................... 17
Microchip Internet Web Site ................................................ 63
MPLAB ASM30 Assembler, Linker, Librarian ..................... 52
MPLAB Integrated Development Environment Software .... 51
MPLAB PM3 Device Programmer ...................................... 54
MPLAB REAL ICE In-Circuit Emulator System................... 53
MPLINK Object Linker/MPLIB Object Librarian .................. 52
MSSP
Module Overview ........................................................ 31
P
Packaging Information ........................................................ 55
Marking ....................................................................... 55
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 61
PIC18F14K22LIN
NOTES:
DS41580A-page 62
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
THE MICROCHIP WEB SITE
CUSTOMER SUPPORT
Microchip provides online support via our WWW site at
www.microchip.com. This web site is used as a means
to make files and information easily available to
customers. Accessible by using your favorite Internet
browser, the web site contains the following
information:
Users of Microchip products can receive assistance
through several channels:
• Product Support – Data sheets and errata,
application notes and sample programs, design
resources, user’s guides and hardware support
documents, latest software releases and archived
software
• General Technical Support – Frequently Asked
Questions (FAQ), technical support requests,
online discussion groups, Microchip consultant
program member listing
• Business of Microchip – Product selector and
ordering guides, latest Microchip press releases,
listing of seminars and events, listings of
Microchip sales offices, distributors and factory
representatives
•
•
•
•
•
Distributor or Representative
Local Sales Office
Field Application Engineer (FAE)
Technical Support
Development Systems Information Line
Customers
should
contact
their
distributor,
representative or field application engineer (FAE) for
support. Local sales offices are also available to help
customers. A listing of sales offices and locations is
included in the back of this document.
Technical support is available through the web site
at: http://microchip.com/support
CUSTOMER CHANGE NOTIFICATION
SERVICE
Microchip’s customer notification service helps keep
customers current on Microchip products. Subscribers
will receive e-mail notification whenever there are
changes, updates, revisions or errata related to a
specified product family or development tool of interest.
To register, access the Microchip web site at
www.microchip.com. Under “Support”, click on
“Customer Change Notification” and follow the
registration instructions.
 2011 Microchip Technology Inc.
Preliminary
DS41580A-page 63
PIC18F14K22LIN
READER RESPONSE
It is our intention to provide you with the best documentation possible to ensure successful use of your Microchip
product. If you wish to provide your comments on organization, clarity, subject matter, and ways in which our
documentation can better serve you, please FAX your comments to the Technical Publications Manager at
(480) 792-4150.
Please list the following information, and use this outline to provide us with your comments about this document.
TO:
Technical Publications Manager
RE:
Reader Response
Total Pages Sent ________
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________
FAX: (______) _________ - _________
Application (optional):
Would you like a reply?
Y
N
Device: PIC18F14K22LIN
Literature Number: DS41580A
Questions:
1. What are the best features of this document?
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
6. Is there any incorrect or misleading information (what and where)?
7. How would you improve this document?
DS41580A-page 64
Preliminary
 2011 Microchip Technology Inc.
PIC18F14K22LIN
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
PART NO.
X
/XX
XXX
Device
Temperature
Range
Package
Pattern
Device:
PIC18F14K22LIN(1)
Temperature
Range:
E
Package:
SS
Pattern:
QTP, SQTP, Code or Special Requirements
(blank otherwise)
= -40C to +125C
=
Examples:
a)
PIC18F14K22LIN-500E/SS 301 = 5.0V Voltage Regulator, Extended temp., SSOP package, Extended VDD limits, QTP pattern #301.
(Extended)
SSOP
Note 1:
 2011 Microchip Technology Inc.
Preliminary
T = in tape and reel SSOP Package
only.
DS41580A-page 65
Worldwide Sales and Service
AMERICAS
ASIA/PACIFIC
ASIA/PACIFIC
EUROPE
Corporate Office
2355 West Chandler Blvd.
Chandler, AZ 85224-6199
Tel: 480-792-7200
Fax: 480-792-7277
Technical Support:
http://www.microchip.com/
support
Web Address:
www.microchip.com
Asia Pacific Office
Suites 3707-14, 37th Floor
Tower 6, The Gateway
Harbour City, Kowloon
Hong Kong
Tel: 852-2401-1200
Fax: 852-2401-3431
India - Bangalore
Tel: 91-80-3090-4444
Fax: 91-80-3090-4123
India - New Delhi
Tel: 91-11-4160-8631
Fax: 91-11-4160-8632
Austria - Wels
Tel: 43-7242-2244-39
Fax: 43-7242-2244-393
Denmark - Copenhagen
Tel: 45-4450-2828
Fax: 45-4485-2829
India - Pune
Tel: 91-20-2566-1512
Fax: 91-20-2566-1513
France - Paris
Tel: 33-1-69-53-63-20
Fax: 33-1-69-30-90-79
Japan - Yokohama
Tel: 81-45-471- 6166
Fax: 81-45-471-6122
Germany - Munich
Tel: 49-89-627-144-0
Fax: 49-89-627-144-44
Atlanta
Duluth, GA
Tel: 678-957-9614
Fax: 678-957-1455
Boston
Westborough, MA
Tel: 774-760-0087
Fax: 774-760-0088
Chicago
Itasca, IL
Tel: 630-285-0071
Fax: 630-285-0075
Cleveland
Independence, OH
Tel: 216-447-0464
Fax: 216-447-0643
Dallas
Addison, TX
Tel: 972-818-7423
Fax: 972-818-2924
Detroit
Farmington Hills, MI
Tel: 248-538-2250
Fax: 248-538-2260
Indianapolis
Noblesville, IN
Tel: 317-773-8323
Fax: 317-773-5453
Los Angeles
Mission Viejo, CA
Tel: 949-462-9523
Fax: 949-462-9608
Santa Clara
Santa Clara, CA
Tel: 408-961-6444
Fax: 408-961-6445
Toronto
Mississauga, Ontario,
Canada
Tel: 905-673-0699
Fax: 905-673-6509
Australia - Sydney
Tel: 61-2-9868-6733
Fax: 61-2-9868-6755
China - Beijing
Tel: 86-10-8569-7000
Fax: 86-10-8528-2104
Korea - Daegu
Tel: 82-53-744-4301
Fax: 82-53-744-4302
China - Chengdu
Tel: 86-28-8665-5511
Fax: 86-28-8665-7889
China - Chongqing
Tel: 86-23-8980-9588
Fax: 86-23-8980-9500
Korea - Seoul
Tel: 82-2-554-7200
Fax: 82-2-558-5932 or
82-2-558-5934
China - Hangzhou
Tel: 86-571-2819-3180
Fax: 86-571-2819-3189
Malaysia - Kuala Lumpur
Tel: 60-3-6201-9857
Fax: 60-3-6201-9859
China - Hong Kong SAR
Tel: 852-2401-1200
Fax: 852-2401-3431
Malaysia - Penang
Tel: 60-4-227-8870
Fax: 60-4-227-4068
China - Nanjing
Tel: 86-25-8473-2460
Fax: 86-25-8473-2470
Philippines - Manila
Tel: 63-2-634-9065
Fax: 63-2-634-9069
China - Qingdao
Tel: 86-532-8502-7355
Fax: 86-532-8502-7205
Singapore
Tel: 65-6334-8870
Fax: 65-6334-8850
China - Shanghai
Tel: 86-21-5407-5533
Fax: 86-21-5407-5066
Taiwan - Hsin Chu
Tel: 886-3-6578-300
Fax: 886-3-6578-370
China - Shenyang
Tel: 86-24-2334-2829
Fax: 86-24-2334-2393
Taiwan - Kaohsiung
Tel: 886-7-213-7830
Fax: 886-7-330-9305
China - Shenzhen
Tel: 86-755-8203-2660
Fax: 86-755-8203-1760
Taiwan - Taipei
Tel: 886-2-2500-6610
Fax: 886-2-2508-0102
China - Wuhan
Tel: 86-27-5980-5300
Fax: 86-27-5980-5118
Thailand - Bangkok
Tel: 66-2-694-1351
Fax: 66-2-694-1350
Netherlands - Drunen
Tel: 31-416-690399
Fax: 31-416-690340
Spain - Madrid
Tel: 34-91-708-08-90
Fax: 34-91-708-08-91
UK - Wokingham
Tel: 44-118-921-5869
Fax: 44-118-921-5820
China - Xian
Tel: 86-29-8833-7252
Fax: 86-29-8833-7256
China - Xiamen
Tel: 86-592-2388138
Fax: 86-592-2388130
China - Zhuhai
Tel: 86-756-3210040
Fax: 86-756-3210049
DS41580A-page 66
Italy - Milan
Tel: 39-0331-742611
Fax: 39-0331-466781
05/02/11
Preliminary
 2011 Microchip Technology Inc.