18 F 1320
18 F 1320
Data Sheet
18/20/28-Pin High-Performance,
Enhanced Flash Microcontrollers
with 10-Bit A/D and nanoWatt Technology
• 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.
PIC18F1X20
MCLR/VPP/RA5 MCLR/VPP/RA5 4 17 OSC2/CLKO/RA6
PIC18F1X20
4 15 OSC2/CLKO/RA6
28-Pin QFN
RB3/CCP1/P1A
RB2/P1B/INT2
RA4/T0CKI
RA0/AN0
NC
NC
28
27
26
25
24
23
22
MCLR/VPP/RA5 1 21 OSC1/CLKI/RA7
NC 2 20 OSC2/CLKO/RA6
VSS 3 19 VDD
NC 4 PIC18F1X20 18 NC
AVSS 5 17 AVDD
NC 6 16 RB7/PGD/T1OSI/P1D/KBI3
RA2/AN2/VREF- 7 15 RB6/PGC/T1OSO/T13CKI/P1C/KBI2
10
11
12
13
14
8
9
RB5/PGM/KBI1
RA3/AN3/VREF+
NC
RB0/AN4/INT0
RB1/AN5/TX/CK/INT1
RB4/AN6/RX/DT/KBI0
NC
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.
PORTA
21 Table Pointer <2> Data Latch
8 8 8 8
RA0/AN0
Data RAM
21 inc/dec logic RA1/AN1/LVDIN
21 Address Latch
RA2/AN2/VREF-
20 PCLATU PCLATH
Address Latch 12(2)
Program Memory Address<12> RA3/AN3/VREF+
(4 Kbytes) PCU PCH PCL
PIC18F1220 Program Counter 4 12 4 RA4/T0CKI
(8 Kbytes) BSR FSR0 Bank0, F
PIC18F1320 FSR1
31 Level Stack MCLR/VPP/RA5(1)
FSR2
Data Latch 12
OSC2/CLKO/RA6(2)
16 inc/dec
Decode logic OSC2/CLKI/RA7(2)
Table Latch
8
ROM Latch PORTB
RB0/AN4/INT0
Instruction
Register RB1/AN5/TX/CK/INT1
8
Instruction RB2/P1B/INT2
Decode &
Control PRODH PRODL RB3/CCP1/P1A
3
8 x 8 Multiply
8 RB4/AN6/RX/DT/KBI0
Enhanced Enhanced
USART Data EEPROM
CCP
REXT
Internal
OSC1
Clock
CEXT
PIC18FXXXX
VSS
RA6 I/O (OSC2)
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
2.7 Clock Sources and Oscillator PIC18F1220/1320 devices offer only the Timer1
Switching oscillator as a secondary oscillator. This oscillator, in all
power managed modes, is often the time base for
Like previous PIC18 devices, the PIC18F1220/1320 functions such as a real-time clock.
devices include a feature that allows the system clock
Most often, a 32.768 kHz watch crystal is connected
source to be switched from the main oscillator to an
between the RB6/T1OSO and RB7/T1OSI pins. Like
alternate low-frequency clock source. PIC18F1220/
the LP mode oscillator circuit, loading capacitors are
1320 devices offer two alternate clock sources. When
also connected from each pin to ground. These pins
enabled, these give additional options for switching to
are also used during ICSP operations.
the various power managed operating modes.
The Timer1 oscillator is discussed in greater detail in
Essentially, there are three clock sources for these
Section 12.2 “Timer1 Oscillator”.
devices:
In addition to being a primary clock source, the internal
• Primary oscillators
oscillator block is available as a power managed
• Secondary oscillators mode clock source. The INTRC source is also used as
• Internal oscillator block the clock source for several special features, such as
The primary oscillators include the External Crystal the WDT and Fail-Safe Clock Monitor.
and Resonator modes, the External RC modes, the The clock sources for the PIC18F1220/1320 devices
External Clock modes and the internal oscillator block. are shown in Figure 2-8. See Section 12.0 “Timer1
The particular mode is defined on POR by the contents Module” for further details of the Timer1 oscillator. See
of Configuration Register 1H. The details of these Section 19.1 “Configuration Bits” for configuration
modes are covered earlier in this chapter. register details.
The secondary oscillators are those external sources
not connected to the OSC1 or OSC2 pins. These
sources may continue to operate even after the
controller is placed in a power managed mode.
PIC18F1220/1320 Clock
Primary Oscillator CONFIG1H <3:0> OSCCON<1:0>
Control
OSC2
HSPLL
4 x PLL
Sleep
LP, XT, HS, RC, EC
OSC1
Secondary Oscillator Peripherals
T1OSC
MUX
T1OSO
Clock Source Option
T1OSCEN
Enable for Other Modules
T1OSI Oscillator OSCCON<6:4> Internal Oscillator
OSCCON<6:4> 8 CPU
111
4 MHz
Internal 110
Oscillator 2 MHz IDLEN
101
Block
Postscaler
1 MHz
MUX
100
500 kHz
8 MHz 011
INTRC (INTOSC) 250 kHz
Source 010
125 kHz
001
31 kHz
000
WDT, FSCM
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
3.2 Sleep Mode If the Idle Enable bit, IDLEN (OSCCON<7>), is set to a
‘1’ when a SLEEP instruction is executed, the
The power managed Sleep mode in the PIC18F1220/ peripherals will be clocked from the clock source
1320 devices is identical to that offered in all other PIC selected using the SCS1:SCS0 bits; however, the CPU
microcontrollers. It is entered by clearing the IDLEN will not be clocked. Since the CPU is not executing
and SCS1:SCS0 bits (this is the Reset state) and instructions, the only exits from any of the Idle modes
executing the SLEEP instruction. This shuts down the are by interrupt, WDT time-out or a Reset.
primary oscillator and the OSTS bit is cleared (see
Figure 3-1). When a wake event occurs, CPU execution is delayed
approximately 10 μs while it becomes ready to execute
When a wake event occurs in Sleep mode (by interrupt, code. When the CPU begins executing code, it is
Reset or WDT time-out), the system will not be clocked clocked by the same clock source as was selected in
until the primary clock source becomes ready (see the power managed mode (i.e., when waking from
Figure 3-2), or it will be clocked from the internal RC_IDLE mode, the internal oscillator block will clock
oscillator block if either the Two-Speed Start-up or the the CPU and peripherals until the primary clock source
Fail-Safe Clock Monitor are enabled (see Section 19.0 becomes ready – this is essentially RC_RUN mode).
“Special Features of the CPU”). In either case, the This continues until the primary clock source becomes
OSTS bit is set when the primary clock is providing the ready. When the primary clock becomes ready, the
system clocks. The IDLEN and SCS bits are not OSTS bit is set and the system clock source is
affected by the wake-up. switched to the primary clock (see Figure 3-4). The
IDLEN and SCS bits are not affected by the wake-up.
3.3 Idle Modes While in any Idle mode or the Sleep mode, a WDT
The IDLEN bit allows the microcontroller’s CPU to be time-out will result in a WDT wake-up to full power
selectively shut down while the peripherals continue to operation.
operate. Clearing IDLEN allows the CPU to be clocked.
Setting IDLEN disables clocks to the CPU, effectively
stopping program execution (see Register 2-2). The
peripherals continue to be clocked regardless of the
setting of the IDLEN bit.
There is one exception to how the IDLEN bit functions.
When all the low-power OSCCON bits are cleared
(IDLEN:SCS1:SCS0 = 000), the device enters Sleep
mode upon the execution of the SLEEP instruction. This
is both the Reset state of the OSCCON register and the
setting that selects Sleep mode. This maintains
compatibility with other PIC devices that do not offer
power managed modes.
Q1 Q2 Q3 Q4 Q1
OSC1
CPU
Clock
Peripheral
Clock
Sleep
Program
Counter PC PC + 2
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
TOST(1) TPLL(1)
PLL Clock
Output
CPU Clock
Peripheral
Clock
Program PC PC + 2 PC + 4 PC + 6 PC + 8
Counter
Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
Q1 Q2 Q3 Q4 Q1
OSC1
CPU Clock
Peripheral
Clock
Program PC PC + 2
Counter
Q1 Q2 Q3 Q4
OSC1
Peripheral
Clock
Program PC PC + 2
Counter
Wake Event
T1OSI 1 2 3 4 5 6 7 8
Clock Transition
OSC1
CPU
Clock
Peripheral
Clock
Program
Counter PC PC + 2
FIGURE 3-6: TIMING TRANSITION FOR WAKE FROM SEC_RUN MODE (HSPLL)
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3
T1OSI
OSC1
TOST(1) TPLL(1)
PLL Clock
Output 1 2 3 4 5 6 7 8
Clock Transition
CPU Clock
Peripheral
Clock
Program PC PC + 2 PC + 4 PC + 6
Counter
Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
INTRC 1 2 3 4 5 6 7 8
Clock Transition
OSC1
CPU
Clock
Peripheral
Clock
Program
Counter PC PC + 2
FIGURE 3-8: TIMING TRANSITION FOR WAKE FROM RC_RUN MODE (RC_RUN TO PRI_RUN)
Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3
INTOSC
Multiplexer
OSC1
TOST(1) TPLL(1)
PLL Clock
Output 1 2 3 4 5 6 7 8
Clock Transition
CPU Clock
Peripheral
Clock
Program PC PC + 2 PC + 4 PC + 6
Counter
Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3
T1OSI 1 2 3 4 5 6 7 8
Clock Transition
OSC1
CPU
Clock
Peripheral
Clock
Program
Counter PC PC + 2 PC + 2
INTRC 1 2 3 4 5 6 7 8
Clock Transition
OSC1
CPU
Clock
Peripheral
Clock
Program
Counter PC PC + 2 PC + 4
External Reset
MCLRE
MCLR ( )_IDLE
Sleep
WDT
Time-out
OST/PWRT
OST 1024 Cycles
Chip_Reset
10-bit Ripple Counter R Q
OSC1
32 μs 65.5 ms
PWRT
INTRC(1) 11-bit Ripple Counter
Enable PWRT
Enable OST(2)
Note 1: This is a separate oscillator from the RC oscillator of the CLKI pin.
2: See Table 4-1 for time-out situations.
(1) (2)
HSPLL 66 ms + 1024 TOSC + 2 ms 1024 TOSC + 2 ms(2) 1024 TOSC + 2 ms(2)
HS, XT, LP 66 ms(1) + 1024 TOSC 1024 TOSC 1024 TOSC
EC, ECIO 66 ms(1) 5-10 μs(3) 5-10 μs(3)
RC, RCIO 66 ms(1) 5-10 μs(3) 5-10 μs(3)
INTIO1, INTIO2 66 ms(1) 5-10 μs(3) 5-10 μs(3)
Note 1: 66 ms (65.5 ms) is the nominal Power-up Timer (PWRT) delay.
2: 2 ms is the nominal time required for the 4x PLL to lock.
3: The program memory bias start-up time is always invoked on POR, wake-up from Sleep, or on any exit
from power managed mode that disables the CPU and instruction execution.
TABLE 4-2: STATUS BITS, THEIR SIGNIFICANCE AND THE INITIALIZATION CONDITION FOR
RCON REGISTER
Program RCON
Condition RI TO PD POR BOR STKFUL STKUNF
Counter Register
Power-on Reset 0000h 0--1 1100 1 1 1 0 0 0 0
RESET Instruction 0000h 0--0 uuuu 0 u u u u u u
Brown-out 0000h 0--1 11u- 1 1 1 u 0 u u
MCLR during Power Managed 0000h 0--u 1uuu u 1 u u u u u
Run modes
MCLR during Power Managed 0000h 0--u 10uu u 1 0 u u u u
Idle modes and Sleep
WDT Time-out during Full 0000h 0--u 0uuu u 0 u u u u u
Power or Power Managed Run
MCLR during Full Power u u
Execution
Stack Full Reset (STVR = 1) 0000h 0--u uuuu u u u u u 1 u
Stack Underflow Reset u 1
(STVR = 1)
Stack Underflow Error (not an 0000h u--u uuuu u u u u u u 1
actual Reset, STVR = 0)
WDT Time-out during Power PC + 2 u--u 00uu u 0 0 u u u u
Managed Idle or Sleep
Interrupt Exit from Power PC + 2 u--u u0uu u u 0 u u u u
Managed modes
Legend: u = unchanged, x = unknown, – = unimplemented bit, read as ‘0’
Note 1: When the wake-up is due to an interrupt and the GIEH or GIEL bits are set, the PC is loaded with the
interrupt vector (0x000008h or 0x000018h).
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
FIGURE 4-4: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 1
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
FIGURE 4-5: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 2
VDD
MCLR
INTERNAL POR
TPWRT
OST TIME-OUT
INTERNAL RESET
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
TOST
OST TIME-OUT
INTERNAL RESET
FIGURE 4-7: TIME-OUT SEQUENCE ON POR W/PLL ENABLED (MCLR TIED TO VDD)
VDD
MCLR
INTERNAL POR
TPWRT
PLL TIME-OUT
INTERNAL RESET
FIGURE 5-1: PROGRAM MEMORY MAP FIGURE 5-2: PROGRAM MEMORY MAP
AND STACK FOR AND STACK FOR
PIC18F1220 PIC18F1320
PC<20:0> PC<20:0>
CALL,RCALL,RETURN 21 CALL,RCALL,RETURN 21
RETFIE,RETLW RETFIE,RETLW
Stack Level 1 Stack Level 1
• •
• •
• •
High Priority Interrupt Vector 0008h High Priority Interrupt Vector 0008h
Low Priority Interrupt Vector 0018h Low Priority Interrupt Vector 0018h
On-Chip
Program Memory On-Chip
0FFFh
Program Memory
1000h
1FFFh
2000h
1FFFFFh 1FFFFFh
200000h 200000h
Legend:
R = Readable bit W = Writable bit U = Unimplemented C = Clearable only bit
-n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared x = Bit is unknown
SUB1 •
•
RETURN, FAST ;RESTORE VALUES SAVED
;IN FAST REGISTER STACK
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
Q1
Q2 Internal
Phase
Q3 Clock
Q4
PC PC PC + 2 PC + 4
OSC2/CLKO
(RC Mode)
Execute INST (PC – 2)
Fetch INST (PC) Execute INST (PC)
Fetch INST (PC + 2) Execute INST (PC + 2)
Fetch INST (PC + 4)
All instructions are single cycle, except for any program branches. These take two cycles, since the fetch instruction
is “flushed” from the pipeline, while the new instruction is being fetched and then executed.
5.7.1 TWO-WORD INSTRUCTIONS instruction is executed by itself (first word was skipped),
it will execute as a NOP. This action is necessary when
PIC18F1220/1320 devices have four two-word
the two-word instruction is preceded by a conditional
instructions: MOVFF, CALL, GOTO and LFSR. The second
instruction that results in a skip operation. A program
word of these instructions has the 4 MSBs set to ‘1’s and
example that demonstrates this concept is shown in
is decoded as a NOP instruction. The lower 12 bits of the
Example 5-3. Refer to Section 20.0 “Instruction Set
second word contain data to be used by the instruction.
Summary” for further details of the instruction set.
If the first word of the instruction is executed, the data in
the second word is accessed. If the second word of the
CASE 2:
Object Code Source Code
0110 0110 0000 0000 TSTFSZ REG1 ; is RAM location 0?
1100 0001 0010 0011 MOVFF REG1, REG2 ; Yes, execute this word
1111 0100 0101 0110 ; 2nd word of instruction
0010 0100 0000 0000 ADDWF REG3 ; continue code
00h 000h
= 0000 Access RAM 07Fh
Bank 0 080h
FFh GPR
0FFh
Access Bank
00h
Access RAM Low
7Fh
= 0001 Access RAM High 80h
Bank 1 Unused
to (SFRs)
= 1110 Read ‘00h’ FFh
Bank 14
When a = 0,
The BSR is ignored and the
Access Bank is used.
The first 128 bytes are
General Purpose RAM
EFFh
F00h (from Bank 0).
00h Unused
= 1111 F7Fh
Bank 15 The second 128 bytes are
SFR F80h
FFh FFFh Special Function Registers
(from Bank 15).
When a = 1,
The BSR specifies the Bank
used by the instruction.
• Intermediate computational values BSR<3:0> holds the upper 4 bits of the 12-bit RAM
address. The BSR<7:4> bits will always read ‘0’s and
• Local variables of subroutines
writes will have no effect (see Figure 5-7).
• Faster context saving/switching of variables
A MOVLB instruction has been provided in the instruction
• Common variables
set to assist in selecting banks.
• Faster evaluation/control of SFRs (no banking)
If the currently selected bank is not implemented, any
The Access Bank is comprised of the last 128 bytes in read will return all ‘0’s and all writes are ignored. The
Bank 15 (SFRs) and the first 128 bytes in Bank 0. Status register bits will be set/cleared as appropriate for
These two sections will be referred to as Access RAM the instruction performed.
High and Access RAM Low, respectively. Figure 5-6
indicates the Access RAM areas. Each Bank extends up to FFh (256 bytes). All data
memory is implemented as static RAM.
A bit in the instruction word specifies if the operation is
to occur in the bank specified by the BSR register or in A MOVFF instruction ignores the BSR, since the 12-bit
the Access Bank. This bit is denoted as the ‘a’ bit (for addresses are embedded into the instruction word.
access bit). Section 5.12 “Indirect Addressing, INDF and FSR
When forced in the Access Bank (a = 0), the last Registers” provides a description of indirect address-
address in Access RAM Low is followed by the first ing, which allows linear addressing of the entire RAM
address in Access RAM High. Access RAM High maps space.
the Special Function Registers, so these registers can
be accessed without any software overhead. This is
useful for testing status flags and modifying control bits.
Data
Memory(1)
0h
RAM
Instruction
Executed
Opcode Address
FFFh
12
BSR<3:0> 12 12
Instruction
4 8
Fetched
Opcode File FSR
11 0
Location Select
0000h
Data
Memory(1)
0FFFh
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
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
Instruction: TBLRD*
Program Memory
Table Pointer(1)
Table Latch (8-bit)
TBLPTRU TBLPTRH TBLPTRL
TABLAT
Program Memory
(TBLPTR)
Program Memory
Holding Registers
Table Pointer(1) Table Latch (8-bit)
TBLPTRU TBLPTRH TBLPTRL TABLAT
Program Memory
(TBLPTR)
Note 1: Table Pointer actually points to one of eight holding registers, the address of which is determined by
TBLPTRL<2:0>. The process for physically writing data to the program memory array is discussed
in Section 6.5 “Writing to Flash Program Memory”.
6.2 Control Registers The WREN bit enables and disables erase and write
operations. When set, erase and write operations are
Several control registers are used in conjunction with allowed. When clear, erase and write operations are
the TBLRD and TBLWT instructions. These include the: disabled – the WR bit cannot be set while the WREN bit
• EECON1 register is clear. This process helps to prevent accidental writes
• EECON2 register to memory due to errant (unexpected) code execution.
• TABLAT register Firmware should keep the WREN bit clear at all times,
• TBLPTR registers except when starting erase or write operations. Once
firmware has set the WR bit, the WREN bit may be
6.2.1 EECON1 AND EECON2 REGISTERS cleared. Clearing the WREN bit will not affect the
operation in progress.
EECON1 is the control register for memory accesses.
The WRERR bit is set when a write operation is
EECON2 is not a physical register. Reading EECON2
interrupted by a Reset. In these situations, the user can
will read all ‘0’s. The EECON2 register is used
check the WRERR bit and rewrite the location. It will be
exclusively in the memory write and erase sequences.
necessary to reload the data and address registers
Control bit, EEPGD, determines if the access will be to (EEDATA and EEADR) as these registers have cleared
program or data EEPROM memory. When clear, as a result of the Reset.
operations will access the data EEPROM memory.
Control bits, RD and WR, start read and erase/write
When set, program memory is accessed.
operations, respectively. These bits are set by firmware
Control bit, CFGS, determines if the access will be to and cleared by hardware at the completion of the
the configuration registers, or to program memory/data operation.
EEPROM memory. When set, subsequent operations
The RD bit cannot be set when accessing program
access configuration registers. When CFGS is clear,
memory (EEPGD = 1). Program memory is read using
the EEPGD bit selects either program Flash or data
table read instructions. See Section 6.3 “Reading the
EEPROM memory.
Flash Program Memory” regarding table reads.
The FREE bit controls program memory erase opera-
tions. When the FREE bit is set, the erase operation is Note: Interrupt flag bit, EEIF in the PIR2 register,
initiated on the next WR command. When FREE is is set when the write is complete. It must
clear, only writes are enabled. be cleared in software.
Legend:
R = Readable bit S = Settable only U = Unimplemented bit, read as ‘0’
W = Writable bit -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared
x = Bit is unknown
TABLE 6-1: TABLE POINTER OPERATIONS WITH TBLRD AND TBLWT INSTRUCTIONS
Example Operation on Table Pointer
TBLRD*
TBLPTR is not modified
TBLWT*
TBLRD*+
TBLPTR is incremented after the read/write
TBLWT*+
TBLRD*-
TBLPTR is decremented after the read/write
TBLWT*-
TBLRD+*
TBLPTR is incremented before the read/write
TBLWT+*
ERASE – TBLPTR<21:6>
Program Memory
TBLPTR TBLPTR
LSB = 1 LSB = 0
TABLAT
Write Register
8 8 8 8
Program Memory
TBLPTRU — — bit 21 Program Memory Table Pointer Upper Byte (TBLPTR<20:16>) --00 0000 --00 0000
TBPLTRH Program Memory Table Pointer High Byte (TBLPTR<15:8>) 0000 0000 0000 0000
TBLPTRL Program Memory Table Pointer High Byte (TBLPTR<7:0>) 0000 0000 0000 0000
TABLAT Program Memory Table Latch 0000 0000 0000 0000
INTCON GIE/GIEH PEIE/GIEL TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
EECON2 EEPROM Control Register 2 (not a physical register) — —
EECON1 EEPGD CFGS — FREE WRERR WREN WR RD xx-0 x000 uu-0 u000
IPR2 OSCFIP — — EEIP — LVDIP TMR3IP — 1--1 -11- 1--1 -11-
PIR2 OSCFIF — — EEIF — LVDIF TMR3IF — 0--0 -00- 0--0 -00-
PIE2 OSCFIE — — EEIE — LVDIE TMR3IE — 0--0 -00- 0--0 -00-
Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’.
Shaded cells are not used during Flash/EEPROM access.
Legend:
R = Readable bit S = Settable only U = Unimplemented bit, read as ‘0’
W = Writable bit -n = Value at POR ‘1’ = Bit is set ‘0’ = Bit is cleared
x = Bit is unknown
INTCON GIE/GIEH PEIE/GIEL TMR0IE INTE RBIE TMR0IF INTF RBIF 0000 000x 0000 000u
EEADR EEPROM Address Register 0000 0000 0000 0000
EEDATA EEPROM Data Register 0000 0000 0000 0000
EECON2 EEPROM Control Register 2 (not a physical register) — —
EECON1 EEPGD CFGS — FREE WRERR WREN WR RD xx-0 x000 uu-0 u000
IPR2 OSCFIP — — EEIP — LVDIP TMR3IP — 1--1 -11- 1--1 -11-
PIR2 OSCFIF — — EEIF — LVDIF TMR3IF — 0--0 -00- 0--0 -00-
PIE2 OSCFIE — — EEIE — LVDIE TMR3IE — 0--0 -00- 0--0 -00-
Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used during Flash/EEPROM access.
RCIF IPEN
RCIE GIEL/PEIE
RCIP
IPEN
Additional Peripheral Interrupts
High Priority Interrupt Generation
INT0IF
INT0IE
Interrupt to CPU
TMR0IF Vector to Location
TMR0IE 0018h
ADIF TMR0IP
ADIE RBIF
ADIP RBIE
RBIP GIEL\PEIE
RCIF
RCIE GIE\GIEH
INT0IF
RCIP
INT0IE
INT1IF
Additional Peripheral Interrupts INT1IE
INT1IP
INT2IF
INT2IE
INT2IP
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
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
Note: Interrupt flag bits are set when an interrupt condition occurs, regardless of the state
of its corresponding enable bit or the global interrupt enable bit. User software
should ensure the appropriate interrupt flag bits are clear prior to enabling an
interrupt. This feature allows for software polling.
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
Note: Interrupt flag bits are set when an interrupt condition occurs, regardless of the state
of its corresponding enable bit or the global interrupt enable bit. User software
should ensure the appropriate interrupt flag bits are clear prior to enabling an
interrupt. This feature allows for software polling.
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
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
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
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
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
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
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
RD LATA
RD LATA
Data Data
Bus Bus
D Q D Q
WR LATA VDD WR LATA
or or
PORTA PORTA
CK Q P CK Q I/O pin(1)
N
Data Latch Data Latch
N (1)
I/O pin D Q VSS
D Q
WR TRISA Schmitt
WR TRISA VSS CK Q
CK Q Trigger
Analog TRIS Latch
Input Input
TRIS Latch
Mode Buffer
RD TRISA
RD TRISA
Schmitt
Trigger Q D
Q D Input
Buffer
ENEN
EN
RD PORTA
RD PORTA
TMR0 Clock Input
To A/D Converter and LVD Modules
Note 1: I/O pins have protection diodes to VDD and VSS.
Note 1: I/O pins have protection diodes to VDD and VSS.
RD LATA RD LATA
D Q D Q
WR LATA VDD WR LATA VDD
or or
PORTA PORTA
CK Q P CK Q P
WR WR
TRISA VSS TRISA CK Q VSS
CK Q
TRIS Latch TRIS Latch
Schmitt
Trigger
RD Input RD
TRISA Buffer TRISA Schmitt
ECIO or Trigger
RCIO RA7 Input
Enable Enable Buffer
Q D Q D
EN EN
RD PORTA
RD PORTA
Note 1: I/O pins have protection diodes to VDD and VSS. Note 1: I/O pins have protection diodes to VDD and VSS.
Data Bus
MCLR/VPP/RA5
RD TRISA
Schmitt
Trigger
RD LATA
Latch
Q D
EN
RD PORTA
High-Voltage Detect
HV
Internal MCLR
Filter
Low-Level
MCLR Detect
PORTA RA7(1) RA6(1) RA5(2) RA4 RA3 RA2 RA1 RA0 xx0x 0000 uu0u 0000
(1) LATA6(1)
LATA LATA7 — LATA Data Output Register xx-x xxxx uu-u uuuu
TRISA TRISA7(1) TRISA6(1) — PORTA Data Direction Register 11-1 1111 11-1 1111
ADCON1 — PCFG6 PCFG5 PCFG4 PCFG3 PCFG2 PCFG1 PCFG0 -000 0000 -000 0000
Legend: x = unknown, u = unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by PORTA.
Note 1: RA7:RA6 and their associated latch and data direction bits are enabled as I/O pins based on oscillator
configuration; otherwise, they are read as ‘0’.
2: RA5 is an input only if MCLR is disabled.
EUSART Enable
TX/CK Data 1
TX/CK TRIS
VDD
RBPU(2) Weak
Analog Input Mode P Pull-up
Data Latch
Data Bus
D Q
WR TRISB
CK
TTL
RD TRISB Input
Buffer
RD LATB
Q D
RD PORTB
EN
RD PORTB
Schmitt
Trigger
Input
Buffer
INT1/CK Input
Analog Input
Mode
To A/D Converter
VDD
RBPU(2)
P Weak
Pull-up
P1B Enable
P1B Data
P1B/D Tri-State 1
Auto-Shutdown
Data Latch
Data Bus
D Q
WR LATB or RB2 pin(1)
PORTB
CK
TRIS Latch
D Q
TTL
WR TRISB Input
CK Buffer
RD TRISB
RD LATB
Q D
RD PORTB
EN
Schmitt
INT2 Input Trigger RD PORTB
P
0
RD LATB
Data Bus
D Q
WR LATB or
RB3 pin
PORTB Q
CK
Data Latch N
D Q
VSS
WR TRISB
CK Q
RD TRISB
Q D
EN
RD PORTB
ECCP1 Input
Schmitt
Trigger
EUSART Enabled
VDD
RBPU(2)
Analog Input Mode
P Weak
Pull-up
DT TRIS
DT Data
1
0
RD LATB
Data Bus D Q
WR LATB or RB4 pin
PORTB Q
CK
Data Latch
D Q
WR TRISB Q
CK
TRIS Latch
TTL
Input
RD TRISB Buffer
Q D
RD PORTB EN Q1
Set RBIF
From other Q D
RB7:RB4 pins RD PORTB
EN
Q3
Schmitt
Trigger
RX/DT Input
Analog Input
To A/D Converter Mode
VDD
RBPU(2) Weak
P Pull-up
Data Latch
Data Bus
D Q
WR LATB I/O pin(1)
or PORTB
CK
TRIS Latch
D Q
WR TRISB TTL
CK Input
Buffer ST
Buffer
RD TRISB
RD LATB
Latch
Q D
RD PORTB
EN Q1
Set RBIF
Q D
RD PORTB
From other
RB7:RB5 and EN
Q3
RB4 pins
0
RD LATB
Data Bus
D Q
WR LATB or
PORTB RB6 pin
CK Q
Data Latch
D Q
WR TRISB Q
CK Timer1
Oscillator
TRIS Latch
Q D
RD PORTB EN Q1
Set RBIF
From other Q D
RB7:RB4 pins RD PORTB
EN
Q3
PGC
T13CKI
P1D Data
1 To RB6 pin
0
RD LATB
Data Bus
D Q
WR LATB or RB7 pin
PORTB Q
CK
Data Latch
D Q
WR TRISB Q
CK
TRIS Latch
TTL
T1OSCEN RD TRISB Input Schmitt
Buffer Trigger
Q D
RD PORTB EN Q1
Set RBIF
From other Q D
RB7:RB4 pins RD PORTB
EN
Q3
PGD
RB0/AN4/INT0 bit 0 TTL(1)/ST(2) Input/output port pin, analog input or external interrupt
input 0.
RB1/AN5/TX/CK/INT1 bit 1 TTL(1)/ST(2) Input/output port pin, analog input, Enhanced USART
Asynchronous Transmit, Addressable USART
Synchronous Clock or external interrupt input 1.
RB2/P1B/INT2 bit 2 TTL(1)/ST(2) Input/output port pin or external interrupt input 2.
Internal software programmable weak pull-up.
RB3/CCP1/P1A bit 3 TTL(1)/ST(3) Input/output port pin or Capture1 input/Compare1 output/
PWM output. Internal software programmable weak pull-up.
RB4/AN6/RX/DT/KBI0 bit 4 TTL(1)/ST(4) Input/output port pin (with interrupt-on-change), analog input,
Enhanced USART Asynchronous Receive or Addressable
USART Synchronous Data.
RB5/PGM/KBI1 bit 5 TTL(1)/ST(5) Input/output port pin (with interrupt-on-change).
Internal software programmable weak pull-up.
Low-Voltage ICSP enable pin.
RB6/PGC/T1OSO/T13CKI/ bit 6 TTL(1)/ST(5,6) Input/output port pin (with interrupt-on-change), Timer1/
P1C/KBI2 Timer3 clock input or Timer1oscillator output.
Internal software programmable weak pull-up.
Serial programming clock.
RB7/PGD/T1OSI/P1D/KBI3 bit 7 TTL(1)/ST(5) Input/output port pin (with interrupt-on-change) or Timer1
oscillator input. Internal software programmable weak pull-up.
Serial programming data.
Legend: TTL = TTL input, ST = Schmitt Trigger input
Note 1: This buffer is a TTL input when configured as a port input pin.
2: This buffer is a Schmitt Trigger input when configured as the external interrupt.
3: This buffer is a Schmitt Trigger input when configured as the CCP1 input.
4: This buffer is a Schmitt Trigger input when used as EUSART receive input.
5: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
6: This buffer is a TTL input when used as the T13CKI input.
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
Data Bus
RA4/T0CKI FOSC/4 0
pin 8
1
Sync with
1 Internal TMR0
Clocks
Programmable 0
Prescaler
T0SE (2 TCY Delay)
3 PSA
Set Interrupt
T0PS2, T0PS1, T0PS0 Flag bit TMR0IF
T0CS on Overflow
Note: Upon Reset, Timer0 is enabled in 8-bit mode with clock input from T0CKI maximum prescale.
RA4/T0CKI FOSC/4 0
pin
1 Sync with
TMR0 Set Interrupt
1 Internal TMR0L Flag bit TMR0IF
Clocks High Byte
Programmable 0 on Overflow
Prescaler 8
T0SE (2 TCY Delay)
3
Read TMR0L
T0PS2, T0PS1, T0PS0
T0CS Write TMR0L
PSA
8
8
TMR0H
Data Bus<7:0>
Note: Upon Reset, Timer0 is enabled in 8-bit mode with clock input from T0CKI maximum prescale.
TMR0L Timer0 Module Low Byte Register xxxx xxxx uuuu uuuu
TMR0H Timer0 Module High Byte Register 0000 0000 0000 0000
INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u
T0CON TMR0ON T08BIT T0CS T0SE PSA T0PS2 T0PS1 T0PS0 1111 1111 1111 1111
TRISA RA7(1) RA6(1) — PORTA Data Direction Register 11-1 1111 11-1 1111
Legend: x = unknown, u = unchanged, – = unimplemented locations read as ‘0’. Shaded cells are not used by Timer0.
Note 1: RA6 and RA7 are enabled as I/O pins, depending on the oscillator mode selected in Configuration Word 1H.
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
Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off. This eliminates
power drain.
TMR1H
8
8
Write TMR1L
CCP Special Event Trigger
Read TMR1L
Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off. This eliminates power drain.
RA4 C2
12.6 Timer1 16-Bit Read/Write Mode
OSC1
X1 Timer1 can be configured for 16-bit reads and writes
MCLR OSC2 C3
(see Figure 12-2). When the RD16 control bit
(T1CON<7>) is set, the address for TMR1H is mapped
to a buffer register for the high byte of Timer1. A read
VSS VDD C1
from TMR1L will load the contents of the high byte of
Timer1 into the Timer1 high byte buffer. This provides
the user with the ability to accurately read all 16 bits of
RA2 RB7 C4 Timer1 without having to determine whether a read of
X2
RA3 RB6 C5 the high byte, followed by a read of the low byte, is
valid, due to a rollover between reads.
A write to the high byte of Timer1 must also take place
RB0 RB5
through the TMR1H Buffer register. Timer1 high byte is
updated with the contents of TMR1H when a write
Note: Not drawn to scale. occurs to TMR1L. This allows a user to write all 16 bits
to both the high and low bytes of Timer1 at once.
The high byte of Timer1 is not directly readable or
12.4 Timer1 Interrupt writable in this mode. All reads and writes must take
The TMR1 register pair (TMR1H:TMR1L) increments place through the Timer1 High Byte Buffer register.
from 0000h to FFFFh and rolls over to 0000h. The Writes to TMR1H do not clear the Timer1 prescaler.
Timer1 interrupt, if enabled, is generated on overflow, The prescaler is only cleared on writes to TMR1L.
which is latched in interrupt flag bit, TMR1IF
(PIR1<0>). This interrupt can be enabled/disabled by
setting/clearing Timer1 Interrupt Enable bit, TMR1IE
(PIE1<0>).
INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u
PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000
PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000
IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111
TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
T1CON RD16 T1RUN T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 0000 0000 u0uu uuuu
Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used by the Timer1 module.
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
Sets Flag
TMR2
Output(1) bit TMR2IF
Prescaler Reset
FOSC/4 TMR2
1:1, 1:4, 1:16
2 Postscaler
Comparator
EQ 1:1 to 1:16
T2CKPS1:T2CKPS0
PR2 4
TOUTPS3:TOUTPS0
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
T1OSC
T1OSO/
T13CKI 1
Synchronize
Prescaler
T1OSCEN FOSC/4 1, 2, 4, 8 det
Enable Internal 0
T1OSI Oscillator(1) Clock 2
TMR3CS Peripheral Clocks
T3CKPS1:T3CKPS0
Note 1: When enable bit, T1OSCEN, is cleared, the inverter and feedback resistor are turned off. This eliminates power drain.
TMR3H
8
8
Write TMR3L
Read TMR3L
CCP Special Event Trigger
8 T3CCPx Synchronized
Set TMR3IF Flag bit TMR3 0
on Overflow Timer3 CLR Clock Input
High Byte TMR3L
1
To Timer1 Clock Input TMR3ON
On/Off T3SYNC
T1OSC
T1OSO/
T13CKI 1
Synchronize
Prescaler
T1OSCEN FOSC/4 1, 2, 4, 8 det
Enable Internal 0
T1OSI Oscillator(1) Clock 2 Peripheral
T3CKPS1:T3CKPS0 Clocks
TMR3CS
Note 1: When the T1OSCEN bit is cleared, the inverter and feedback resistor are turned off. This eliminates power drain.
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
TMR3H TMR3L
Set Flag bit CCP1IF
T3CCP1 TMR3
Prescaler
Enable
÷ 1, 4, 16
CCP1 pin CCPR1H CCPR1L
TMR1
and T3CCP1 Enable
Edge Detect
TMR1H TMR1L
CCP1CON<3:0>
Q’s
Q S Output
Logic Comparator
RB3/CCP1/P1A pin R Match
TRISB<3>
Output Enable CCP1CON<3:0> T3CCP1 0 1
Mode Select
TABLE 15-3: REGISTERS ASSOCIATED WITH CAPTURE, COMPARE, TIMER1 AND TIMER3
Value on
Value on
Name Bit 7 Bit 6 Bit 5 Bit 4 Bit 3 Bit 2 Bit 1 Bit 0 all other
POR, BOR
Resets
INTCON GIE/GIEH PEIE/GIEL TMR0IE INT0IE RBIE TMR0IF INT0IF RBIF 0000 000x 0000 000u
PIR1 — ADIF RCIF TXIF — CCP1IF TMR2IF TMR1IF -000 -000 -000 -000
PIE1 — ADIE RCIE TXIE — CCP1IE TMR2IE TMR1IE -000 -000 -000 -000
IPR1 — ADIP RCIP TXIP — CCP1IP TMR2IP TMR1IP -111 -111 -111 -111
TRISB PORTB Data Direction Register 1111 1111 1111 1111
TMR1L Holding Register for the Least Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
TMR1H Holding Register for the Most Significant Byte of the 16-bit TMR1 Register xxxx xxxx uuuu uuuu
T1CON RD16 T1RUN T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON 0000 0000 uuuu uuuu
CCPR1L Capture/Compare/PWM Register 1 (LSB) xxxx xxxx uuuu uuuu
CCPR1H Capture/Compare/PWM Register 1 (MSB) xxxx xxxx uuuu uuuu
CCP1CON P1M1 P1M0 DC1B1 DC1B0 CCP1M3 CCP1M2 CCP1M1 CCP1M0 0000 0000 0000 0000
TMR3L Holding Register for the Least Significant Byte of the 16-bit TMR3 Register xxxx xxxx uuuu uuuu
TMR3H Holding Register for the Most Significant Byte of the 16-bit TMR3 Register xxxx xxxx uuuu uuuu
T3CON RD16 — T3CKPS1 T3CKPS0 T3CCP1 T3SYNC TMR3CS TMR3ON 0-00 0000 u-uu uuuu
ADCON0 VCFG1 VCFG0 — CHS2 CHS1 CHS0 GO/DONE ADON 00-0 0000 00-0 0000
Legend: x = unknown, u = unchanged, – = unimplemented, read as ‘0’. Shaded cells are not used by Capture and Timer1.
TRISB<3>
CCPR1H (Slave)
P1B RB2/P1B/INT2
Output TRISB<2>
Comparator R Q
Controller
RB6/PGC/T1OSO/T13CKI/
P1C
P1C/KBI2
TMR2 (Note 1)
S TRISB<6>
P1D RB7/PGD/T1OSI/P1D/KBI3
Comparator
Clear Timer, TRISB<7>
set CCP1 pin and
latch D.C.
PR2 CCP1DEL
Note: The 8-bit TMR2 register is concatenated with the 2-bit internal Q clock, or 2 bits of the prescaler to create the
10-bit time base.
P1A Active
P1D Modulated
P1A Inactive
P1D Inactive
P1A Modulated
Delay(1) Delay(1)
10 (Half-Bridge) P1B Modulated
P1A Active
P1D Modulated
P1A Inactive
P1D Inactive
Relationships:
• Period = 4 * TOSC * (PR2 + 1) * (TMR2 Prescale Value)
• Duty Cycle = TOSC * (CCPR1L<7:0>:CCP1CON<5:4>) * (TMR2 Prescale Value)
• Delay = 4 * TOSC * (PWM1CON<6:0>)
Note 1: Dead-band delay is programmed using the PWM1CON register (Section 15.5.6 “Programmable Dead-Band
Delay”).
PIC18F1220/1320 FET
Driver +
P1A V
-
Load
FET
Driver
+
P1B V
-
V+
PIC18F1220/1320
FET FET
Driver Driver
P1A
Load
FET FET
Driver Driver
P1B
V-
Forward Mode
Period
P1A
Duty Cycle
P1B
P1C
P1D
(1) (1)
Reverse Mode
Period
Duty Cycle
P1A
P1B
P1C
P1D
(1) (1)
Note 1: At this time, the TMR2 register is equal to the PR2 register.
Load
P1B
FET FET
Driver Driver
P1C
QB QD
V-
P1D
15.5.5.1 Direction Change in Full-Bridge Mode Figure 15-11 shows an example where the PWM direc-
tion changes from forward to reverse, at a near 100%
In the Full-Bridge Output mode, the P1M1 bit in the
duty cycle. At time t1, the output P1A and P1D become
CCP1CON register allows the user to control the
inactive, while output P1C becomes active. In this
Forward/Reverse direction. When the application
example, since the turn-off time of the power devices is
firmware changes this direction control bit, the module
longer than the turn-on time, a shoot-through current
will assume the new direction on the next PWM cycle.
may flow through power devices QC and QD (see
Just before the end of the current PWM period, the Figure 15-9) for the duration of ‘t’. The same phenom-
modulated outputs (P1B and P1D) are placed in their enon will occur to power devices QA and QB for PWM
inactive state, while the unmodulated outputs (P1A and direction change from reverse to forward.
P1C) are switched to drive in the opposite direction.
If changing PWM direction at high duty cycle is required
This occurs in a time interval of (4 TOSC * (Timer2
for an application, one of the following requirements
Prescale Value) before the next PWM period begins.
must be met:
The Timer2 prescaler will be either 1,4 or 16, depend-
ing on the value of the T2CKPS bit (T2CON<1:0>). 1. Reduce PWM for a PWM period before
During the interval from the switch of the unmodulated changing directions.
outputs to the beginning of the next period, the 2. Use switch drivers that can drive the switches off
modulated outputs (P1B and P1D) remain inactive. faster than they can drive them on.
This relationship is shown in Figure 15-10.
Other options to prevent shoot-through current may
Note that in the Full-Bridge Output mode, the ECCP exist.
module does not provide any dead-band delay. In
general, since only one output is modulated at all times,
dead-band delay is not required. However, there is a
situation where a dead-band delay might be required.
This situation occurs when both of the following
conditions are true:
1. The direction of the PWM output changes when
the duty cycle of the output is at or near 100%.
2. The turn-off time of the power switch, including
the power device and driver circuit, is greater
than the turn-on time.
P1A
P1B
DC
P1C
DC
Note 1: The direction bit in the CCP1 Control register (CCP1CON<7>) is written any time during the PWM cycle.
2: When changing directions, the P1A and P1C toggle one Timer2 count before the end of the current PWM cycle.
The modulated P1B and P1D signals are inactive at this time.
FIGURE 15-11: PWM DIRECTION CHANGE AT NEAR 100% DUTY CYCLE (ACTIVE-HIGH)
P1A
P1B DC
P1C
P1D DC
tON
External Switch C
tOFF
External Switch D
Note 1: tON is the turn-on delay of power switch QC and its driver.
2: tOFF is the turn-off delay of power switch QD and its driver.
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
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
PWM Activity
Dead Time Dead Time Dead Time
Shutdown Event
ECCPASE bit
PWM Activity
Dead Time Dead Time Dead Time
Shutdown Event
ECCPASE bit
ECCPASE
Cleared by Firmware
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
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
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
0.3 — — — — — — — — — — — —
1.2 — — — 1.221 1.73 255 1.202 0.16 129 1201 -0.16 103
2.4 2.441 1.73 255 2.404 0.16 129 2.404 0.16 64 2403 -0.16 51
9.6 9.615 0.16 64 9.766 1.73 31 9.766 1.73 15 9615 -0.16 12
19.2 19.531 1.73 31 19.531 1.73 15 19.531 1.73 7 — — —
57.6 56.818 -1.36 10 62.500 8.51 4 52.083 -9.58 2 — — —
115.2 125.000 8.51 4 104.167 -9.58 2 78.125 -32.18 1 — — —
SYNC = 0, BRGH = 0, BRG16 = 0
BAUD FOSC = 4.000 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz
RATE
(K) Actual SPBRG Actual SPBRG Actual SPBRG
% % %
Rate value Rate value Rate value
Error Error Error
(K) (decimal) (K) (decimal) (K) (decimal)
0.3 0.300 0.00 8332 0.300 0.02 4165 0.300 0.02 2082 300 -0.04 1665
1.2 1.200 0.02 2082 1.200 -0.03 1041 1.200 -0.03 520 1201 -0.16 415
2.4 2.402 0.06 1040 2.399 -0.03 520 2.404 0.16 259 2403 -0.16 207
9.6 9.615 0.16 259 9.615 0.16 129 9.615 0.16 64 9615 -0.16 51
19.2 19.231 0.16 129 19.231 0.16 64 19.531 1.73 31 19230 -0.16 25
57.6 58.140 0.94 42 56.818 -1.36 21 56.818 -1.36 10 55555 3.55 8
115.2 113.636 -1.36 21 113.636 -1.36 10 125.000 8.51 4 — — —
SYNC = 0, BRGH = 0, BRG16 = 1
BAUD FOSC = 4.000 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz
RATE
(K) Actual SPBRG Actual SPBRG Actual SPBRG
% % %
Rate value Rate value Rate value
Error Error Error
(K) (decimal) (K) (decimal) (K) (decimal)
0.3 0.300 0.04 832 300 -0.16 415 300 -0.16 207
1.2 1.202 0.16 207 1201 -0.16 103 1201 -0.16 51
2.4 2.404 0.16 103 2403 -0.16 51 2403 -0.16 25
9.6 9.615 0.16 25 9615 -0.16 12 — — —
19.2 19.231 0.16 12 — — — — — —
57.6 62.500 8.51 3 — — — — — —
115.2 125.000 8.51 1 — — — — — —
0.3 0.300 0.00 33332 0.300 0.00 16665 0.300 0.00 8332 300 -0.01 6665
1.2 1.200 0.00 8332 1.200 0.02 4165 1.200 0.02 2082 1200 -0.04 1665
2.4 2.400 0.02 4165 2.400 0.02 2082 2.402 0.06 1040 2400 -0.04 832
9.6 9.606 0.06 1040 9.596 -0.03 520 9.615 0.16 259 9615 -0.16 207
19.2 19.193 -0.03 520 19.231 0.16 259 19.231 0.16 129 19230 -0.16 103
57.6 57.803 0.35 172 57.471 -0.22 86 58.140 0.94 42 57142 0.79 34
115.2 114.943 -0.22 86 116.279 0.94 42 113.636 -1.36 21 117647 -2.12 16
SYNC = 0, BRGH = 1, BRG16 = 1 or SYNC = 1, BRG16 = 1
BAUD
FOSC = 4.000 MHz FOSC = 2.000 MHz FOSC = 1.000 MHz
RATE
(K) Actual SPBRG Actual SPBRG Actual SPBRG
% % %
Rate value Rate value Rate value
Error Error Error
(K) (decimal) (K) (decimal) (K) (decimal)
0.3 0.300 0.01 3332 300 -0.04 1665 300 -0.04 832
1.2 1.200 0.04 832 1201 -0.16 415 1201 -0.16 207
2.4 2.404 0.16 415 2403 -0.16 207 2403 -0.16 103
9.6 9.615 0.16 103 9615 -0.16 51 9615 -0.16 25
19.2 19.231 0.16 51 19230 -0.16 25 19230 -0.16 12
57.6 58.824 2.12 16 55555 3.55 8 — — —
115.2 111.111 -3.55 8 — — — — — —
Once the ABDEN bit is set, the state machine will clear 1. Configure the EUSART for asynchronous receive.
the BRG and look for a Start bit. The Auto-Baud Detect TXEN should remain clear. SPBRGH:SPBRG
must receive a byte with the value 55h (ASCII “U”, may be left as is. The controller should operate in
which is also the LIN bus Sync character), in order to either PRI_RUN or PRI_IDLE.
calculate the proper bit rate. The measurement is taken 2. Enable RXIF interrupts. Set RCIE, PEIE, GIE.
over both a low and a high bit time in order to minimize 3. Enable Auto-Baud Rate Detect. Set ABDEN.
any effects caused by asymmetry of the incoming sig- 4. When the next RCIF interrupt occurs, the
nal. After a Start bit, the SPBRG begins counting up received baud rate has been measured. Read
using the preselected clock source on the first rising RCREG to clear RCIF and discard. Check
edge of RX. After eight bits on the RX pin, or the fifth SPBRGH:SPBRG for a valid value. The
rising edge, an accumulated value totalling the proper EUSART is ready for normal communications.
BRG period is left in the SPBRGH:SPBRG registers. Return from the interrupt. Allow the primary
Once the 5th edge is seen (should correspond to the clock to run (PRI_RUN or PRI_IDLE).
Stop bit), the ABDEN bit is automatically cleared. 5. Process subsequent RCIF interrupts normally
While calibrating the baud rate period, the BRG as in asynchronous reception. Remain in
registers are clocked at 1/8th the preconfigured clock PRI_RUN or PRI_IDLE until communications
rate. Note that the BRG clock will be configured by the are complete.
BRG16 and BRGH bits. Independent of the BRG16 bit
setting, both the SPBRG and SPBRGH will be used as TABLE 16-4: BRG COUNTER CLOCK
a 16-bit counter. This allows the user to verify that no RATES
carry occurred for 8-bit modes, by checking for 00h in
the SPBRGH register. Refer to Table 16-4 for counter BRG16 BRGH BRG Counter Clock
clock rates to the BRG. 0 0 FOSC/512
While the ABD sequence takes place, the EUSART 0 1 FOSC/128
state machine is held in Idle. The RCIF interrupt is set 1 0 FOSC/128
once the fifth rising edge on RX is detected. The value
in the RCREG needs to be read to clear the RCIF 1 1 FOSC/32
interrupt. RCREG content should be discarded. Note: During the ABD sequence, SPBRG and
SPBRGH are both used as a 16-bit counter,
independent of BRG16 setting.
BRG Clock
RCIF bit
(Interrupt)
Read
RCREG
Note 1: The ABD sequence requires the EUSART module to be configured in Asynchronous mode and WUE = 0.
Data Bus
TRMT SPEN
BRG16 SPBRGH SPBRG
TX9
Baud Rate Generator
TX9D
Write to TXREG
Word 1
BRG Output
(Shift Clock)
RB1/AN5/TX/
CK/INT1 (pin) Start bit bit 0 bit 1 bit 7/8 Stop bit
Word 1
TXIF bit
(Transmit Buffer 1 TCY
Reg. Empty Flag)
Word 1
TRMT bit Transmit Shift Reg
(Transmit Shift
Reg. Empty Flag)
Write to TXREG
Word 1 Word 2
BRG Output
(Shift Clock)
RB1/AN5/TX/
CK/INT1 (pin) Start bit bit 0 bit 1 bit 7/8 Stop bit Start bit bit 0
TXIF bit 1 TCY Word 1 Word 2
(Interrupt Reg. Flag)
1 TCY
TRMT bit Word 1 Word 2
(Transmit Shift Transmit Shift Reg.
Reg. Empty Flag) Transmit Shift Reg.
RX9
RB4/AN6/RX/DT/KBI0
Pin Buffer Data
and Control Recovery
RX9D RCREG Register
FIFO
SPEN
8
RCIF
(Interrupt Flag)
OERR bit
CREN
Note: This timing diagram shows three words appearing on the RX input. The RCREG (receive buffer) is read after
the third word, causing the OERR (overrun) bit to be set.
RX/DT Line
RCIF
Cleared due to User Read of RCREG
Note 1: The EUSART remains in Idle while the WUE bit is set.
Note 1: If the wake-up event requires a long oscillator warm-up time, the WUE bit may be cleared while the primary clock is still starting.
2: The EUSART remains in Idle while the WUE bit is set.
Write to TXREG
Dummy Write
BRG Output
(Shift Clock)
Break
TXIF bit
TRMT bit
SENDB
RB4/AN6/RX/
DT/KBI0 pin bit 0 bit 1 bit 2 bit 7 bit 0 bit 1 bit 7
Word 1 Word 2
RB1/AN5/TX/
CK/INT1 pin
(SCKP = 0)
RB1/AN5/TX/
CK/INT1 pin
(SCKP = 1)
Write to
TXREG Reg Write Word 1 Write Word 2
TXIF bit
(Interrupt Flag)
TRMT bit
‘1’ ‘1’
TXEN bit
Note: Sync Master mode, SPBRG = 0, continuous transmission of two 8-bit words.
RB1/AN5/TX/CK/INT1 pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
RB4/AN6/RX/
DT/KBI0 pin bit 0 bit 1 bit 2 bit 3 bit 4 bit 5 bit 6 bit 7
RB1/AN5/TX/
CK/INT1 pin
(SCKP = 0)
RB1/AN5/TX/
CK/INT1 pin
(SCKP = 1)
Write to
bit SREN
SREN bit
RCIF bit
(Interrupt)
Read
RXREG
Note: Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRGH = 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
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
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
AVDD
CHS2:CHS0
111
110
AN6(1)
101
AN5
100
AN4
VAIN
(Input Voltage) 011
10-bit AN3/VREF+
Converter
A/D 010
AN2/VREF-
001
VCFG1:VCFG0 AN1
AVDD 000
AN0
x0
VREFH x1
Reference 1x
Voltage VREFL 0x
AVSS
VDD
Sampling
Switch
VT = 0.6V
Rs
ANx RIC ≤ 1k SS RSS
VSS
Conversion Starts
Holding capacitor is disconnected from analog input (typically 100 ns)
Set GO bit
FIGURE 17-4: A/D CONVERSION TAD CYCLES (ACQT<2:0> = 010, TACQ = 4 TAD)
1 2 3 4 1 2 3 4 5 6 7 8 9 10 11
b9 b8 b7 b6 b5 b4 b3 b2 b1 b0
Automatic
Acquisition Conversion Starts
Time (Holding capacitor is disconnected)
Set GO bit
(Holding capacitor continues
acquiring input) Next Q4: ADRESH:ADRESL is loaded, GO bit is cleared,
ADIF bit is set, holding capacitor is reconnected to analog input.
VA
VB
Voltage
TA TB
Time
16-to-1 MUX
LVDIF
The LVD module has an additional feature that allows LVDIN (Figure 18-3). This gives users flexibility,
the user to supply the trip voltage to the module from because it allows them to configure the Low-Voltage
an external source. This mode is enabled when bits, Detect interrupt to occur at any voltage in the valid
LVDL3:LVDL0, are set to ‘1111’. In this state, the com- operating range.
parator input is multiplexed from the external input pin,
FIGURE 18-3: LOW-VOLTAGE DETECT (LVD) WITH EXTERNAL INPUT BLOCK DIAGRAM
VDD
VDD
LVD Control
Register
16-to-1 MUX
LVDIN LVDEN
Externally Generated
Trip Point
LVD
VxEN
BODEN
EN
BGAP
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
VDD
VLVD
LVDIF
Enable LVD
CASE 2:
VDD
VLVD
LVDIF
Enable LVD
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Readable bit C = Clearable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Note: The Timer1 oscillator shares the T1OSI and T1OSO pins with the PGD and PGC
pins used for programming and debugging.
When using the Timer1 oscillator, In-Circuit Serial Programming (ICSP) may not
function correctly (high voltage or low voltage), or the In-Circuit Debugger (ICD) may
not communicate with the controller. As a result of using either ICSP or ICD, the
Timer1 crystal may be damaged.
If ICSP or ICD operations are required, the crystal should be disconnected from the
circuit (disconnect either lead) or installed after programming. The oscillator loading
capacitors may remain in-circuit during ICSP or ICD operation.
Legend:
R = Readable bit C = Clearable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Readable bit C = Clearable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Readable bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Read-only bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
Legend:
R = Read-only bit P = Programmable bit U = Unimplemented bit, read as ‘0’
-n = Value when device is unprogrammed u = Unchanged from programmed state
CLRWDT
Programmable Postscaler Reset WDT
All Device Reset
Resets 1:1 to 1:32,768
WDT
WDTPS<3:0> 4
Sleep
Legend:
R = Readable bit W = Writable bit -n = Value at POR
U = Unimplemented bit, read as ‘0’
19.3 Two-Speed Start-up In all other power managed modes, Two-Speed Start-up
is not used. The device will be clocked by the currently
The Two-Speed Start-up feature helps to minimize the selected clock source until the primary clock source
latency period from oscillator start-up to code execution becomes available. The setting of the IESO bit is
by allowing the microcontroller to use the INTRC oscil- ignored.
lator as a clock source until the primary clock source is
available. It is enabled by setting the IESO bit in 19.3.1 SPECIAL CONSIDERATIONS FOR
Configuration Register 1H (CONFIG1H<7>). USING TWO-SPEED START-UP
Two-Speed Start-up is available only if the primary oscil- While using the INTRC oscillator in Two-Speed Start-
lator mode is LP, XT, HS or HSPLL (crystal-based up, the device still obeys the normal command
modes). Other sources do not require an OST start-up sequences for entering power managed modes, includ-
delay; for these, Two-Speed Start-up is disabled. ing serial SLEEP instructions (refer to Section 3.1.3
When enabled, Resets and wake-ups from Sleep mode “Multiple Sleep Commands”). In practice, this means
cause the device to configure itself to run from the that user code can change the SCS1:SCS0 bit settings
internal oscillator block as the clock source, following and issue SLEEP commands before the OST times out.
the time-out of the Power-up Timer after a Power-on This would allow an application to briefly wake-up, per-
Reset is enabled. This allows almost immediate code form routine “housekeeping” tasks and return to Sleep
execution while the primary oscillator starts and the before the device starts to operate from the primary
OST is running. Once the OST times out, the device oscillator.
automatically switches to PRI_RUN mode. User code can also check if the primary clock source is
Because the OSCCON register is cleared on Reset currently providing the system clocking by checking the
events, the INTOSC (or postscaler) clock source is not status of the OSTS bit (OSCCON<3>). If the bit is set,
initially available after a Reset event; the INTRC clock the primary oscillator is providing the system clock.
is used directly at its base frequency. To use a higher Otherwise, the internal oscillator block is providing the
clock speed on wake-up, the INTOSC or postscaler clock during wake-up from Reset or Sleep mode.
clock sources can be selected to provide a higher clock
speed by setting bits, IFRC2:IFRC0, immediately after
Reset. For wake-ups from Sleep, the INTOSC or
postscaler clock sources can be selected by setting
IFRC2:IFRC0 prior to entering Sleep mode.
INTOSC
Multiplexer
OSC1
TOST(1) TPLL(1)
PLL Clock
Output 1 2 3 4 5 6 7 8
Clock Transition
CPU Clock
Peripheral
Clock
Program PC PC + 2 PC + 4 PC + 6
Counter
Note 1: TOST = 1024 TOSC; TPLL = 2 ms (approx). These intervals are not shown to scale.
Sample Clock
System Oscillator
Clock Failure
Output
CM Output
(Q)
Failure
Detected
OSCFIF
Note: The system clock is normally at a much higher frequency than the sample clock. The relative frequencies in
this example have been chosen for clarity.
000000h 000000h
CPB, WRTB, EBTRB Boot Block Boot Block CPB, WRTB, EBTRB
0001FFh 0001FFh
000200h 000200h
CP0, WRT0, EBTR0 Block 0
0007FFh Block 0 CP0, WRT0, EBTR0
000800h
CP1, WRT1, EBTR1 Block 1
000FFFh 000FFFh
001000h 001000h
(Unimplemented Unimplemented
001FFFh
Memory Space) Read ‘0’s
002000h
Unimplemented (Unimplemented
Read ‘0’s Memory Space)
1FFFFFh 1FFFFFh
TBLPTR = 0002FFh
WRT0, EBTR0 = 01
PC = 0007FEh TBLWT *
000FFFh
001000h
PC = 0017FEh TBLWT *
WRT1, EBTR1 = 11
001FFFh
000000h
WRTB, EBTRB = 11
0001FFh
000200h
TBLPTR = 0002FFh
WRT0, EBTR0 = 10
000FFFh
001000h
001FFFh
Results: All table reads from external blocks to Blockn are disabled whenever EBTRn = 0.
TABLAT register returns a value of ‘0’.
PC = 0007FEh TBLRD *
000FFFh
001000h
WRT1, EBTR1 = 11
001FFFh
Literal operations
15 8 7 0
OPCODE k (literal) MOVLW 0x7F
k = 8-bit immediate value
Control operations
CALL, GOTO and Branch operations
15 8 7 0
OPCODE n<7:0> (literal) GOTO Label
15 12 11 0
1111 n<19:8> (literal)
15 8 7 0
OPCODE S n<7:0> (literal) CALL MYFUNC
15 12 11 0
n<19:8> (literal)
S = Fast bit
15 11 10 0
OPCODE n<10:0> (literal) BRA MYFUNC
15 8 7 0
OPCODE n<7:0> (literal) BC MYFUNC
CONTROL OPERATIONS
BC n Branch if Carry 1 (2) 1110 0010 nnnn nnnn None
BN n Branch if Negative 1 (2) 1110 0110 nnnn nnnn None
BNC n Branch if Not Carry 1 (2) 1110 0011 nnnn nnnn None
BNN n Branch if Not Negative 1 (2) 1110 0111 nnnn nnnn None
BNOV n Branch if Not Overflow 1 (2) 1110 0101 nnnn nnnn None
BNZ n Branch if Not Zero 1 (2) 1110 0001 nnnn nnnn None
BOV n Branch if Overflow 1 (2) 1110 0100 nnnn nnnn None
BRA n Branch Unconditionally 2 1101 0nnn nnnn nnnn None
BZ n Branch if Zero 1 (2) 1110 0000 nnnn nnnn None
CALL n, s Call subroutine 1st word 2 1110 110s kkkk kkkk None
2nd word 1111 kkkk kkkk kkkk
CLRWDT — Clear Watchdog Timer 1 0000 0000 0000 0100 TO, PD
DAW — Decimal Adjust WREG 1 0000 0000 0000 0111 C
GOTO n Go to address 1st word 2 1110 1111 kkkk kkkk None
2nd word 1111 kkkk kkkk kkkk
NOP — No Operation 1 0000 0000 0000 0000 None
NOP — No Operation 1 1111 xxxx xxxx xxxx None 4
POP — Pop top of return stack (TOS) 1 0000 0000 0000 0110 None
PUSH — Push top of return stack (TOS) 1 0000 0000 0000 0101 None
RCALL n Relative Call 2 1101 1nnn nnnn nnnn None
RESET Software device Reset 1 0000 0000 1111 1111 All
RETFIE s Return from interrupt enable 2 0000 0000 0001 000s GIE/GIEH,
PEIE/GIEL
RETLW k Return with literal in WREG 2 0000 1100 kkkk kkkk None
RETURN s Return from Subroutine 2 0000 0000 0001 001s None
SLEEP — Go into Standby mode 1 0000 0000 0000 0011 TO, PD
Note 1: When a Port register is modified as a function of itself (e.g., MOVF PORTB, 1, 0), the value used will be that
value present on the pins themselves. For example, if the data latch is ‘1’ for a pin configured as input and is
driven low by an external device, the data will be written back with a ‘0’.
2: If this instruction is executed on the TMR0 register (and where applicable, d = 1), the prescaler will be cleared
if assigned.
3: If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second
cycle is executed as a NOP.
4: Some instructions are 2-word instructions. The second word of these instructions will be executed as a NOP,
unless the first word of the instruction retrieves the information embedded in these 16 bits. This ensures that all
program memory locations have a valid instruction.
5: If the table write starts the write cycle to internal memory, the write will continue until terminated.
LITERAL OPERATIONS
ADDLW k Add literal and WREG 1 0000 1111 kkkk kkkk C, DC, Z, OV, N
ANDLW k AND literal with WREG 1 0000 1011 kkkk kkkk Z, N
IORLW k Inclusive OR literal with WREG 1 0000 1001 kkkk kkkk Z, N
LFSR f, k Move literal (12-bit) 2nd word 2 1110 1110 00ff kkkk None
to FSRx 1st word 1111 0000 kkkk kkkk
MOVLB k Move literal to BSR<3:0> 1 0000 0001 0000 kkkk None
MOVLW k Move literal to WREG 1 0000 1110 kkkk kkkk None
MULLW k Multiply literal with WREG 1 0000 1101 kkkk kkkk None
RETLW k Return with literal in WREG 2 0000 1100 kkkk kkkk None
SUBLW k Subtract WREG from literal 1 0000 1000 kkkk kkkk C, DC, Z, OV, N
XORLW k Exclusive OR literal with WREG 1 0000 1010 kkkk kkkk Z, N
DATA MEMORY ↔ PROGRAM MEMORY OPERATIONS
TBLRD* Table read 2 0000 0000 0000 1000 None
TBLRD*+ Table read with post-increment 0000 0000 0000 1001 None
TBLRD*- Table read with post-decrement 0000 0000 0000 1010 None
TBLRD+* Table read with pre-increment 0000 0000 0000 1011 None
TBLWT* Table write 2 (5) 0000 0000 0000 1100 None
TBLWT*+ Table write with post-increment 0000 0000 0000 1101 None
TBLWT*- Table write with post-decrement 0000 0000 0000 1110 None
TBLWT+* Table write with pre-increment 0000 0000 0000 1111 None
Note 1: When a Port register is modified as a function of itself (e.g., MOVF PORTB, 1, 0), the value used will be that
value present on the pins themselves. For example, if the data latch is ‘1’ for a pin configured as input and is
driven low by an external device, the data will be written back with a ‘0’.
2: If this instruction is executed on the TMR0 register (and where applicable, d = 1), the prescaler will be cleared
if assigned.
3: If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second
cycle is executed as a NOP.
4: Some instructions are 2-word instructions. The second word of these instructions will be executed as a NOP,
unless the first word of the instruction retrieves the information embedded in these 16 bits. This ensures that all
program memory locations have a valid instruction.
5: If the table write starts the write cycle to internal memory, the write will continue until terminated.
Cycles: 1 Words: 1
Cycles: 2 Words: 1
BTFSC Bit Test File, Skip if Clear BTFSS Bit Test File, Skip if Set
Syntax: [ label ] BTFSC f,b[,a] Syntax: [ label ] BTFSS f,b[,a]
Operands: 0 ≤ f ≤ 255 Operands: 0 ≤ f ≤ 255
0≤b≤7 0≤b<7
a ∈ [0,1] a ∈ [0,1]
Operation: skip if (f<b>) = 0 Operation: skip if (f<b>) = 1
Status Affected: None Status Affected: None
Encoding: 1011 bbba ffff ffff Encoding: 1010 bbba ffff ffff
Description: If bit ‘b’ in register ‘f’ is ‘0’, then the Description: If bit ‘b’ in register ‘f’ is ‘1’, then the
next instruction is skipped. next instruction is skipped.
If bit ‘b’ is ‘0’, then the next If bit ‘b’ is ‘1’, then the next
instruction fetched during the current instruction fetched during the current
instruction execution is discarded instruction execution is discarded
and a NOP is executed instead, and a NOP is executed instead,
making this a two-cycle instruction. If making this a two-cycle instruction. If
‘a’ is ‘0’, the Access Bank will be ‘a’ is ‘0’, the Access Bank will be
selected, overriding the BSR value. If selected, overriding the BSR value. If
‘a’ = 1, then the bank will be selected ‘a’ = 1, then the bank will be selected
as per the BSR value (default). as per the BSR value (default).
Words: 1 Words: 1
Cycles: 1(2) Cycles: 1(2)
Note: 3 cycles if skip and followed Note: 3 cycles if skip and followed
by a 2-word instruction. by a 2-word instruction.
Q Cycle Activity: Q Cycle Activity:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Decode Read Process No Decode Read Process No
register ‘f’ Data operation register ‘f’ Data operation
If skip: If skip:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
No No No No No No No No
operation operation operation operation operation operation operation operation
If skip and followed by 2-word instruction: If skip and followed by 2-word instruction:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
No No No No No No No No
operation operation operation operation operation operation operation operation
No No No No No No No No
operation operation operation operation operation operation operation operation
Cycles: 1 Words: 1
Description: Clears the contents of the specified Encoding: 0000 0000 0000 0100
register. If ‘a’ is ‘0’, the Access Description: CLRWDT instruction resets the
Bank will be selected, overriding Watchdog Timer. It also resets the
the BSR value. If ‘a’ = 1, then the postscaler of the WDT. Status bits,
bank will be selected as per the TO and PD, are set.
BSR value (default). Words: 1
Words: 1 Cycles: 1
Cycles: 1 Q Cycle Activity:
Q Cycle Activity: Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4 Decode No Process No
Decode Read Process Write operation Data operation
register ‘f’ Data register ‘f’
Example: CLRWDT
Example: CLRF FLAG_REG
Before Instruction
Before Instruction WDT Counter = ?
FLAG_REG = 0x5A After Instruction
After Instruction WDT Counter = 0x00
FLAG_REG = 0x00 WDT Postscaler = 0
TO = 1
PD = 1
Description: The contents of register ‘f’ are Encoding: 0110 001a ffff ffff
complemented. If ‘d’ is ‘0’, the Description: Compares the contents of data
result is stored in W. If ‘d’ is ‘1’, the memory location ‘f’ to the contents
result is stored back in register ‘f’ of W by performing an unsigned
(default). If ‘a’ is ‘0’, the Access subtraction.
Bank will be selected, overriding If ‘f’ = W, then the fetched
the BSR value. If ‘a’ = 1, then the instruction is discarded and a NOP
bank will be selected as per the is executed instead, making this a
BSR value (default). two-cycle instruction. If ‘a’ is ‘0’, the
Words: 1 Access Bank will be selected,
overriding the BSR value. If ‘a’ = 1,
Cycles: 1 then the bank will be selected as
Q Cycle Activity: per the BSR value (default).
Q1 Q2 Q3 Q4 Words: 1
Decode Read Process Write to Cycles: 1(2)
register ‘f’ Data destination
Note: 3 cycles if skip and followed
Example: COMF REG, W by a 2-word instruction.
Before Instruction Q Cycle Activity:
REG = 0x13
Q1 Q2 Q3 Q4
After Instruction
Decode Read Process No
REG = 0x13
register ‘f’ Data operation
W = 0xEC
If skip:
Q1 Q2 Q3 Q4
No No No No
operation operation operation operation
If skip and followed by 2-word instruction:
Q1 Q2 Q3 Q4
No No No No
operation operation operation operation
No No No No
operation operation operation operation
CPFSGT Compare f with W, skip if f > W CPFSLT Compare f with W, skip if f < W
Syntax: [ label ] CPFSGT f [,a] Syntax: [ label ] CPFSLT f [,a]
Operands: 0 ≤ f ≤ 255 Operands: 0 ≤ f ≤ 255
a ∈ [0,1] a ∈ [0,1]
Operation: (f) – (W), Operation: (f) – (W),
skip if (f) > (W) skip if (f) < (W)
(unsigned comparison) (unsigned comparison)
Status Affected: None Status Affected: None
Encoding: 0110 010a ffff ffff Encoding: 0110 000a ffff ffff
Description: Compares the contents of data Description: Compares the contents of data
memory location ‘f’ to the contents memory location ‘f’ to the contents
of W by performing an unsigned of W by performing an unsigned
subtraction. subtraction.
If the contents of ‘f’ are greater than If the contents of ‘f’ are less than
the contents of WREG, then the the contents of W, then the fetched
fetched instruction is discarded and instruction is discarded and a NOP
a NOP is executed instead, making is executed instead, making this a
this a two-cycle instruction. If ‘a’ is two-cycle instruction. If ‘a’ is ‘0’, the
‘0’, the Access Bank will be Access Bank will be selected. If ‘a’
selected, overriding the BSR value. is ‘1’, the BSR will not be
If ‘a’ = 1, then the bank will be overridden (default).
selected as per the BSR value Words: 1
(default).
Cycles: 1(2)
Words: 1 Note: 3 cycles if skip and followed
Cycles: 1(2) by a 2-word instruction.
Note: 3 cycles if skip and followed Q Cycle Activity:
by a 2-word instruction.
Q1 Q2 Q3 Q4
Q Cycle Activity: Decode Read Process No
Q1 Q2 Q3 Q4 register ‘f’ Data operation
Decode Read Process No If skip:
register ‘f’ Data operation Q1 Q2 Q3 Q4
If skip: No No No No
Q1 Q2 Q3 Q4 operation operation operation operation
No No No No If skip and followed by 2-word instruction:
operation operation operation operation Q1 Q2 Q3 Q4
If skip and followed by 2-word instruction: No No No No
Q1 Q2 Q3 Q4 operation operation operation operation
No No No No No No No No
operation operation operation operation operation operation operation operation
No No No No
operation operation operation operation Example: HERE CPFSLT REG
NLESS :
Example: HERE CPFSGT REG LESS :
NGREATER : Before Instruction
GREATER : PC = Address (HERE)
Before Instruction W = ?
PC = Address (HERE) After Instruction
W = ? If REG < W;
After Instruction PC = Address (LESS)
If REG ≥ W;
If REG > W; PC = Address (NLESS)
PC = Address (GREATER)
If REG ≤ W;
PC = Address (NGREATER)
Description: The eight-bit literal ‘k’ is loaded Encoding: 0110 111a ffff ffff
into W. Description: Move data from W to register ‘f’.
Words: 1 Location ‘f’ can be anywhere in the
256-byte bank. If ‘a’ is ‘0’, the
Cycles: 1 Access Bank will be selected, over-
Q Cycle Activity: riding the BSR value. If ‘a’ = 1, then
Q1 Q2 Q3 Q4 the bank will be selected as per the
Decode Read Process Write to W
BSR value (default).
literal ‘k’ Data Words: 1
Cycles: 1
Example: MOVLW 0x5A
Q Cycle Activity:
After Instruction Q1 Q2 Q3 Q4
W = 0x5A Decode Read Process Write
register ‘f’ Data register ‘f’
Cycles: 1
Example:
Q Cycle Activity:
None.
Q1 Q2 Q3 Q4
Decode Read Process Write
register ‘f’ Data register ‘f’
POP Pop Top of Return Stack PUSH Push Top of Return Stack
Syntax: [ label ] POP Syntax: [ label ] PUSH
Operands: None Operands: None
Operation: (TOS) → bit bucket Operation: (PC + 2) → TOS
Status Affected: None Status Affected: None
Encoding: 0000 0000 0000 0110 Encoding: 0000 0000 0000 0101
Description: The TOS value is pulled off the Description: The PC + 2 is pushed onto the top
return stack and is discarded. The of the return stack. The previous
TOS value then becomes the TOS value is pushed down on the
previous value that was pushed stack.
onto the return stack. This instruction allows implement-
This instruction is provided to ing a software stack by modifying
enable the user to properly manage TOS and then pushing it onto the
the return stack to incorporate a return stack.
software stack. Words: 1
Words: 1 Cycles: 1
Cycles: 1 Q Cycle Activity:
Q Cycle Activity: Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4 Decode Push No No
Decode No Pop TOS No PC + 2 onto operation operation
operation value operation return stack
After Interrupt
PC = TOS Before Instruction
W = WS W = 0x07
BSR = BSRS
Status = STATUSS After Instruction
GIE/GIEH, PEIE/GIEL = 1
W = value of kn
RLNCF Rotate Left f (no carry) RRCF Rotate Right f through Carry
Syntax: [ label ] RLNCF f [,d [,a]] Syntax: [ label ] RRCF f [,d [,a]]
Operands: 0 ≤ f ≤ 255 Operands: 0 ≤ f ≤ 255
d ∈ [0,1] d ∈ [0,1]
a ∈ [0,1] a ∈ [0,1]
Operation: (f<n>) → dest<n + 1>, Operation: (f<n>) → dest<n – 1>,
(f<7>) → dest<0> (f<0>) → C,
Status Affected: N, Z (C) → dest<7>
Description: The contents of register ‘f’ are Encoding: 0011 00da ffff ffff
rotated one bit to the left. If ‘d’ is ‘0’, Description: The contents of register ‘f’ are
the result is placed in W. If ‘d’ is ‘1’, rotated one bit to the right through
the result is stored back in register the Carry flag. If ‘d’ is ‘0’, the result
‘f’ (default). If ‘a’ is ‘0’, the Access is placed in W. If ‘d’ is ‘1’, the result
Bank will be selected, overriding is placed back in register ‘f’
the BSR value. If ‘a’ is ‘1’, then the (default). If ‘a’ is ‘0’, the Access
bank will be selected as per the Bank will be selected, overriding
BSR value (default). the BSR value. If ‘a’ is ‘1’, then the
register f
bank will be selected as per the
BSR value (default).
Words: 1 C register f
Cycles: 1
Words: 1
Q Cycle Activity:
Q1 Q2 Q3 Q4 Cycles: 1
Decode Read Process Write to Q Cycle Activity:
register ‘f’ Data destination Q1 Q2 Q3 Q4
Decode Read Process Write to
Example: RLNCF REG register ‘f’ Data destination
Before Instruction
REG = 1010 1011 Example: RRCF REG, W
After Instruction Before Instruction
REG = 0101 0111 REG = 1110 0110
C = 0
After Instruction
REG = 1110 0110
W = 0111 0011
C = 0
Description: Subtract W and the Carry flag Encoding: 0011 10da ffff ffff
(borrow) from register ‘f’ (2’s comple- Description: The upper and lower nibbles of
ment method). If ‘d’ is ‘0’, the result is register ‘f’ are exchanged. If ‘d’ is
stored in W. If ‘d’ is ‘1’, the result is ‘0’, the result is placed in W. If ‘d’ is
stored back in register ‘f’ (default). If ‘1’, the result is placed in register ‘f’
‘a’ is ‘0’, the Access Bank will be (default). If ‘a’ is ‘0’, the Access
selected, overriding the BSR value. If Bank will be selected, overriding
‘a’ is ‘1’, then the bank will be the BSR value. If ‘a’ is ‘1’, then the
selected as per the BSR value bank will be selected as per the
(default). BSR value (default).
Words: 1 Words: 1
Cycles: 1 Cycles: 1
Q Cycle Activity: Q Cycle Activity:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
Decode Read Process Write to Decode Read Process Write to
register ‘f’ Data destination register ‘f’ Data destination
Example 1: SUBWFB REG, 1, 0 Example: SWAPF REG
Before Instruction Before Instruction
REG = 0x19 (0001 1001) REG = 0x53
W = 0x0D (0000 1101)
C = 0x01 After Instruction
After Instruction REG = 0x35
REG = 0x0C (0000 1011)
W = 0x0D (0000 1101)
C = 0x01
Z = 0x00
N = 0x00 ; result is positive
Example 2: SUBWFB REG, 0, 0
Before Instruction
REG = 0x1B (0001 1011)
W = 0x1A (0001 1010)
C = 0x00
After Instruction
REG = 0x1B (0001 1011)
W = 0x00
C = 0x01
Z = 0x01 ; result is zero
N = 0x00
Example 3: SUBWFB REG, 1, 0
Before Instruction
REG = 0x03 (0000 0011)
W = 0x0E (0000 1101)
C = 0x01
After Instruction
REG = 0xF5 (1111 0100)
; [2’s comp]
W = 0x0E (0000 1101)
C = 0x00
Z = 0x00
N = 0x01 ; result is negative
† 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 to maximum rating conditions for
extended periods may affect device reliability.
6.0V
5.5V
5.0V PIC18F1X20
4.5V
Voltage
4.2V
4.0V
3.5V
3.0V
2.5V
2.0V
40 MHz
Frequency
6.0V
5.5V
5.0V PIC18LF1X20
4.5V
Voltage
4.2V
4.0V
3.5V
3.0V
2.5V
2.0V
4 MHz 40 MHz
Frequency
FMAX = (16.36 MHz/V) (VDDAPPMIN – 2.0V) + 4 MHz
Note: VDDAPPMIN is the minimum voltage of the PIC® device in the application.
6.0V
5.5V
5.0V PIC18F1X20-E
4.5V
Voltage
4.2V
4.0V
3.5V
3.0V
2.5V
2.0V
25 MHz
Frequency
Param
Symbol Characteristic Min Typ Max Units Conditions
No.
VDD Supply Voltage
D001 PIC18LF1220/1320 2.0 — 5.5 V HS, XT, RC and LP Oscillator mode
PIC18F1220/1320 4.2 — 5.5 V
D002 VDR RAM Data Retention 1.5 — — V
Voltage(1)
D003 VPOR VDD Start Voltage to ensure — — 0.7 V See Section 4.1 “Power-on Reset (POR)”
internal Power-on Reset signal for details.
D004 SVDD VDD Rise Rate to ensure 0.05 — — V/ms See Section 4.1 “Power-on Reset (POR)”
internal Power-on Reset signal for details.
VBOR Brown-out Reset Voltage
D005D PIC18LF1220/1320 Industrial Low Voltage (-10°C to +85°C)
BORV1:BORV0 = 11 N/A N/A N/A V Reserved
BORV1:BORV0 = 10 2.50 2.72 2.94 V
BORV1:BORV0 = 01 3.88 4.22 4.56 V (Note 2)
BORV1:BORV0 = 00 4.18 4.54 4.90 V (Note 2)
D005F PIC18LF1220/1320 Industrial Low Voltage (-40°C to -10°C)
BORV1:BORV0 = 11 N/A N/A N/A V Reserved
BORV1:BORV0 = 10 2.34 2.72 3.10 V
BORV1:BORV0 = 01 3.63 4.22 4.81 V (Note 2)
BORV1:BORV0 = 00 3.90 4.54 5.18 V (Note 2)
D005G PIC18F1220/1320 Industrial (-10°C to +85°C)
BORV1:BORV0 = 1x N/A N/A N/A V Reserved
BORV1:BORV0 = 01 3.88 4.22 4.56 V (Note 2)
BORV1:BORV0 = 00 4.18 4.54 4.90 V (Note 2)
D005H PIC18F1220/1320 Industrial (-40°C to -10°C)
BORV1:BORV0 = 1x N/A N/A N/A V Reserved
BORV1:BORV0 = 01 N/A N/A N/A V Reserved
BORV1:BORV0 = 00 3.90 4.54 5.18 V (Note 2)
D005J PIC18F1220/1320 Extended (-10°C to +85°C)
BORV1:BORV0 = 1x N/A N/A N/A V Reserved
BORV1:BORV0 = 01 3.88 4.22 4.56 V (Note 3)
BORV1:BORV0 = 00 4.18 4.54 4.90 V (Note 3)
D005K PIC18F1220/1320 Extended (-40°C to -10°C, +85°C to +125°C)
BORV1:BORV0 = 1x N/A N/A N/A V Reserved
BORV1:BORV0 = 01 N/A N/A N/A V Reserved
BORV1:BORV0 = 00 3.90 4.54 5.18 V (Note 3)
Legend: Shading of rows is to assist in readability of the table.
Note 1: This is the limit to which VDD can be lowered in Sleep mode, or during a device Reset, without losing RAM data.
2: When BOR is on and BORV<1:0> = 0x, the device will operate correctly at 40 MHz for any VDD at which the BOR allows
execution (low-voltage and industrial devices only).
3: When BOR is on and BORV<1:0> = 0x, the device will operate correctly at 25 MHz for any VDD at which the BOR allows
execution (extended devices only).
Param
Device Typ Max Units Conditions
No.
Param
Device Typ Max Units Conditions
No.
Param
Device Typ Max Units Conditions
No.
Param
Device Typ Max Units Conditions
No.
Param
Device Typ Max Units Conditions
No.
Param
Device Typ Max Units Conditions
No.
Param
Device Typ Max Units Conditions
No.
Param
Device Typ Max Units Conditions
No.
Param
Device Typ Max Units Conditions
No.
Param
Symbol Characteristic Min Max Units Conditions
No.
VOL Output Low Voltage
D080 I/O ports — 0.6 V IOL = 8.5 mA, VDD = 4.5V,
-40°C to +85°C
D083 OSC2/CLKO — 0.6 V IOL = 1.6 mA, VDD = 4.5V,
(RC mode) -40°C to +85°C
VOH Output High Voltage(3)
D090 I/O ports VDD – 0.7 — V IOH = -3.0 mA, VDD = 4.5V,
-40°C to +85°C
D092 OSC2/CLKO VDD – 0.7 — V IOH = -1.3 mA, VDD = 4.5V,
(RC mode) -40°C to +85°C
D150 VOD Open-Drain High Voltage — 8.5 V RA4 pin
Capacitive Loading Specs
on Output Pins
D100(4) COSC2 OSC2 pin — 15 pF In XT, HS and LP modes
when external clock is
used to drive OSC1
D101 CIO All I/O pins and OSC2 — 50 pF To meet the AC timing
(in RC mode) specifications
D102 CB SCL, SDA — 400 pF In I2C mode
Note 1: In RC oscillator configuration, the OSC1/CLKI pin is a Schmitt Trigger input. It is not recommended that the
PIC® device be driven with an external clock while in RC mode.
2: The leakage current on the MCLR pin is strongly dependent on the applied voltage level. The specified
levels represent normal operating conditions. Higher leakage current may be measured at different input
voltages.
3: Negative current is defined as current sourced by the pin.
4: Parameter is characterized but not tested.
(LVDIF can be
VLVD cleared in software)
(LVDIF set by hardware)
LVDIF
Param
Symbol Characteristic Min Typ† Max Units Conditions
No.
D420D LVD Voltage on VDD Transition High-to-Low Industrial Low Voltage (-10°C to +85°C)
PIC18LF1220/1320 LVDL<3:0> = 0000 N/A N/A N/A V Reserved
LVDL<3:0> = 0001 N/A N/A N/A V Reserved
LVDL<3:0> = 0010 2.08 2.26 2.44 V
LVDL<3:0> = 0011 2.26 2.45 2.65 V
LVDL<3:0> = 0100 2.35 2.55 2.76 V
LVDL<3:0> = 0101 2.55 2.77 2.99 V
LVDL<3:0> = 0110 2.64 2.87 3.10 V
LVDL<3:0> = 0111 2.82 3.07 3.31 V
LVDL<3:0> = 1000 3.09 3.36 3.63 V
LVDL<3:0> = 1001 3.29 3.57 3.86 V
LVDL<3:0> = 1010 3.38 3.67 3.96 V
LVDL<3:0> = 1011 3.56 3.87 4.18 V
LVDL<3:0> = 1100 3.75 4.07 4.40 V
LVDL<3:0> = 1101 3.93 4.28 4.62 V
LVDL<3:0> = 1110 4.23 4.60 4.96 V
Legend: Shading of rows is to assist in readability of the table.
† Production tested at TAMB = 25°C. Specifications over temperature limits ensured by characterization.
Param
Symbol Characteristic Min Typ† Max Units Conditions
No.
D420F LVD Voltage on VDD Transition High-to-Low Industrial Low Voltage (-40°C to -10°C)
PIC18LF1220/1320 LVDL<3:0> = 0000 N/A N/A N/A V Reserved
LVDL<3:0> = 0001 N/A N/A N/A V Reserved
LVDL<3:0> = 0010 1.99 2.26 2.53 V
LVDL<3:0> = 0011 2.16 2.45 2.75 V
LVDL<3:0> = 0100 2.25 2.55 2.86 V
LVDL<3:0> = 0101 2.43 2.77 3.10 V
LVDL<3:0> = 0110 2.53 2.87 3.21 V
LVDL<3:0> = 0111 2.70 3.07 3.43 V
LVDL<3:0> = 1000 2.96 3.36 3.77 V
LVDL<3:0> = 1001 3.14 3.57 4.00 V
LVDL<3:0> = 1010 3.23 3.67 4.11 V
LVDL<3:0> = 1011 3.41 3.87 4.34 V
LVDL<3:0> = 1100 3.58 4.07 4.56 V
LVDL<3:0> = 1101 3.76 4.28 4.79 V
LVDL<3:0> = 1110 4.04 4.60 5.15 V
LVD Voltage on VDD Transition High-to-Low Industrial (-10°C to +85°C)
D420G PIC18F1220/1320 LVDL<3:0> = 1101 3.93 4.28 4.62 V
LVDL<3:0> = 1110 4.23 4.60 4.96 V
LVD Voltage on VDD Transition High-to-Low Industrial (-40°C to -10°C)
D420H PIC18F1220/1320 LVDL<3:0> = 1101 3.76 4.28 4.79 V
LVDL<3:0> = 1110 4.04 4.60 5.15 V
LVD Voltage on VDD Transition High-to-Low Extended (-10°C to +85°C)
D420J PIC18F1220/1320 LVDL<3:0> = 1101 3.94 4.28 4.62 V
LVDL<3:0> = 1110 4.23 4.60 4.96 V
LVD Voltage on VDD Transition High-to-Low Extended (-40°C to -10°C, +85°C to +125°C)
D420K PIC18F1220/1320 LVDL<3:0> = 1101 3.77 4.28 4.79 V
LVDL<3:0> = 1110 4.05 4.60 5.15 V
Legend: Shading of rows is to assist in readability of the table.
† Production tested at TAMB = 25°C. Specifications over temperature limits ensured by characterization.
VDD/2
RL Pin CL
VSS
CL
pin
RL = 464Ω
VSS CL = 50 pF for all pins except OSC2/CLKO
OSC1
1 3 3 4 4
2
CLKO
1A FOSC External CLKI Frequency(1) DC 40 MHz EC, ECIO (LF and Industrial)
DC 25 MHz EC, ECIO (Extended)
Oscillator Frequency(1) DC 4 MHz RC oscillator
DC 1 MHz XT oscillator
DC 25 MHz HS oscillator
1 10 MHz HS + PLL oscillator
DC 33 kHz LP Oscillator mode
1 TOSC External CLKI Period(1) 25 — ns EC, ECIO (LF and Industrial)
40 — ns EC, ECIO (Extended)
Oscillator Period(1) 250 — ns RC oscillator
1000 — ns XT oscillator
25 — ns HS oscillator
100 1000 ns HS + PLL oscillator
30 — μs LP oscillator
2 TCY Instruction Cycle Time(1) 100 — ns TCY = 4/FOSC
3 TosL, External Clock in (OSC1) 30 — ns XT oscillator
TosH High or Low Time 2.5 — μs LP oscillator
10 — ns HS oscillator
4 TosR, External Clock in (OSC1) — 20 ns XT oscillator
TosF Rise or Fall Time — 50 ns LP oscillator
— 7.5 ns HS oscillator
Note 1: Instruction cycle period (TCY) equals four times the input oscillator time base period for all configurations
except PLL. All specified values are based on characterization data for that particular oscillator type under
standard operating conditions, with the device executing code. Exceeding these specified limits may result
in an unstable oscillator operation and/or higher than expected current consumption. All devices are tested
to operate at “min.” values with an external clock applied to the OSC1/CLKI pin. When an external clock
input is used, the “max.” cycle time limit is “DC” (no clock) for all devices.
Param
Device Min Typ Max Units Conditions
No.
INTOSC Accuracy @ Freq = 8 MHz, 4 MHz, 2 MHz, 1 MHz, 500 kHz, 250 kHz, 125 kHz(1)
PIC18LF1220/1320 -2 +/-1 2 % +25°C VDD = 2.7-3.3V
-5 — 5 % -10°C to +85°C VDD = 2.7-3.3V
-10 — 10 % -40°C to +85°C VDD = 2.7-3.3V
PIC18F1220/1320PIC18F -2 +/-1 2 % +25°C VDD = 4.5-5.5V
1220/1320 -5 — 5 % -10°C to +85°C VDD = 4.5-5.5V
-10 — 10 % -40°C to +85°C VDD = 4.5-5.5V
INTRC Accuracy @ Freq = 31 kHz(2)
PIC18LF1220/1320 26.562 — 35.938 kHz -40°C to +85°C VDD = 2.7-3.3V
PIC18F1220/1320PIC18F 26.562 — 35.938 kHz -40°C to +85°C VDD = 4.5-5.5V
1220/1320
Legend: Shading of rows is to assist in readability of the table.
Note 1: Frequency calibrated at 25°C. OSCTUNE register can be used to compensate for temperature and VDD drift.
2: INTRC frequency after calibration.
3: Change of INTRC frequency as VDD changes.
Q4 Q1 Q2 Q3
OSC1
10 11
CLKO
13 12
14 19 18
16
I/O pin
(Input)
17 15
20, 21
VDD
MCLR
30
Internal
POR
33
PWRT
Time-out 32
OSC
Time-out
Internal
Reset
Watchdog
Timer
Reset
31
34 34
I/O pins
BVDD
VDD
35
VBGAP = 1.2V
VIRVST
Enable Internal
Reference Voltage
Internal Reference 36
Voltage Stable
T0CKI
40 41
42
T1OSO/T13CKI
45 46
47 48
TMR0 or
TMR1
CCPx
(Capture Mode)
50 51
52
CCPx
(Compare or PWM Mode)
53 54
RB1/AN5/TX/
CK/INT1 pin
121 121
RB4/AN6/RX/
DT/KBI0 pin
120
122
RB1/AN5/TX/
CK/INT1 pin 125
RB4/AN6/RX/
DT/KBI0 pin
126
BSF ADCON0, GO
(Note 2)
131
Q4
130
A/D CLK(1) 132
TCY
ADIF
GO DONE
Sampling Stopped
SAMPLE
Note 1: If the A/D clock source is selected as RC, a time of TCY is added before the A/D clock starts.
This allows the SLEEP instruction to be executed.
2: This is a minimal RC delay (typically 100 ns), which also disconnects the holding capacitor from the analog input.
130 TAD A/D Clock Period PIC18F1X20 1.6 20(5) μs TOSC based, VREF ≥ 3.0V
PIC18LF1X20 3.0 20(5) μs TOSC based, VREF full range
PIC18F1X20 2.0 6.0 μs A/D RC mode
PIC18LF1X20 3.0 9.0 μs A/D RC mode
131 TCNV Conversion Time 11 12 TAD
(not including acquisition time) (Note 1)
132 TACQ Acquisition Time (Note 3) 15 — μs -40°C ≤ Temp ≤ +125°C
10 — μs 0°C ≤ Temp ≤ +125°C
135 TSWC Switching Time from Convert → Sample — (Note 4)
136 TAMP Amplifier Settling Time (Note 2) 1 — μs This may be used if the
“new” input voltage has not
changed by more than 1 LSb
(i.e., 5 mV @ 5.12V) from the
last sampled voltage (as
stated on CHOLD).
Note 1: ADRES register may be read on the following TCY cycle.
2: See Section 17.0 “10-Bit Analog-to-Digital Converter (A/D) Module” for minimum conditions when input
voltage has changed more than 1 LSb.
3: The time for the holding capacitor to acquire the “New” input voltage, when the voltage changes full scale after
the conversion (AVDD to AVSS, or AVSS to AVDD). The source impedance (RS) on the input channels is 50Ω.
4: On the next Q4 cycle of the device clock.
5: The time of the A/D clock period is dependent on the device frequency and the TAD clock divider.
FIGURE 23-1: TYPICAL IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, +25°C
0.5
5.0V
0.3
4.5V
IDD (mA)
4.0V
0.2
3.5V
3.0V
0.1 2.5V
2.0V
0.0
0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20
FOSC (MHz)
FIGURE 23-2: MAXIMUM IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, -40°C TO +85°C
0.7
5.0V
0.5
4.5V
0.4
IDD (mA)
4.0V
0.3
3.5V
3.0V
0.2
2.5V
0.1
2.0V
0.0
0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20
FOSC (MHz)
5.0V
0.5
4.5V
0.4
IDD (mA)
4.0V
0.3
3.5V
3.0V
0.2
2.5V
0.1
2.0V
0.0
0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20
FOSC (MHz)
FIGURE 23-4: TYPICAL IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, +25°C
2.0
1.6
5.5V
1.4
5.0V
1.2
4.5V
IDD (mA)
1.0
4.0V
0.8 3.5V
3.0V
0.6
2.5V
0.4 2.0V
0.2
0.0
1.0 1.5 2.0 2.5 3.0 3.5 4.0
FOSC (MHz)
5.5V
5.0V
1.5
IDD (mA)
4.5V
4.0V
1.0
3.5V
3.0V
2.5V
0.5
2.0V
0.0
1.0 1.5 2.0 2.5 3.0 3.5 4.0
FOSC (MHz)
FIGURE 23-6: TYPICAL IDD vs. FOSC OVER VDD PRI_RUN, EC MODE, +25°C
16
5.5V
12
5.0V
10
4.5V
IDD (mA)
8
4.0V
3.5V
3.0V
2
2.5V
2.0V
0
4 8 12 16 20 24 28 32 36 40
FOSC (MHz)
4.0V
10
4.5V
IDD (mA)
3.5V
6
4
3.0V
2
2.5V
2.0V
0
4 8 12 16 20 24 28 32 36 40
FOSC (MHz)
FIGURE 23-8: TYPICAL IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, +25°C
0.035
5.0V
0.025
4.5V
0.020
4.0V
IDD (mA)
3.5V
0.015
3.0V
2.5V
0.010
2.0V
0.005
0.000
0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20
FOSC (MHz)
0.035
5.0V
0.030
4.5V
0.025
IDD (mA)
4.0V
0.020
3.5V
3.0V
0.015
2.5V
0.010 2.0V
0.005
0.000
0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20
FOSC (MHz)
FIGURE 23-10: MAXIMUM IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, -40°C TO +125°C
0.100
0.070 5.0V
0.060
4.5V
IDD (mA)
0.050 4.0V
3.5V
0.040
3.0V
0.030
2.5V
0.020 2.0V
0.010
0.000
0.00 0.02 0.04 0.06 0.08 0.10 0.12 0.14 0.16 0.18 0.20
FOSC (MHz)
600
5.5V
5.0V
400
4.5V
IDD (μA)
4.0V
300
3.5V
3.0V
200
2.5V
2.0V
100
0
1.0 1.5 2.0 2.5 3.0 3.5 4.0
FOSC (MHz)
FIGURE 23-12: MAXIMUM IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, -40°C TO +125°C
600
5.0V
400
4.5V
4.0V
IDD (μA)
300
3.5V
3.0V
200
2.5V
2.0V
100
0
1.0 1.5 2.0 2.5 3.0 3.5 4.0
FOSC (MHz)
4.5
5.5V
4.0
5.0V
3.5
4.5V
IDD (mA)
3.0
4.0V
2.5
2.0
3.5V
1.5
3.0V
1.0
0.5 2.5V
2.0V
0.0
4 8 12 16 20 24 28 32 36 40
FOSC (MHz)
FIGURE 23-14: MAXIMUM IDD vs. FOSC OVER VDD PRI_IDLE, EC MODE, -40°C TO +125°C
6.0
5.5
Typical: statistical mean @ 25°C
5.0 Maximum: mean + 3σ (-40°C to +125°C)
Minimum: mean – 3σ (-40°C to +125°C) 5.5V
4.5 5.0V
4.0 4.5V
3.5
4.0V
IDD (mA)
3.0
2.5
3.5V
2.0
1.5
3.0V
1.0
2.5V
0.5
2.0V
0.0
4 8 12 16 20 24 28 32 36 40
FOSC (MHz)
1500
4 MHz
1000
2 MHz
500
1 MHz
125 kHz
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 23-16: MAXIMUM IPD vs. VDD (-40°C TO +125°C), 125 kHz TO 8 MHz RC_RUN MODE,
ALL PERIPHERALS DISABLED
3500
8 MHz
3000
250 kHz and 500 kHz curves are
bounded by 125 kHz and 1 MHz
curves.
2500
Typical: statistical mean @ 25°C
Maximum: mean + 3σ (-40°C to +125°C)
Minimum: mean – 3σ (-40°C to +125°C)
2000
IPD (μA)
4 MHz
1500
1000
2 MHz
500 1 MHz
125 kHz
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
Max (+125°C)
Max (+85°C)
Typ (+25°C)
IPD (μA)
10
1
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 23-18: TYPICAL IPD vs. VDD (+25°C), 125 kHz TO 8 MHz RC_IDLE MODE,
ALL PERIPHERALS DISABLED
800
750
500
2 MHz
IPD (μA)
1 MHz
450
125 kHz
400
350
300
250
200
150
100
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
500
IPD (μA)
450
400
350
300
Typical: statistical mean @ 25°C
250
Maximum: mean + 3σ (-40°C to +125°C)
Minimum: mean – 3σ (-40°C to +125°C)
200
150
100
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 23-20: TYPICAL AND MAXIMUM IPD vs. VDD (-40°C TO +125°C), 31.25 kHz RC_IDLE MODE,
ALL PERIPHERALS DISABLED
100
Max (+125°C)
Max (+85°C)
IPD (μA)
10
Typ (+25°C)
1
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
60
Max (+70°C)
50
IPD (μA)
40
Typ (+25°C)
30
20
10
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 23-22: IPD SEC_IDLE MODE, -10°C TO +70°C, 32.768 kHz, 2 x 22 pF,
ALL PERIPHERALS DISABLED
20
16
14
Max (+70°C)
12
IPD (μA)
10
Typ (+25°C)
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
100
Max (+125°C)
10
Max (+85°C)
1
IPD (μA)
0.1
Typ (+25°C)
0.01
Typical: statistical mean @ 25°C
Maximum: mean + 3σ (-40°C to +125°C)
Minimum: mean – 3σ (-40°C to +125°C)
0.001
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 23-24: VOH vs. IOH OVER TEMPERATURE (-40°C TO +125°C), VDD = 3.0V
3.0
2.5
2.0
Max (+125°C)
VOH (V)
1.5
Typ (+25°C)
Min (+125°C)
1.0
0.5
0.0
0 5 10 15 20 25
IOH (-mA)
4.5
Max (+125°C)
4.0
Typ (+25°C)
3.5
3.0
VOH (V)
2.5
Min (+125°C)
2.0
1.5
1.0
0.5
0.0
0 5 10 15 20 25
IOH (-mA)
Max (+125°C)
2.5
Max (+85°C)
2.0
VOL (V)
1.5
Typ (+25°C)
1.0
0.5
Min (+125°C)
0.0
0 5 10 15 20 25
IOL (-mA)
0.9
Max (+125°C)
0.8
0.7
0.6
Max (+85°C)
VOL (V)
0.5
0.4
Typ (+25°C)
0.3
0.2
Min (+125°C)
0.1
0.0
0 5 10 15 20 25
IOL (-mA)
5.0
4.5
3.5
3.0
Typ (+25°C)
IPD (μA)
2.5
2.0
1.5
0.5
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
4.0
Max (-40°C)
3.5
3.0
2.5
ΔIPD (μA)
Typ (+25°C)
2.0
1.5
0.5
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 23-30: ΔIPD WDT, -40°C TO +125°C SLEEP MODE, ALL PERIPHERALS DISABLED
14
10
Max (+125°C)
8
ΔIPD (μA)
Max (+85°C)
4
Typ (+25°C)
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
45
Typical: statistical mean @ 25°C
Maximum: mean + 3σ (-40°C to +125°C)
40 Minimum: mean – 3σ (-40°C to +125°C)
Max (+125°C)
35
Max (+85°C)
30
IPD (μA)
Typ (+25°C)
25
20
15
10
Low-Voltage Detection Range
5
FIGURE 23-32: ΔIPD BOR vs. VDD, -40°C TO +125°C SLEEP MODE,
BORV1:BORV0 = 11 (2V)
40
30
25
Typ (+25°C)
IPD (μA)
20
15
10
5
Device is Operating
0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
10
Max (+125°C)
1
IPD (μA)
Max (+85°C)
0.1
0.01
Typical: statistical mean @ 25°C
Maximum: mean + 3σ (-40°C to +125°C)
Typ (+25°C)
Minimum: mean – 3σ (-40°C to +125°C)
0.001
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 23-34: AVERAGE FOSC vs. VDD FOR VARIOUS R’s EXTERNAL RC MODE,
C = 20 pF, TEMPERATURE = +25°C
5.0
4.0
5.1K
3.5
3.0
Freq (MHz)
2.5
10K
2.0
1.5
1.0
33K
0.5
100K
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
1.8
1.6
5.1K
1.4
1.2
Freq (MHz)
1.0
10K
0.8
0.6
0.4
33K
0.2
100K
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
FIGURE 23-36: AVERAGE FOSC vs. VDD FOR VARIOUS R’s EXTERNAL RC MODE,
C = 300 pF, TEMPERATURE = +25°C
0.8
0.7
0.6
0.5
5.1K
Freq (MHz)
0.4
0.3
10K
0.2
0.1
33K
100K
0.0
2.0 2.5 3.0 3.5 4.0 4.5 5.0 5.5
VDD (V)
XXXXXXXXXXXXXXXXX PIC18F1320-I/P e3
XXXXXXXXXXXXXXXXX 0710017
YYWWNNN
XXXXXXXXXXXX PIC18F1220-
XXXXXXXXXXXX E/SO e3
XXXXXXXXXXXX 0710017
YYWWNNN
XXXXXXXXXXX PIC18F1220-
XXXXXXXXXXX E/SS e3
YYWWNNN 0710017
XXXXXXXX 18F1320
XXXXXXXX -I/ML e3
YYWWNNN 0710017
Note: 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.
NOTE 1
E1
1 2 3
D
A A2
L c
A1
b1
b e eB
Units INCHES
Dimension Limits MIN NOM MAX
Number of Pins N 18
Pitch e .100 BSC
Top to Seating Plane A – – .210
Molded Package Thickness A2 .115 .130 .195
Base to Seating Plane A1 .015 – –
Shoulder to Shoulder Width E .300 .310 .325
Molded Package Width E1 .240 .250 .280
Overall Length D .880 .900 .920
Tip to Seating Plane L .115 .130 .150
Lead Thickness c .008 .010 .014
Upper Lead Width b1 .045 .060 .070
Lower Lead Width b .014 .018 .022
Overall Row Spacing § eB – – .430
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. § Significant Characteristic.
3. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed .010" per side.
4. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
E
E1
NOTE 1
1 2 3
e
b
α
h
h
c
φ
A A2
β
A1 L
L1
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Pins N 18
Pitch e 1.27 BSC
Overall Height A – – 2.65
Molded Package Thickness A2 2.05 – –
Standoff § A1 0.10 – 0.30
Overall Width E 10.30 BSC
Molded Package Width E1 7.50 BSC
Overall Length D 11.55 BSC
Chamfer (optional) h 0.25 – 0.75
Foot Length L 0.40 – 1.27
Footprint L1 1.40 REF
Foot Angle φ 0° – 8°
Lead Thickness c 0.20 – 0.33
Lead Width b 0.31 – 0.51
Mold Draft Angle Top α 5° – 15°
Mold Draft Angle Bottom β 5° – 15°
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. § Significant Characteristic.
3. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.15 mm per side.
4. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
Microchip Technology Drawing C04-051B
D
N
E1
NOTE 1
1 2
e
b
c
A A2
φ
A1
L1 L
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Pins N 20
Pitch e 0.65 BSC
Overall Height A – – 2.00
Molded Package Thickness A2 1.65 1.75 1.85
Standoff A1 0.05 – –
Overall Width E 7.40 7.80 8.20
Molded Package Width E1 5.00 5.30 5.60
Overall Length D 6.90 7.20 7.50
Foot Length L 0.55 0.75 0.95
Footprint L1 1.25 REF
Lead Thickness c 0.09 – 0.25
Foot Angle φ 0° 4° 8°
Lead Width b 0.22 – 0.38
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed 0.20 mm per side.
3. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
Microchip Technology Drawing C04-072B
D D2
EXPOSED
PAD
E
b
E2
2 2
1 1 K
N N
NOTE 1 L
TOP VIEW BOTTOM VIEW
A3 A1
Units MILLIMETERS
Dimension Limits MIN NOM MAX
Number of Pins N 28
Pitch e 0.65 BSC
Overall Height A 0.80 0.90 1.00
Standoff A1 0.00 0.02 0.05
Contact Thickness A3 0.20 REF
Overall Width E 6.00 BSC
Exposed Pad Width E2 3.65 3.70 4.20
Overall Length D 6.00 BSC
Exposed Pad Length D2 3.65 3.70 4.20
Contact Width b 0.23 0.30 0.35
Contact Length L 0.50 0.55 0.70
Contact-to-Exposed Pad K 0.20 – –
Notes:
1. Pin 1 visual index feature may vary, but must be located within the hatched area.
2. Package is saw singulated.
3. Dimensioning and tolerancing per ASME Y14.5M.
BSC: Basic Dimension. Theoretically exact value shown without tolerances.
REF: Reference Dimension, usually without tolerance, for information purposes only.
Microchip Technology Drawing C04-105B
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________ FAX: (______) _________ - _________
Application (optional):
Would you like a reply? Y N
Questions:
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?
PIC18LF1220/1320(1),
PIC18LF1220/1320T(2);
VDD range 2.5V to 5.5V
12/08/06