Professional Documents
Culture Documents
PIC16F62X Data Sheet: FLASH-Based 8-Bit CMOS Microcontroller
PIC16F62X Data Sheet: FLASH-Based 8-Bit CMOS Microcontroller
Data Sheet
FLASH-Based
8-Bit CMOS Microcontroller
Preliminary
DS40300C
Note the following details of the code protection feature on Microchip devices:
Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the
intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchip's Data
Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not
mean that we are guaranteeing the product as unbreakable.
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of our
products.
Trademarks
The Microchip name and logo, the Microchip logo, KEELOQ,
MPLAB, PIC, PICmicro, PICSTART and PRO MATE are
registered trademarks of Microchip Technology Incorporated
in the U.S.A. and other countries.
FilterLab, microID, MXDEV, MXLAB, PICMASTER, SEEVAL
and The Embedded Control Solutions Company are
registered trademarks of Microchip Technology Incorporated
in the U.S.A.
dsPIC, dsPICDEM.net, ECONOMONITOR, FanSense,
FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP,
ICEPIC, microPort, Migratable Memory, MPASM, MPLIB,
MPLINK, MPSIM, PICC, PICDEM, PICDEM.net, rfPIC, Select
Mode and Total Endurance are trademarks of Microchip
Technology Incorporated in the U.S.A. and other countries.
Serialized Quick Turn Programming (SQTP) is a service mark
of Microchip Technology Incorporated in the U.S.A.
All other trademarks mentioned herein are property of their
respective companies.
2003, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
DS40300C - page ii
Preliminary
PIC16F62X
FLASH-Based 8-Bit CMOS Microcontrollers
Devices Included in this Data Sheet:
PIC16F627
PIC16F628
Referred to collectively as PIC16F62X
Device
FLASH
Program
RAM
Data
EEPROM
Data
PIC16F627
1024 x 14
224 x 8
128 x 8
PIC16F628
2048 x 14
224 x 8
128 x 8
Interrupt capability
16 special function hardware registers
8-level deep hardware stack
Direct, Indirect and Relative addressing modes
Peripheral Features:
16 I/O pins with individual direction control
High current sink/source for direct LED drive
Analog comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference
(VREF) module
- Programmable input multiplexing from device
inputs and internal voltage reference
- Comparator outputs are externally accessible
Timer0: 8-bit timer/counter with 8-bit
programmable prescaler
Timer1: 16-bit timer/counter with external crystal/
clock capability
Timer2: 8-bit timer/counter with 8-bit period
register, prescaler and postscaler
Capture, Compare, PWM (CCP) module
- Capture is 16-bit, max. resolution is 12.5 ns
- Compare is 16-bit, max. resolution is 200 ns
- PWM max. resolution is 10-bit
CMOS Technology:
Low power, high speed CMOS FLASH technology
Fully static design
Wide operating voltage range
- PIC16F627 - 3.0V to 5.5V
- PIC16F628 - 3.0V to 5.5V
- PIC16LF627 - 2.0V to 5.5V
- PIC16LF628 - 2.0V to 5.5V
Commercial, industrial and extended temperature
range
Low power consumption
- < 2.0 mA @ 5.0V, 4.0 MHz
- 15 A typical @ 3.0V, 32 kHz
- < 1.0 A typical standby current @ 3.0V
Preliminary
DS40300C-page 1
PIC16F62X
Pin Diagrams
PDIP, SOIC
RA5/MCLR/VPP
VSS
RB0/INT
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
1
2
3
4
5
6
7
8
9
PIC16F62X
RA2/AN2/VREF
RA3/AN3/CMP1
RA4/TOCKI/CMP2
18
17
16
15
14
13
12
11
10
RA1/AN1
RA0/AN0
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT
VDD
RB7/T1OSI/PGD
RB6/T1OSO/T1CKI/PGC
RB5
RB4/PGM
20
19
18
17
16
15
14
13
12
11
RA1/AN1
SSOP
RA2/AN2/VREF
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
1
2
3
4
5
6
7
8
9
10
PIC16F62X
RA3/AN3/CMP1
RA4/TOCKI/CMP2
RA5/MCLR/VPP
VSS
VSS
RB0/INT
RA0/AN0
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT
VDD
VDD
RB7/T1OSI/PGD
RB6/T1OSO/T1CKI/PGC
RB5
RB4/PGM
Device Differences
Device
Voltage
Range
Oscillator
Process
Technology
(Microns)
PIC16F627
3.0 - 5.5
(Note 1)
0.7
PIC16F628
3.0 - 5.5
(Note 1)
0.7
PIC16LF627
2.0 - 5.5
(Note 1)
0.7
PIC16LF628
2.0 - 5.5
(Note 1)
0.7
Note 1: If you change from this device to another device, please verify oscillator characteristics in your
application.
DS40300C-page 2
Preliminary
PIC16F62X
Table of Contents
1.0
2.0
3.0
4.0
5.0
6.0
7.0
8.0
9.0
10.0
11.0
12.0
13.0
14.0
15.0
16.0
17.0
18.0
19.0
General Description...................................................................................................................................................................... 5
PIC16F62X Device Varieties........................................................................................................................................................ 7
Architectural Overview ................................................................................................................................................................. 9
Memory Organization ................................................................................................................................................................. 15
I/O Ports ..................................................................................................................................................................................... 29
Timer0 Module ........................................................................................................................................................................... 43
Timer1 Module ........................................................................................................................................................................... 46
Timer2 Module ........................................................................................................................................................................... 50
Comparator Module.................................................................................................................................................................... 53
Voltage Reference Module......................................................................................................................................................... 59
Capture/Compare/PWM (CCP) Module ..................................................................................................................................... 61
Universal Synchronous/ Asynchronous Receiver/ Transmitter (USART) Module...................................................................... 67
Data EEPROM Memory ............................................................................................................................................................. 87
Special Features of the CPU...................................................................................................................................................... 91
Instruction Set Summary .......................................................................................................................................................... 107
Development Support............................................................................................................................................................... 121
Electrical Specifications............................................................................................................................................................ 127
DC and AC Characteristics Graphs and Tables....................................................................................................................... 143
Packaging Information.............................................................................................................................................................. 157
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:
Microchips Worldwide Web site; http://www.microchip.com
Your local Microchip sales office (see last page)
The Microchip Corporate Literature Center; U.S. FAX: (480) 792-7277
When contacting a sales office or the literature center, please specify which device, revision of silicon and data sheet (include literature number) you are using.
Preliminary
DS40300C-page 3
PIC16F62X
NOTES:
DS40300C-page 4
Preliminary
PIC16F62X
1.0
1.1
FLASH Devices
1.2
Quick-Turnaround Production
(QTP) Devices
1.3
Serialized Quick-Turnaround
Production (SQTPsm) Devices
Preliminary
DS40300C-page 5
PIC16F62X
NOTES:
DS40300C-page 6
Preliminary
PIC16F62X
2.0
ARCHITECTURAL OVERVIEW
TABLE 2-1:
DEVICE DESCRIPTION
Memory
Device
FLASH
Program
RAM
Data
EEPROM
Data
PIC16F627
1024 x 14
224 x 8
128 x 8
PIC16F628
2048 x 14
224 x 8
128 x 8
PIC16LF627
1024 x 14
224 x 8
128 x 8
PIC16LF628
2048 x 14
224 x 8
128 x 8
Preliminary
DS40300C-page 7
PIC16F62X
FIGURE 2-1:
BLOCK DIAGRAM
13
Program
Memory
RAM
File
Registers
8-Level Stack
(13-bit)
Program
Bus
14
Data Bus
Program Counter
FLASH
PORTA
Addr MUX
Instruction reg
Direct Addr
RA0/AN0
RA1/AN1
RA2/AN2/VREF
RA3/AN3/CMP1
RA4/T0CK1/CMP2
RA5/MCLR/VPP
RA6/OSC2/CLKOUT
RA7/OSC1/CLKIN
Indirect
Addr
FSR reg
STATUS reg
8
3
Power-up
Timer
Instruction
Decode &
Control
Timing
Generation
OSC1/CLKIN
OSC2/CLKOUT
Oscillator
Start-up Timer
MUX
RB0/INT
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
RB4/PGM
RB5
RB6/T1OSO/T1CKI/PGC
RB7/T1OSI/PGD
ALU
Power-on
Reset
Watchdog
Timer
Brown-out
Detect
PORTB
W reg
Low-voltage
Programming
MCLR
Comparator
Timer0
VREF
CCP1
VDD, VSS
Timer1
Timer2
USART
Data EEPROM
DS40300C-page 8
Preliminary
PIC16F62X
TABLE 2-1:
Name
RA0/AN0
Function
RA0
ST
CMOS
Description
Bi-directional I/O port
AN0
AN
RA1/AN1
RA1
ST
CMOS
AN1
AN
RA2/AN2/VREF
RA2
ST
CMOS
AN2
AN
VREF
AN
VREF output
RA3
ST
CMOS
AN3
AN
CMP1
CMOS
Comparator 1 output
RA4
ST
OD
T0CKI
ST
CMP2
OD
Comparator 2 output
RA5
ST
Input port
MCLR
ST
Master clear
VPP
RA3/AN3/CMP1
RA4/T0CKI/CMP2
RA5/MCLR/VPP
RA6/OSC2/CLKOUT
RA7/OSC1/CLKIN
RB0/INT
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
Legend:
O = Output
= Not used
TTL = TTL Input
RA6
ST
CMOS
OSC2
XTAL
CLKOUT
CMOS
RA7
ST
CMOS
OSC1
XTAL
CLKIN
ST
RB0
TTL
CMOS
INT
ST
RB1
TTL
CMOS
RX
ST
DT
ST
CMOS
RB2
TTL
CMOS
TX
CMOS
CK
ST
CMOS
RB3
TTL
CMOS
CCP1
ST
CMOS
Capture/Compare/PWM I/O
Preliminary
P = Power
ST = Schmitt Trigger Input
AN = Analog
DS40300C-page 9
PIC16F62X
TABLE 2-1:
Name
RB4/PGM
Function
Description
RB4
TTL
CMOS
PGM
ST
RB5
RB5
TTL
CMOS
RB6/T1OSO/T1CKI/PGC
RB6
TTL
CMOS
T1OSO
XTAL
T1CKI
ST
PGC
ST
RB7
TTL
CMOS
T1OSI
XTAL
RB7/T1OSI/PGD
PGD
ST
CMOS
VSS
VSS
Power
VDD
VDD
Power
Legend:
O = Output
= Not used
TTL = TTL Input
DS40300C-page 10
Preliminary
P = Power
ST = Schmitt Trigger Input
AN = Analog
PIC16F62X
2.1
Clocking Scheme/Instruction
Cycle
2.2
Instruction Flow/Pipelining
FIGURE 2-2:
CLOCK/INSTRUCTION CYCLE
Q2
Q1
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
Q1
Q2
Internal
phase
clock
Q3
Q4
PC
PC
PC+1
PC+2
CLKOUT
Fetch INST (PC)
Execute INST (PC-1)
EXAMPLE 2-1:
2. MOVWF PORTB
SUB_1
4. BSF
PORTA, 3
1. MOVLW 55h
3. CALL
Fetch 1
Execute 1
Fetch 2
Execute 2
Fetch 3
Execute 3
Fetch 4
Flush
Fetch SUB_1 Execute SUB_1
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.
Preliminary
DS40300C-page 11
PIC16F62X
NOTES:
DS40300C-page 12
Preliminary
PIC16F62X
3.0
MEMORY ORGANIZATION
3.2
3.1
FIGURE 3-1:
CALL, RETURN
RETFIE, RETLW
RP1
RP0
Bank0
Bank1
Bank2
Bank3
13
Addresses F0h-FFh, 170h-17Fh and 1F0h-1FFh are
implemented as common RAM and mapped back to
addresses 70h-7Fh.
Stack Level 1
Stack Level 2
3.2.1
Stack Level 8
RESET Vector
000h
Interrupt Vector
0004
0005
On-chip Program
Memory
PIC16F627 and
PIC16F628
03FFh
On-chip Program
Memory
PIC16F628 only
07FFh
1FFFh
Preliminary
DS40300C-page 13
PIC16F62X
FIGURE 3-2:
Indirect addr.(1)
00h
Indirect addr.(1)
80h
Indirect addr.(1)
100h
Indirect addr.(1)
180h
TMR0
01h
OPTION
81h
TMR0
101h
OPTION
181h
PCL
02h
82h
PCL
102h
PCL
182h
STATUS
03h
STATUS
83h
STATUS
103h
STATUS
183h
FSR
04h
FSR
84h
FSR
104h
FSR
184h
PORTA
05h
TRISA
85h
PORTB
06h
TRISB
86h
PCL
PORTB
106h
185h
TRISB
186h
07h
87h
107h
187h
08h
88h
108h
188h
89h
109h
09h
PCLATH
0Ah
INTCON
0Bh
PIR1
0Ch
8Ah
10Ah
PCLATH
18Ah
INTCON
8Bh
INTCON
10Bh
INTCON
18Bh
PIE1
8Ch
10Ch
18Ch
8Dh
10Dh
18Dh
8Eh
10Eh
18Eh
10Fh
18Fh
PCLATH
TMR1L
0Eh
TMR1H
0Fh
8Fh
T1CON
10h
90h
TMR2
11h
T2CON
12h
PCON
91h
PR2
92h
13h
93h
14h
94h
CCPR1L
15h
95h
CCPR1H
16h
96h
CCP1CON
17h
97h
RCSTA
18h
TXSTA
98h
TXREG
19h
99h
RCREG
1Ah
SPBRG
EEDATA
1Bh
EEADR
9Bh
1Ch
EECON1
9Ch
1Dh
EECON2(1)
9Dh
1Eh
1Fh
9Ah
9Eh
VRCON
20h
General
Purpose
Register
189h
PCLATH
0Dh
CMCON
105h
9Fh
A0h
General
Purpose
Register
80 Bytes
General
Purpose
Register
48 Bytes
11Fh
120h
14Fh
150h
80 Bytes
6Fh
70h
16 Bytes
accesses
70h-7Fh
7Fh
Bank 0
EFh
F0h
accesses
70h-7Fh
1EFh
1F0h
accesses
70h - 7Fh
17Fh
FFh
Bank 2
Bank 1
16Fh
170h
1FFh
Bank 3
DS40300C-page 14
Preliminary
PIC16F62X
3.2.2
The SFRs are registers used by the CPU and Peripheral functions for controlling the desired operation of
the device (Table 3-1). These registers are static RAM.
The special registers can be classified into two sets
(core and peripheral). The SFRs associated with the
core functions are described in this section. Those
related to the operation of the peripheral features are
described in the section of that peripheral feature.
TABLE 3-1:
Value on
POR
Reset(1)
Details
on Page
INDF
TMR0
Addressing this location uses contents of FSR to address data memory (not a physical register)
Timer0 Modules Register
xxxx xxxx
xxxx xxxx
25
43
02h
PCL
03h
STATUS
04h
05h
FSR
PORTA
06h
07h
PORTB
RB7
RB6
Unimplemented
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bank 0
00h
01h
08h
09h
IRP
RP1
RP0
RB5
0000 0000
13
TO
PD
DC
0001 1xxx
19
RA4
RA3
RA2
RA1
RA0
xxxx xxxx
xxxx 0000
25
29
RB4
RB3
RB2
RB1
RB0
xxxx xxxx
34
---0 0000
25
0000 000x
0000 -000
21
23
xxxx xxxx
46
Unimplemented
Unimplemented
0Ah
PCLATH
0Bh
0Ch
INTCON
PIR1
GIE
EEIF
PEIE
CMIF
T0IE
RCIF
0Dh
0Eh
TMR1L
Unimplemented
Holding register for the Least Significant Byte of the 16-bit TMR1
0Fh
TMR1H
Holding register for the Most Significant Byte of the 16-bit TMR1
10h
11h
T1CON
TMR2
T1CKPS1
TMR2 modules register
12h
T2CON
13h
14h
15h
16h
CCPR1L
CCPR1H
17h
18h
CCP1CON
RCSTA
TOUTPS3
TOUTPS2
RBIE
T0IF
CCP1IF
INTF
TMR2IF
RBIF
TMR1IF
xxxx xxxx
46
T1CKPS0
T1OSCEN
T1SYNC
TMR1CS
TMR1ON
--00 0000
0000 0000
46
50
TOUTPS1
TOUTPS0
TMR2ON
T2CKPS1 T2CKPS0
-000 0000
50
xxxx xxxx
xxxx xxxx
61
61
--00 0000
0000 -00x
61
67
Unimplemented
Unimplemented
Capture/Compare/PWM register (LSB)
Capture/Compare/PWM register (MSB)
SPEN
RX9
CCP1X
SREN
CCP1Y
CREN
CCP1M3
ADEN
CCP1M2
FERR
CCP1M1
OERR
CCP1M0
RX9D
19h
TXREG
0000 0000
74
1Ah
1Bh
RCREG
0000 0000
77
0000 0000
53
1Ch
1Dh
1Eh
1Fh
CMCON
Unimplemented
Unimplemented
Unimplemented
C2OUT
C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
Legend:
Preliminary
DS40300C-page 15
PIC16F62X
TABLE 3-2:
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Reset(1)
Details on
Page
xxxx xxxx
25
1111 1111
20
Bank 1
80h
INDF
Addressing this location uses contents of FSR to address data memory (not a physical
register)
81h
OPTION
82h
PCL
RBPU
83h
STATUS
84h
85h
FSR
TRISA
86h
87h
TRISB
TRISB7
TRISB6
Unimplemented
88h
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
89h
8Ah
PCLATH
8Bh
8Ch
INTCON
PIE1
IRP
RP1
RP0
TRISB5
TO
TRISB4
GIE
EEIE
PEIE
CMIE
T0IE
RCIE
DC
0001 1xxx
19
TRISA3
TRISA2
TRISA1
TRISA0
xxxx xxxx
1111 1111
25
29
TRISB3
TRISB2
TRISB1
TRISB0
1111 1111
34
---0 0000
25
0000 000x
0000 -000
21
22
---- 1-0x
24
1111 1111
50
25
PD
Unimplemented
Unimplemented
0000 0000
RBIE
T0IF
CCP1IE
INTF
TMR2IE
RBIF
TMR1IE
8Dh
8Eh
8Fh
PCON
90h
Unimplemented
91h
92h
Unimplemented
Timer2 Period Register
93h
94h
Unimplemented
Unimplemented
95h
96h
Unimplemented
Unimplemented
97h
98h
TXSTA
0000 -010
69
PR2
Unimplemented
Unimplemented
Unimplemented
CSRC
TX9
TXEN
SYNC
OSCF
BRGH
POR
TRMT
BOD
TX9D
99h
SPBRG
0000 0000
69
9Ah
9Bh
EEDATA
EEADR
xxxx xxxx
xxxx xxxx
87
87
9Ch
9Dh
EECON1
EECON2
WRERR
EEPROM control register 2 (not a physical register)
---- x000
--------
87
87
9Eh
9Fh
VRCON
Unimplemented
VREN
VROE
000- 0000
59
VRR
VR3
WREN
WR
RD
VR2
VR1
VR0
Legend:
= Unimplemented locations read as 0, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented
Note 1: For the Initialization Condition for Registers Tables, refer to Table 14-7 and Table 14-8 on page 98.
DS40300C-page 16
Preliminary
PIC16F62X
TABLE 3-3:
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Reset(1)
Details on
Page
xxxx xxxx
25
1111 1111
43
Bank 2
100h
INDF
101h
TMR0
102h
PCL
103h
STATUS
104h
105h
FSR
106h
107h
PORTB
108h
Addressing this location uses contents of FSR to address data memory (not a physical register)
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
IRP
RP1
RP0
TO
PD
DC
RB5
RB4
RB3
RB2
RB1
RB0
Unimplemented
109h
10Ah
PCLATH
Unimplemented
10Bh
10Ch
INTCON
GIE
PEIE
Unimplemented
T0IE
RBIE
T0IF
INTF
RBIF
0000 0000
25
0001 1xxx
19
xxxx xxxx
25
xxxx xxxx
34
---0 0000
25
0000 000x
21
10Dh
10Eh
Unimplemented
Unimplemented
10Fh
110h
Unimplemented
Unimplemented
111h
Unimplemented
112h
113h
Unimplemented
Unimplemented
114h
115h
Unimplemented
Unimplemented
116h
117h
Unimplemented
Unimplemented
118h
119h
Unimplemented
Unimplemented
11Ah
Unimplemented
11Bh
11Ch
Unimplemented
Unimplemented
11Dh
11Eh
Unimplemented
Unimplemented
11Fh
Unimplemented
Legend:
= Unimplemented locations read as 0, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented.
Note 1: For the Initialization Condition for Registers Tables, refer to Table 14-7 and Table 14-8 on page 98.
Preliminary
DS40300C-page 17
PIC16F62X
TABLE 3-4:
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Reset(1)
Details on
Page
Bank 3
180h
INDF
Addressing this location uses contents of FSR to address data memory (not a physical register)
xxxx xxxx
25
1111 1111
20
181h
OPTION
RBPU
182h
PCL
183h
STATUS
IRP
184h
185h
FSR
186h
187h
TRISB
188h
INTEDG
RP1
TRISB7
TRISB6
Unimplemented
T0CS
RP0
TRISB5
T0SE
TO
TRISB4
PSA
PD
TRISB3
PS2
Z
PS1
DC
TRISB2
TRISB1
PS0
C
TRISB0
Unimplemented
189h
18Ah
PCLATH
Unimplemented
18Bh
18Ch
INTCON
GIE
PEIE
Unimplemented
T0IE
RBIE
T0IF
INTF
RBIF
0000 0000
25
0001 1xxx
19
xxxx xxxx
25
1111 1111
34
---0 0000
25
0000 000x
21
18Dh
18Eh
Unimplemented
Unimplemented
18Fh
190h
Unimplemented
Unimplemented
191h
Unimplemented
192h
193h
Unimplemented
Unimplemented
194h
195h
Unimplemented
Unimplemented
196h
197h
Unimplemented
Unimplemented
198h
199h
Unimplemented
Unimplemented
19Ah
Unimplemented
19Bh
19Ch
Unimplemented
Unimplemented
19Dh
19Eh
Unimplemented
Unimplemented
19Fh
Unimplemented
Legend:
= Unimplemented locations read as 0, u = unchanged, x = unknown, q = value depends on condition, shaded = unimplemented
Note 1: For the Initialization Condition for Registers Tables, refer to Table 14-7 and Table 14-8 on page 98.
DS40300C-page 18
Preliminary
PIC16F62X
3.2.2.1
STATUS Register
REGISTER 3-1:
R/W-0
R/W-0
R-1
R-1
R/W-x
R/W-x
R/W-x
IRP
RP1
RP0
TO
PD
DC
bit 7
bit 0
bit 7
bit 6-5
bit 4
bit 3
bit 2
Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
bit 1
DC: Digit carry/borrow bit (ADDWF, ADDLW,SUBLW,SUBWF instructions) (for borrow the polarity
is reversed)
1 = A carry-out from the 4th low order bit of the result occurred
0 = No carry-out from the 4th low order bit of the result
bit 0
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
DS40300C-page 19
PIC16F62X
3.2.2.2
OPTION Register
Note:
REGISTER 3-2:
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
bit 7
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-0
TMR0 Rate
1:2
1:4
1:8
1 : 16
1 : 32
1 : 64
1 : 128
1 : 256
WDT Rate
1:1
1:2
1:4
1:8
1 : 16
1 : 32
1 : 64
1 : 128
Legend:
DS40300C-page 20
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
PIC16F62X
3.2.2.3
INTCON Register
Note:
REGISTER 3-3:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-x
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
bit 7
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
DS40300C-page 21
PIC16F62X
3.2.2.4
PIE1 Register
REGISTER 3-4:
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R/W-0
R/W-0
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
TMR1IE
bit 7
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
DS40300C-page 22
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
PIC16F62X
3.2.2.5
PIR1 Register
Note:
REGISTER 3-5:
R/W-0
R-0
R-0
U-0
R/W-0
R/W-0
R/W-0
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
bit 7
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
Unimplemented: Read as 0
bit 2
bit 1
bit 0
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
DS40300C-page 23
PIC16F62X
3.2.2.6
PCON Register
REGISTER 3-6:
Note:
U-0
U-0
U-0
R/W-1
U-0
R/W-q
R/W-q
OSCF
POR
BOD
bit 7
bit 0
bit 7-4
bit 3
bit 2
bit 1
bit 0
DS40300C-page 24
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
PIC16F62X
3.3
FIGURE 3-3:
12
PCLATH<4:0>
Instruction with
PCL as
Destination
ALU result
PCLATH
PCH
11 10
PCL
8
0
GOTO, CALL
PC
2
PCLATH<4:3>
11
Opcode <10:0>
EXAMPLE 3-1:
COMPUTED GOTO
3.3.2
PCLATH
3.3.1
3.4
PCL
PC
12
LOADING OF PC IN
DIFFERENT SITUATIONS
PCH
NEXT
movlw
movwf
clrf
incf
btfss
goto
Indirect Addressing
0x20
FSR
INDF
FSR
FSR,4
NEXT
;initialize pointer
;to RAM
;clear INDF register
;inc pointer
;all done?
;no clear next
;yes continue
STACK
Preliminary
DS40300C-page 25
PIC16F62X
FIGURE 3-4:
RP1
RP0
bank select
from opcode
Indirect Addressing
0
IRP
bank select
location select
00
01
10
FSR register
location select
11
00h
180h
RAM
File
Registers
7Fh
1FFh
Bank 0
Note:
Bank 1
Bank 2
Bank 3
DS40300C-page 26
Preliminary
PIC16F62X
4.0
GENERAL DESCRIPTION
TABLE 4-1:
Clock
Memory
Table 4-1 shows the features of the PIC16F62X midrange microcontroller families.
A simplified block diagram of the PIC16F62X is shown
in Figure 2.1.
The PIC16F62X series fits in applications ranging from
battery chargers to low power remote sensors. The
FLASH technology makes customization of application
programs (detection levels, pulse generation, timers,
etc.) extremely fast and convenient. The small footprint
packages make this microcontroller series ideal for all
applications with space limitations. Low cost, low
power, high performance, ease of use and I/O flexibility
make the PIC16F62X very versatile.
4.1
Development Support
PIC16F627
PIC16F628
PIC16LF627
PIC16LF628
20
20
1024
2048
1024
2048
224
224
224
224
128
128
128
128
Comparator(s)
Capture/Compare/PWM modules
USART
USART
USART
USART
Yes
Yes
Yes
Yes
Interrupt Sources
10
10
10
10
I/O Pins
16
16
16
16
3.0-5.5
3.0-5.5
2.0-5.5
2.0-5.5
Serial Communications
Features
Timer Module(s)
Peripherals
Yes
Yes
Yes
Yes
All PICmicro Family devices have Power-on Reset, selectable Watchdog Timer, selectable code protect and high I/O current capability. All
PIC16F62X Family devices use serial programming with clock pin RB6 and data pin RB7.
Preliminary
DS40300C-page 27
PIC16F62X
NOTES:
DS40300C-page 28
Preliminary
PIC16F62X
5.0
I/O PORTS
5.1
Note:
EXAMPLE 5-1:
CLRF
PORTA
MOVLW 0x07
MOVWF CMCON
Initializing PORTA
;Initialize PORTA by
;setting output data latches
;Turn comparators off and
;enable pins for I/O
;functions
BCF
STATUS, RP1
BSF
STATUS, RP0;Select Bank1
MOVLW 0x1F
;Value used to initialize
;data direction
MOVWF TRISA
;Set RA<4:0> as inputs
;TRISA<5> always
;read as 1.
;TRISA<7:6>
;depend on oscillator mode
Preliminary
DS40300C-page 29
PIC16F62X
FIGURE 5-1:
Data
Bus
BLOCK DIAGRAM OF
RA0/AN0:RA1/AN1 PINS
WR
PORTA
Data
Bus
CK
FIGURE 5-2:
VDD
WR
PORTA
BLOCK DIAGRAM OF
RA2/VREF PIN
Q
CK
Data Latch
Data Latch
WR
TRISA
CK
VDD
I/O Pin
RA2 Pin
WR
TRISA
TRIS Latch
CK
VSS
TRIS Latch
VSS
Analog
Input Mode
Analog
Input Mode
RD
TRISA
Schmitt Trigger
Input Buffer
Schmitt Trigger
Input Buffer
RD
TRISA
Q
Q
D
EN
EN
RD PORTA
RD PORTA
To Comparator
To Comparator
VROE
VREF
FIGURE 5-3:
Data
Bus
VDD
Q
Comparator Output
WR
PORTA
1
CK
Data Latch
D
Q
RA3 Pin
WR
TRISA
CK
VSS
TRIS Latch
Analog
Input Mode
RD
TRISA
Schmitt Trigger
Input Buffer
EN
RD PORTA
To Comparator
DS40300C-page 30
Preliminary
PIC16F62X
FIGURE 5-4:
Data
Bus
Q
Comparator Output
WR
PORTA
VDD
1
CK
Q
0
Data Latch
D
Q
RA4 Pin
WR
TRISA
CK
Q
Vss
TRIS Latch
Vss
Schmitt Trigger
Input Buffer
RD TRISA
Q
EN
RD PORTA
FIGURE 5-5:
FIGURE 5-6:
BLOCK DIAGRAM OF
RA6/OSC2/CLKOUT PIN
RA5/MCLR/VPP PIN
From OSC1
OSC
Circuit
VDD
CLKOUT(FOSC/4)
1
MCLRE
MCLR
circuit
MCLR Filter
CK
Q
(FOSC =
Data
Latch
(2)
101, 111)
Schmitt Trigger
Input Buffer
Program
mode
WR
PORTA
VSS
HV Detect
RA5/MCLR/VPP
WR
TRISA
Data
Bus
CK
VSS
Q
Q
TRIS Latch
RD
TRISA
RD
TRISA
FOSC =
100, 110
VSS
Schmitt
Trigger
Input Buffer
(1)
Q
Q
D
EN
RD
PORTA
D
EN
RD PORTA
Note
Preliminary
1:
2:
DS40300C-page 31
PIC16F62X
FIGURE 5-7:
To OSC2
Oscillator
Circuit
VDD
CLKIN to core
Data Bus
WR PORTA
Q
RA7/OSC1/CLKIN Pin
CK
Data Latch
D
WR TRISA
CK
VSS
Q
Q
TRIS Latch
RD TRISA
D
Schmitt Trigger
Input Buffer
EN
RD PORTA
Note
1:
DS40300C-page 32
Preliminary
PIC16F62X
TABLE 5-1:
PORTA FUNCTIONS
Name
RA0/AN0
RA1/AN1
RA2/AN2/VREF
RA3/AN3/CMP1
RA4/T0CKI/CMP2
RA5/MCLR/VPP
Functio
n
Input
Type
Output
Type
RA0
AN0
RA1
AN1
RA2
AN2
VREF
RA3
AN3
CMP1
RA4
T0CKI
ST
AN
ST
AN
ST
AN
ST
AN
ST
ST
CMOS
CMOS
CMOS
AN
CMOS
CMOS
OD
CMP2
OD
RA5
ST
MCLR
ST
Master clear
Description
HV
Preliminary
DS40300C-page 33
PIC16F62X
TABLE 5-2:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
RA5
RA4
05h
PORTA
RA7
RA6
85h
TRISA
TRISA7
TRISA6
TRISA5 TRISA4
1Fh
CMCON
C2OUT
C1OUT
C2INV
9Fh
VRCON
VREN
VROE
VRR
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on
All Other
RESETS
xxxu 0000
RA3
RA2
RA1
RA0
xxxx 0000
TRISA3
TRISA2
TRISA1
TRISA0
1111 1111
1111 1111
C1INV
CIS
CM2
CM1
CM0
0000 0000
0000 0000
VR3
VR2
VR1
VR0
000- 0000
000- 0000
5.2
DS40300C-page 34
Preliminary
PIC16F62X
FIGURE 5-8:
BLOCK DIAGRAM OF
RB0/INT PIN
FIGURE 5-9:
BLOCK DIAGRAM OF
RB1/RX/DT PIN
VDD
VDD
RBPU
RBPU
P Weak Pull-up
PORT/PERIPHERAL
Weak
P Pull-up
VDD
Select(1)
VDD
USART Data Output
Data Bus
WR PORTB
WR TRISB
CK
WR PORTB
CK
Data Latch
Data Bus
Q
RB0/INT
CK
WR TRISB
Peripheral OE(2)
TRIS Latch
RB1/
RX/DT
VSS
Data Latch
VSS
CK
TRIS Latch
TTL
Input
Buffer
RD TRISB
TTL
Input
Buffer
RD TRISB
D
EN
D
RD PORTB
EN
EN
USART Receive Input
RD PORTB
Schmitt
Trigger
INT
Schmitt
Trigger
Note
1:
2:
Preliminary
DS40300C-page 35
PIC16F62X
FIGURE 5-10:
BLOCK DIAGRAM OF
RB2/TX/CK PIN
VDD
Weak
P Pull-up
VDD
RBPU
PORT/PERIPHERAL Select(1)
WR PORTB
CK
RB2/
TX/CK
CK
WR TRISB
PORT/PERIPHERAL Select(1)
Data Bus
WR PORTB
CK
TRIS Latch
Peripheral OE(2)
TTL
Input
Buffer
RD TRISB
CK
VSS
TRIS Latch
TTL
Input
Buffer
RD TRISB
EN
RD PORTB
EN
1:
2:
RD PORTB
Note
RB3/
CCP1
Data Latch
WR TRISB
VDD
Weak
P Pull-up
VDD
RBPU
VSS
Data Latch
D
BLOCK DIAGRAM OF
RB3/CCP1 PIN
Data Bus
Peripheral OE(2)
FIGURE 5-11:
DS40300C-page 36
Schmitt
Trigger
Note
1:
2:
Preliminary
PIC16F62X
FIGURE 5-12:
RBPU
P weak pull-up
Data Bus
WR PORTB
CK
VDD
Data Latch
WR TRISB
CK
RB4/PGM
VSS
TRIS Latch
RD TRISB
LVP
RD PORTB
PGM input
TTL
input
buffer
Schmitt
Trigger
EN
Q1
Set RBIF
From other
RB<7:4> pins
D
Q3
EN
Note 1: The low voltage programming disables the interrupt-on-change and the weak pull-ups on RB4.
Preliminary
DS40300C-page 37
PIC16F62X
FIGURE 5-13:
RBPU
weak VDD
P pull-up
Data Bus
CK
RB5 pin
WR PORTB
Data Latch
VSS
D
CK
WR TRISB
TRIS Latch
TTL
input
buffer
RD TRISB
RD PORTB
EN
Q1
Set RBIF
From other
RB<7:4> pins
D
Q3
EN
DS40300C-page 38
Preliminary
PIC16F62X
FIGURE 5-14:
RBPU
P weak pull-up
Data Bus
WR PORTB
CK
VDD
Data Latch
WR TRISB
CK
RB6/
T1OSO/
T1CKI
pin
VSS
TRIS Latch
RD TRISB
T1OSCEN
TTL
input
buffer
RD PORTB
TMR1 Clock
From RB7
Schmitt
Trigger
TMR1 oscillator
EN
Set RBIF
From other
RB<7:4> pins
D
Q3
EN
Preliminary
DS40300C-page 39
PIC16F62X
FIGURE 5-15:
RBPU
P weak pull-up
TMR1 oscillator
To RB6
VDD
Data Bus
WR PORTB
CK
RB7/T1OSI
pin
Data Latch
WR TRISB
CK
VSS
TRIS Latch
RD TRISB
T10SCEN
TTL
input
buffer
RD PORTB
EN
Set RBIF
From other
RB<7:4> pins
EN
DS40300C-page 40
Preliminary
PIC16F62X
TABLE 5-3:
PORTB FUNCTIONS
Name
Output
Type
RB0/INT
RB0
TTL
CMOS
RB1/RX/DT
INT
RB1
ST
TTL
CMOS
RB2/TX/CK
RX
DT
RB2
TX
CK
RB3/CCP1
RB3
RB4/PGM
CCP1
RB4
RB5
RB6/T1OSO/T1CKI/
PGC
RB6
T1OSO
T1CKI
PGC
RB7
RB7/T1OSI/PGD
T1OSI
PGD
Legend:
O = Output
= Not used
TTL = TTL Input
TABLE 5-4:
Address
External interrupt.
Bi-directional I/O port. Can be software programmed for
internal weak pull-up.
ST
CMOS
USART Transmit Pin
ST
CMOS
Synchronous Clock I/O. Can be software programmed
for internal weak pull-up.
TTL
CMOS
Bi-directional I/O port. Can be software programmed for
internal weak pull-up.
ST
CMOS
Capture/Compare/PWM/I/O
TTL
CMOS
Bi-directional I/O port. Can be software programmed for
internal weak pull-up.
ST
XTAL
Timer1 Oscillator Output
ST
PGM
RB5
Description
Name
Bit 7
Bit 6
RB7
RB6
TRISB7
TRISB6
RBPU
INTEDG
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on
All Other
RESETS
RB5
RB4
RB3
RB2
RB1
RB0
xxxx xxxx
uuuu uuuu
1111 1111
T0CS
T0SE
PSA
PS2
PS1
PS0
1111 1111
1111 1111
Preliminary
DS40300C-page 41
PIC16F62X
5.3
5.3.1
EXAMPLE 5-2:
FIGURE 5-16:
READ-MODIFY-WRITE
INSTRUCTIONS ON AN
I/O PORT
5.3.2
PC
MOWF PORTB
Write to PORTB
PC + 1
MOWF PORTB, W
Read to PORTB
PC + 2
NOP
PC + 3
NOP
Port pin
sampled here
TPD
Execute
MOVWF
PORTB
Note
1:
2:
Execute
MOVWF
PORTB
Execute
NOP
DS40300C-page 42
Preliminary
PIC16F62X
6.0
TIMER0 MODULE
6.2
8-bit timer/counter
Readable and writable
8-bit software programmable prescaler
Internal or external clock select
Interrupt on overflow from FFh to 00h
Edge select for external clock
6.1
6.2.1
EXTERNAL CLOCK
SYNCHRONIZATION
TIMER0 Interrupt
Preliminary
DS40300C-page 43
PIC16F62X
6.3
Timer0 Prescaler
FIGURE 6-1:
FOSC/4
0
1
T0CKI
Pin
SYNC
2
Cycles
1
0
T0SE
T0CS
PSA
Watchdog
Timer
WDT Postscaler/
TMR0 Prescaler
8
8-to-1MUX
PSA
TMR0 reg
PS0 - PS2
PSA
WDT
Timeout
Note 1: T0SE, T0CS, PSA, .PS0-PS2 are bits in the Option Register.
DS40300C-page 44
Preliminary
PIC16F62X
6.3.1
SWITCHING PRESCALER
ASSIGNMENT
EXAMPLE 6-1:
BCF
CLRWDT
CLRF
BSF
MOVLW
TMR0
STATUS, RP0
'00101111b
MOVWF
OPTION_REG
CLRWDT
MOVLW
MOVWF
BCF
'00101xxxb
OPTION_REG
STATUS, RP0
Address
01h
EXAMPLE 6-2:
CHANGING PRESCALER
(WDTTIMER0)
CLRWDT
CHANGING PRESCALER
(TIMER0WDT)
STATUS, RP0
TABLE 6-1:
;Skip if already in
;Bank 0
;Clear WDT
;Clear TMR0 & Prescaler
;Bank 1
;These 3 lines
;(5, 6, 7)
;are required only
;if desired PS<2:0>
;are
;000 or 001
;Set Postscaler to
;desired WDT rate
;Return to Bank 0
BSF
MOVLW
STATUS, RP0
b'xxxx0xxx'
MOVWF
BCF
OPTION_REG
STATUS, RP0
TMR0
0Bh/8Bh/
INTCON
10Bh/18Bh
81h, 181h
OPTION(2)
85h
TRISA
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on
All Other
RESETS
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
TRISA2
TRISA1
TRISA7
Legend:
= Unimplemented locations, read as 0, u = unchanged, x = unknown
Note 1: Shaded bits are not used by TMR0 module.
2: Option is referred by OPTION_REG in MPLAB.
Preliminary
DS40300C-page 45
PIC16F62X
7.0
TIMER1 MODULE
As a timer
As a counter
REGISTER 7-1:
U-0
R/W-0
R/W-0
T1CKPS1 T1CKPS0
R/W-0
T1OSCEN
R/W-0
R/W-0
R/W-0
bit 7
bit 0
bit 7-6
bit 5-4
bit 3
bit 2
bit 1
bit 0
DS40300C-page 46
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
PIC16F62X
7.1
7.2.1
7.2
FIGURE 7-1:
Synchronized
TMR1
Clock Input
TMR1L
1
TMR1ON
T1SYNC
T1OSC
RB6/T1OSO/T1CKI
1
T1OSCEN
Enable
Oscillator(1)
RB7/T1OSI
FOSC/4
Internal
Clock
Prescaler
1, 2, 4, 8
Synchronize
det
0
2
SLEEP Input
T1CKPS1:T1CKPS0
TMR1CS
Note
1:
When the T1OSCEN bit is cleared, the inverter and feedback resistor are turned off. This eliminates power drain.
Preliminary
DS40300C-page 47
PIC16F62X
7.3
Timer1 Operation in
Asynchronous Counter Mode
EXAMPLE 7-1:
7.3.1
7.3.2
; All interrupts
MOVF
TMR1H,
MOVWF TMPH
MOVF
TMR1L,
MOVWF TMPL
MOVF
TMR1H,
SUBWF TMPH,
BTFSC
GOTO
are disabled
W ;Read high byte
;
W ;Read low byte
;
W ;Read high byte
W ;Sub 1st read
; with 2nd read
STATUS,Z ;Is result = 0
CONTINUE ;Good 16-bit read
;
; TMR1L may have rolled over between the read
; of the high and low bytes. Reading the high
; and low bytes now will read a good value.
;
MOVF
TMR1H, W ;Read high byte
MOVWF TMPH
;
MOVF
TMR1L, W ;Read low byte
MOVWF TMPL
;
; Re-enable the Interrupts (if required)
CONTINUE
;Continue with your code
DS40300C-page 48
Preliminary
PIC16F62X
7.4
Timer1 Oscillator
7.5
TABLE 7-1:
Osc Type
C1
Timer1 must be configured for either Timer or Synchronized Counter mode to take advantage of this feature.
If Timer1 is running in Asynchronous Counter mode,
this RESET operation may not work.
C2
LP
32 kHz
33 pF
33 pF
100 kHz
15 pF
15 pF
200 kHz
15 pF
15 pF
Note 1: These values are for design guidance only.
Consult AN826 (DS00826A) for further
information on Crystal/Capacitor Selection.
7.6
7.7
Timer1 Prescaler
TABLE 7-2:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on
all other
RESETS
0Bh/8Bh/
10Bh/18Bh
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0000 000x
0000 000u
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
8Ch
PIE1
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
TMR1IE
0000 -000
0000 -000
0Eh
TMR1L
Holding register for the Least Significant Byte of the 16-bit TMR1 register
xxxx xxxx
uuuu uuuu
0Fh
TMR1H
Holding register for the Most Significant Byte of the 16-bit TMR1 register
xxxx xxxx
uuuu uuuu
10h
T1CON
--00 0000
--uu uuuu
Legend:
T1CKPS1
T1CKPS0
T1OSCEN
T1SYNC
TMR1CS
TMR1ON
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the Timer1 module.
Preliminary
DS40300C-page 49
PIC16F62X
8.0
TIMER2 MODULE
8.1
8.2
Output of TMR2
FIGURE 8-1:
Sets flag
bit TMR2IF
TMR2
output (1)
RESET
Postscaler
1:1 to 1:16
EQ
TMR2 reg
Comparator
Prescaler
1:1, 1:4, 1:16
FOSC/4
2
T2CKPS<1:0>
PR2 reg
TOUTPS<3:0>
Note
DS40300C-page 50
Preliminary
1:
PIC16F62X
REGISTER 8-1:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
TOUTPS0
R/W-0
R/W-0
bit 7
bit 0
bit 7
bit 6-3
bit 2
bit 1-0
TABLE 8-1:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
Address Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
Value on
all other
POR
RESETS
0000 000x 0000 000u
0Bh/8Bh/
10Bh/18Bh
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
TMR1IE
8Ch
PIE1
11h
TMR2
12h
T2CON
92h
PR2
Legend:
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the Timer2 module.
Preliminary
DS40300C-page 51
PIC16F62X
NOTES:
DS40300C-page 52
Preliminary
PIC16F62X
9.0
COMPARATOR MODULE
REGISTER 9-1:
R-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
C2OUT
C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
bit 7
bit 7
bit 0
bit 6
bit 5
bit 4
bit 3
bit 2-0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
DS40300C-page 53
PIC16F62X
9.1
Comparator Configuration
FIGURE 9-1:
VIN-
RA3/AN3/CMP1
VIN+
RA1/AN1
VIN-
RA2/AN2
VIN+
C1
RA0/AN0
VIN-
RA3/AN3/CMP1
VIN+
VIN-
VIN+
RA1/AN1
C2
RA2/AN2
C1
C2
VSS
Four Inputs Multiplexed to Two Comparators
CM2:CM0 = 010
VIN+
RA3/AN3/CMP1
RA0/AN0
VIN-
RA0/AN0
RA1/AN1
VIN-
RA2/AN2
VIN+
C1
C2
C1VOUT
A
CIS = 0
CIS = 1
RA3/AN3/CMP1 A
RA1/AN1
RA2/AN2
CIS = 0
CIS = 1
C2VOUT
VINVIN+
C1
C1VOUT
C2
C2VOUT
VINVIN+
From VREF
Module
Two Common Reference Comparators
CM2:CM0 = 011
RA0/AN0
VIN+
RA1/AN1
VIN-
RA2/AN2
VIN+
VIN-
RA3/AN3/CMP1
VIN+
RA1/AN1
VIN-
RA2/AN2/CMP2
VIN+
RA0/AN0
VIN-
A
D
RA3/AN3/CMP1
C1
C2
C1VOUT
C2VOUT
VIN-
RA3/AN3/CMP1 D
VIN+
RA0/AN0
C1
VSS
RA1/AN1
RA2/AN2
VIN-
VIN+
C1VOUT
C2
C2VOUT
Open Drain
RA4/T0CKI/C20
One Independent Comparator
CM2:CM0 = 101
C1
C2
C2VOUT
RA1/AN1
VIN-
RA2/AN2
VIN+
C2
C2VOUT
DS40300C-page 54
Preliminary
PIC16F62X
The code example in Example 9-1 depicts the steps
required to configure the Comparator module. RA3 and
RA4 are configured as digital output. RA0 and RA1 are
configured as the V- inputs and RA2 as the V+ input to
both comparators.
EXAMPLE 9-1:
FLAG_REG
CLRF
CLRF
MOVF
ANDLW
IORWF
MOVLW
MOVWF
BSF
MOVLW
MOVWF
FIGURE 9-2:
SINGLE COMPARATOR
ViN+
VIN-
Result
INITIALIZING
COMPARATOR MODULE
EQU
FLAG_REG
PORTA
CMCON, W
0xC0
FLAG_REG,F
0x03
CMCON
STATUS,RP0
0x07
TRISA
BCF
CALL
MOVF
BCF
BSF
BSF
BCF
BSF
BSF
0X20
;Init flag register
;Init PORTA
;Load comparator bits
;Mask comparator bits
;Store bits in flag register
;Init comparator mode
;CM<2:0> = 011
;Select Bank1
;Initialize data direction
;Set RA<2:0> as inputs
;RA<4:3> as outputs
;TRISA<7:5> always read 0
STATUS,RP0 ;Select Bank 0
DELAY10
;10s delay
CMCON,F
;Read CMCON to end change condition
PIR1,CMIF
;Clear pending interrupts
STATUS,RP0 ;Select Bank 1
PIE1,CMIE
;Enable comparator interrupts
STATUS,RP0 ;Select Bank 0
INTCON,PEIE ;Enable peripheral interrupts
INTCON,GIE ;Global interrupt enable
9.2
Comparator Operation
VINVIN+
Result
9.3.1
9.3.2
9.3
9.4
Comparator Reference
Preliminary
DS40300C-page 55
PIC16F62X
9.5
Comparator Outputs
FIGURE 9-3:
CnVOUT
To Data Bus
CMCON<7:6>
EN
RD CMCON
Q1
EN
CL
From other Comparator
DS40300C-page 56
RESET
Preliminary
PIC16F62X
9.6
Comparator Interrupts
9.7
9.8
Effects of a RESET
9.9
Preliminary
DS40300C-page 57
PIC16F62X
FIGURE 9-4:
RS < 10K
AIN
CPIN
5 pF
VA
VT = 0.6V
RIC
ILEAKAGE
500 nA
VSS
CPIN
VT
ILEAKAGE
RIC
RS
VA
Legend
TABLE 9-1:
Address
1Fh
= Input Capacitance
= Threshold Voltage
= Leakage Current At The Pin
= Interconnect Resistance
= Source Impedance
= Analog Voltage
Name
CMCON
Bit 7
Bit 6
C2OUT C1OUT
Value on
POR
Value on
All Other
RESETS
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
C2INV
C1NV
CIS
CM2
CM1
CM0
T0IF
INTF
RBIF
0Bh/8Bh/
INTCON
10Bh/18Bh
GIE
PEIE
T0IE
INTE
RBIE
0Ch
EEIF
CMIF
RCIF
TXIF
EEIE
CMIE
RCIE
TXIE
PIR1
8Ch
PIE1
85h
TRISA
Legend:
TRISA3
TRISA2
TRISA1
DS40300C-page 58
Preliminary
PIC16F62X
10.0
VOLTAGE REFERENCE
MODULE
10.1
REGISTER 10-1:
R/W-0
R/W-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
VREN
VROE
VRR
VR3
VR2
VR1
VR0
bit 7
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3-0
FIGURE 10-1:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
x = Bit is unknown
VREN
16 Stages
8R
8R
Vrr
VSS
VSS
Vr3
Vref
(From VRCON<3:0>)
Note
1:
Preliminary
DS40300C-page 59
PIC16F62X
EXAMPLE 10-1:
10.4
VOLTAGE REFERENCE
CONFIGURATION
MOVLW
0x02
; 4 Inputs Muxed
MOVWF
BSF
CMCON
STATUS,RP0
; to 2 comps.
; go to Bank 1
MOVLW
MOVWF
0x07
TRISA
; RA3-RA0 are
; outputs
MOVLW
0xA6
; enable VREF
MOVWF
VRCON
; low range
10.5
STATUS,RP0
; go to Bank 0
CALL
DELAY10
; 10s delay
10.2
10.3
Connection Considerations
The
Voltage
Reference
module
operates
independently of the Comparator module. The output
of the reference generator may be connected to the
RA2 pin if the TRISA<2> bit is set and the VROE bit,
VRCON<6>, is set. Enabling the Voltage Reference
output onto the RA2 pin with an input signal present will
increase current consumption. Connecting RA2 as a
digital output with VREF enabled will also increase
current consumption.
; set VR<3:0>=6
BCF
Effects of a RESET
FIGURE 10-2:
VREF
Module
R(1)
Op Amp
RA2
VREF Output
Voltage
Reference
Output
Impedance
Note 1: R is dependent upon the Voltage Reference Configuration VRCON<3:0> and VRCON<5>.
TABLE 10-1:
Address
Name
Bit 7
Bit 6
VREN
VROE
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value On
POR
Value On
All Other
RESETS
9Fh
VRCON
VRR
VR3
VR2
VR1
VR0
000- 0000
000- 0000
1Fh
CMCON
C2OUT C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
0000 0000
0000 0000
85h
TRISA
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
1111 1111
1111 1111
DS40300C-page 60
Preliminary
PIC16F62X
11.0
CAPTURE/COMPARE/PWM
(CCP) MODULE
TABLE 11-1:
CCP Mode
Timer Resource
Capture
Compare
PWM
Timer1
Timer1
Timer2
CCP1 Module
Capture/Compare/PWM Register1 (CCPR1) is comprised of two 8-bit registers: CCPR1L (low byte) and
CCPR1H (high byte). The CCP1CON register controls
the operation of CCP1. All are readable and writable.
Additional information on the CCP module is available
in the PICmicro Mid-Range Reference Manual,
(DS33023).
REGISTER 11-1:
U-0
R/W-0
R/W-0
R/W-0
CCP1X
CCP1Y
CCP1M3
R/W-0
R/W-0
R/W-0
bit 7
bit 0
bit 7-6
bit 5-4
bit 3-0
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
DS40300C-page 61
PIC16F62X
11.1
Capture Mode
EXAMPLE 11-1:
11.1.1
If the RB3/CCP1 is configured as an output, a write to the port can cause a capture
condition.
TABLE 11-2:
Prescaler
1, 4, 16
RB3/CCP1
Pin
CCPR1H
and
edge detect
CCPR1L
Capture
Enable
TMR1H
CLRF
MOVLW
CCP1CON
NEW_CAPT_PS
MOVWF
CCP1CON
11.2
CHANGING BETWEEN
CAPTURE PRESCALERS
;Turn CCP module off
;Load the W reg with
; the new prescaler
; mode value and CCP ON
;Load CCP1CON with this
; value
Compare Mode
FIGURE 11-1:
COMPARE MODE
OPERATION BLOCK
DIAGRAM
TMR1L
CCP1CON<3:0>
Qs
11.1.2
Timer1 must be running in Timer mode or Synchronized Counter mode for the CCP module to use the
capture feature. In Asynchronous Counter mode, the
capture operation may not work.
11.1.3
Comparator
TMR1H
TMR1L
SOFTWARE INTERRUPT
11.1.4
Q S Output
Logic
match
RB3/CCP1
R
Pin
TRISB<3>
Output Enable CCP1CON<3:0>
Mode Select
11.2.1
CCP PRESCALER
DS40300C-page 62
Preliminary
PIC16F62X
11.2.2
11.2.4
Timer1 must be running in Timer mode or Synchronized Counter mode if the CCP module is using the
compare feature. In Asynchronous Counter mode, the
compare operation may not work.
11.2.3
TABLE 11-3:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
RBIF
Value on
POR
Value on
all other
RESETS
0Bh/8Bh/
10Bh/
18Bh
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
8Ch
PIE1
EEIE
CMIF
RCIE
TXIE
CCP1IE
TMR2IE
87h
TRISB
0Eh
TMR1L
Holding register for the Least Significant Byte of the 16-bit TMR1 register
0Fh
TMR1H
Holding register for the Most Significant Byte of the 16-bit TMR1register
10h
T1CON
15h
CCPR1L
16h
CCPR1H
17h
CCP1CON
Legend:
T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON --00 0000 --uu uuuu
CCP1X
CCP1Y
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by Capture and Timer1.
Preliminary
DS40300C-page 63
PIC16F62X
11.3
PWM Mode
FIGURE 11-3:
PWM OUTPUT
Period
Duty Cycle
TMR2 = PR2
FIGURE 11-2:
CCP1CON<5:4>
11.3.1
PWM PERIOD
CCPR1L
Comparator
TMR2
(Note 1)
Q
RB3/CCP1
S
TRISB<3>
Comparator
Clear Timer,
CCP1 pin and
latch D.C.
PR2
TMR2 is cleared
The CCP1 pin is set (exception: if PWM duty
cycle = 0%, the CCP1 pin will not be set)
The PWM duty cycle is latched from CCPR1L into
CCPR1H
Note:
Note
1:
DS40300C-page 64
Preliminary
PIC16F62X
11.3.2
EQUATION 11-2:
EQUATION 11-1:
Note:
11.3.3
PWM Frequency
1.22 kHz 4.88 kHz 19.53 kHz 78.12 kHz 156.3 kHz 208.3 kHz
Address
bits
TABLE 11-5:
Fosc
log (Fpwm x TMR2 Prescaler )
log (2)
TABLE 11-4:
PWM
Resolution =
MAXIMUM PWM
RESOLUTION
16
0xFF
10
4
0xFF
10
1
0xFF
10
1
0x3F
8
1
0x1F
7
1
0x17
6.5
Name
0Bh/8Bh/
10Bh/18Bh
INTCON
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on
all other
RESETS
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0000 000x
0000 000u
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
8Ch
PIE1
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
TMR1IE
0000 -000
0000 -000
87h
TRISB
1111 1111
1111 1111
11h
TMR2
0000 0000
0000 0000
92h
PR2
1111 1111
1111 1111
12h
T2CON
15h
CCPR1L
16h
CCPR1H
17h
CCP1CON
Legend:
CCP1X
CCP1Y
CCP1M3
TMR2ON
CCP1M2
T2CKPS1 T2CKPS0
CCP1M1
CCP1M0
-000 0000
uuuu
xxxx xxxx
uuuu uuuu
xxxx xxxx
uuuu uuuu
--00 0000
--00 0000
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by PWM and Timer2.
Preliminary
DS40300C-page 65
PIC16F62X
NOTES:
DS40300C-page 66
Preliminary
PIC16F62X
12.0
UNIVERSAL SYNCHRONOUS/
ASYNCHRONOUS RECEIVER/
TRANSMITTER (USART)
MODULE
REGISTER 12-1:
R/W-0
R/W-0
R/W-0
U-0
R/W-0
R-1
R/W-0
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
bit 7
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Legend:
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
DS40300C-page 67
PIC16F62X
REGISTER 12-2:
R/W-0
R/W-0
R/W-0
R/W-0
R-0
R-0
R-x
SPEN
RX9
SREN
CREN
ADEN
FERR
OERR
RX9D
bit 7
bit 0
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2
bit 1
bit 0
Legend:
DS40300C-page 68
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
PIC16F62X
12.1
EXAMPLE 12-1:
BRGH = 0
SYNC = 0
TABLE 12-1:
SYNC
0
1
Legend:
Address
Name
98h
TXSTA
18h
RCSTA
99h
SPBRG
Legend:
TABLE 12-2:
CALCULATING BAUD
RATE ERROR
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on all
other
RESETS
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
0000 -010
0000 -010
SPEN
RX9
SREN
CREN
ADEN
FERR
OERR
RX9D
0000 -00x
0000 -00x
0000 0000
0000 0000
Preliminary
DS40300C-page 69
PIC16F62X
TABLE 12-3:
BAUD
RATE (K)
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
BAUD
RATE (K)
FOSC = 20 MHz
KBAUD
ERROR
NA
NA
NA
NA
19.53
76.92
96.15
294.1
500
5000
19.53
+1.73%
+0.16%
+0.16%
-1.96
0
SPBRG 16 MHz
value
KBAUD
(decimal)
255
64
51
16
9
0
255
NA
NA
NA
NA
19.23
76.92
95.24
307.69
500
4000
15.625
ERROR
+0.16%
+0.16%
-0.79%
+2.56%
0
207
51
41
12
7
0
255
NA
NA
NA
9.766
19.23
75.76
96.15
312.5
500
2500
9.766
SPBRG 4 MHz
value
KBAUD
(decimal)
ERROR
SPBRG
value
(decimal)
+1.73%
+0.16%
-1.36%
+0.16%
+4.17%
0
255
129
32
25
7
4
0
255
ERROR
SPBRG
value
(decimal)
KBAUD
ERROR
0.3
1.2
2.4
9.6
19.2
76.8
96
300
NA
NA
NA
9.622
19.24
77.82
94.20
298.3
+0.23%
+0.23%
+1.32
-1.88
-0.57
185
92
22
18
5
NA
NA
NA
9.6
19.2
79.2
97.48
316.8
0
0
+3.13%
+1.54%
5.60%
131
65
15
12
3
NA
NA
NA
9.615
19.231
75.923
1000
NA
500
NA
NA
NA
HIGH
LOW
1789.8
6.991
0
255
1267
4.950
0
255
100
3.906
0
255
ERROR
SPBRG
value
(decimal)
+1.14%
-2.48%
26
6
BAUD
RATE
(K)
SPBRG 1 MHz
value
KBAUD
(decimal)
ERROR
SPBRG 10 MHz
value
KBAUD
(decimal)
KBAUD
ERROR
0.3
1.2
2.4
NA
NA
NA
NA
1.202
2.404
+0.16%
+0.16%
207
103
0.303
1.170
NA
9.6
19.2
76.8
9.622
19.04
74.57
+0.23%
-0.83%
-2.90%
92
46
11
9.615
19.24
83.34
+0.16%
+0.16%
+8.51%
25
12
2
NA
NA
NA
96
99.43
+3.57%
NA
298.3
NA
0.57%
NA
NA
NA
300
500
NA
HIGH
LOW
894.9
3.496
0
255
250
0.9766
0
255
8.192
0.032
DS40300C-page 70
ERROR
+0.16%
+0.16%
+0.16%
+4.17%
Preliminary
103
51
12
9
0
255
PIC16F62X
TABLE 12-4:
BAUD
RATE (K)
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
BAUD
RATE (K)
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
BAUD
RATE
(K)
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
FOSC = 20 MHz
KBAUD
ERROR
NA
1.221
2.404
9.469
19.53
78.13
104.2
312.5
NA
312.5
1.221
+1.73%
+0.16%
-1.36%
+1.73%
+1.73%
+8.51%
+4.17%
ERROR
NA
1.203
2.380
9.322
18.64
NA
NA
NA
NA
111.9
0.437
+0.23%
-0.83%
-2.90%
-2.90%
ERROR
0.301
1.190
2.432
9.322
18.64
NA
NA
NA
NA
55.93
0.2185
+0.23%
-0.83%
+1.32%
-2.90%
-2.90%
SPBRG 16 MHz
value
KBAUD
(decimal)
255
129
32
15
3
2
0
0
255
NA
1.202
2.404
9.615
19.23
83.33
NA
NA
NA
250
0.977
92
46
11
5
0
255
0.31
1.2
2.4
9.9
19.8
79.2
NA
NA
NA
79.2
0.3094
SPBRG 1 MHz
value
KBAUD
(decimal)
185
46
22
5
2
0
255
0.300
1.202
2.232
NA
NA
NA
NA
NA
NA
15.63
0.0610
ERROR
+0.16%
+0.16%
+0.16%
+0.16%
+8.51%
ERROR
+3.13%
0
0
+3.13%
+3.13%
+3.13%
ERROR
+0.16%
+0.16%
-6.99%
Preliminary
SPBRG 10 MHz
value
KBAUD
(decimal)
207
103
25
12
2
0
255
NA
1.202
2.404
9.766
19.53
78.13
NA
NA
NA
156.3
0.6104
SPBRG 4 MHz
value
KBAUD
(decimal)
255
65
32
7
3
0
0
255
0.3005
1.202
2.404
NA
NA
NA
NA
NA
NA
62.500
3.906
0
255
0.256
NA
NA
NA
NA
NA
NA
NA
NA
0.512
0.0020
ERROR
SPBRG
value
(decimal)
+0.16%
+0.16%
+1.73%
+1.73V
+1.73%
129
64
15
7
1
0
255
ERROR
SPBRG
value
(decimal)
-0.17%
+1.67%
+1.67%
207
51
25
0
255
ERROR
SPBRG
value
(decimal)
-14.67%
0
255
DS40300C-page 71
PIC16F62X
TABLE 12-5:
BAUD
RATE (K)
9600
19200
38400
57600
115200
250000
625000
1250000
BAUD
RATE (K)
9600
19200
38400
57600
115200
250000
625000
1250000
BAUD
RATE
(K)
9600
19200
38400
57600
115200
250000
625000
1250000
FOSC = 20 MHz
KBAUD
ERROR
9.615
19.230
37.878
56.818
113.636
250
625
1250
+0.16%
+0.16%
-1.36%
-1.36%
-1.36%
0
0
0
ERROR
9.520
19.454
37.286
55.930
111.860
NA
NA
NA
-0.83%
+1.32%
-2.90%
-2.90%
-2.90%
ERROR
9725.543
18640.63
37281.25
55921.88
111243.8
223687.5
NA
NA
1.308%
-2.913%
-2.913%
-2.913%
-2.913%
-10.525%
DS40300C-page 72
SPBRG 16 MHz
value
KBAUD
(decimal)
129
64
32
21
10
4
1
0
9.615
19.230
38.461
58.823
111.111
250
NA
NA
9598.485
18632.35
39593.75
52791.67
105583.3
316750
NA
NA
SPBRG 1 MHz
value
KBAUD
(decimal)
22
11
5
3
1
0
8.928
20833.3
31250
62500
NA
NA
NA
NA
ERROR
+0.16%
+0.16%
+0.16%
+2.12%
-3.55%
0
ERROR
0.016%
-2.956%
3.109%
-8.348%
-8.348%
26.700%
ERROR
-6.994%
8.507%
-18.620%
+8.507
Preliminary
SPBRG 10 MHz
value
KBAUD
(decimal)
103
51
25
16
8
3
9.615
18.939
39.062
56.818
125
NA
625
NA
SPBRG 4 MHz
value
KBAUD
(decimal)
32
16
7
5
2
0
9615.385
19230.77
35714.29
62500
125000
250000
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
ERROR
SPBRG
value
(decimal)
+0.16%
-1.36%
+1.7%
-1.36%
+8.51%
64
32
15
10
4
ERROR
SPBRG
value
(decimal)
0.160%
0.160%
-6.994%
8.507%
8.507%
0.000%
25
12
6
3
1
0
ERROR
SPBRG
value
(decimal)
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
NA
PIC16F62X
The data on the RB1/RX/DT pin is sampled three times
by a majority detect circuit to determine if a high or a
low level is present at the RX pin. If bit BRGH
(TXSTA<2>) is clear (i.e., at the low baud rates), the
sampling is done on the seventh, eighth and ninth
falling edges of a x16 clock (Figure 12-3). If bit BRGH
is set (i.e., at the high baud rates), the sampling is done
on the 3 clock edges preceding the second rising edge
after the first falling edge of a x4 clock (Figure 12-4 and
Figure 12-5).
FIGURE 12-1:
RX
(RB1/RX/DT pin)
Bit0
Baud CLK for all but START bit
baud CLK
x16 CLK
1
10
11
12
13
14
15
16
Samples
FIGURE 12-2:
START Bit
Bit1
baud clk
First falling edge after RX pin goes low
Second rising edge
x4 clk
1
Q2, Q4 clk
Samples
FIGURE 12-3:
Samples
Samples
RX pin
START Bit
Bit0
Baud CLK for all but START bit
Baud CLK
Q2, Q4 CLK
Samples
Preliminary
DS40300C-page 73
PIC16F62X
FIGURE 12-4:
RX
(RB1/RX/DT pin)
Bit0
Baud CLK for all but START bit
Baud CLK
x16 CLK
1
10
11
12
13
14
15
16
Samples
12.2
12.2.1
USART ASYNCHRONOUS
TRANSMITTER
DS40300C-page 74
Preliminary
PIC16F62X
FIGURE 12-5:
TXREG register
8
TXIE
MSb
(8)
LSb
0
2 2 2
Pin Buffer
and Control
TSR register
RB2/TX/CK pin
Interrupt
TXEN
SPEN
SPBRG
TX9
TX9D
2.
3.
4.
5.
6.
7.
FIGURE 12-6:
ASYNCHRONOUS TRANSMISSION
Write to TXREG
BRG output
(shift clock)
Word 1
RB2/TX/CK (pin)
START Bit
Bit 1
Bit 7/8
STOP Bit
WORD 1
TXIF bit
(Transmit buffer
reg. empty flag)
TRMT bit
(Transmit shift
reg. empty flag)
Bit 0
WORD 1
Transmit Shift Reg
Preliminary
DS40300C-page 75
PIC16F62X
FIGURE 12-7:
Write to TXREG
WORD 1
BRG output
(shift clock)
RB2/TX/CK (pin)
START Bit
TXIF bit
(interrupt reg. flag)
TRMT bit
(Transmit shift
reg. empty flag)
Note
1:
Bit 1
WORD 1
Bit 7/8
STOP Bit
START Bit
Bit 0
WORD 2
WORD 2
Transmit Shift Reg.
Name
Bit 7
Bit 6
0Ch
18h
PIR1
RCSTA
EEIF
CMIF
RCIF
SPEN
RX9
SREN
19h
8Ch
98h
TXSTA
99h
Bit 0
WORD 1
Transmit Shift Reg.
TABLE 12-6:
Address
WORD 2
Bit 5
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on
all other
RESETS
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
CREN
ADEN
FERR
OERR
RX9D
0000 -00x
0000 -00x
0000 0000
0000 -000
0000 0000
0000 -000
0000 -010
0000 0000
0000 -010
0000 0000
Bit 4
TXIE
CCP1IE
TMR2IE
TMR1IE
CSRC
TX9
TXEN
SYNC
SPBRG Baud Rate Generator Register
BRGH
TRMT
TX9D
DS40300C-page 76
Preliminary
PIC16F62X
12.2.2
FIGURE 12-8:
FERR
OERR
CREN
SPBRG
64
or
16
MSb
Stop (8)
RSR register
LSb
0 Start
RB1/RX/DT
Pin Buffer
and Control
Data
Recovery
RX9
8
SPEN
RX9
ADEN
Enable
Load of
RX9
ADEN
RSR<8>
Receive
Buffer
8
RX9D
RCREG register
RX9D
RCREG register
FIFO
8
Interrupt
RCIF
Data Bus
RCIE
Preliminary
DS40300C-page 77
PIC16F62X
FIGURE 12-9:
RB1/RX/DT (PIN)
BIT1
BIT8 STOP
BIT
START
BIT BIT0
BIT8
STOP
BIT
READ RCV
BUFFER REG
RCREG
WORD 1
RCREG
RCIF
(INTERRUPT FLAG)
'1'
ADEN = 1
(ADDRESS MATCH
ENABLE)
'1'
Note 1: This timing diagram shows a data byte followed by an address byte. The data byte is not read into the RCREG
(Receive Buffer) because ADEN = 1 and Bit 8 = 0.
FIGURE 12-10:
RB1/RX/DT (PIN)
RCV SHIFT
REG
RCV BUFFER REG
BIT1
BIT8 STOP
BIT
START
BIT BIT0
READ RCV
BUFFER REG
RCREG
BIT8
STOP
BIT
RCIF
(INTERRUPT FLAG)
'1'
ADEN = 1
(ADDRESS MATCH
ENABLE)
'1'
Note 1: This timing diagram shows an address byte followed by an data byte. The data byte is not read into the RCREG
(receive buffer) because ADEN was not updated (still = 1) and Bit 8 = 0.
FIGURE 12-11:
RB1/RX/DT (PIN)
RCV SHIFT
REG
RCV BUFFER REG
READ RCV
BUFFER REG
RCREG
BIT1
BIT8 STOP
BIT
START
BIT BIT0
BIT8
STOP
BIT
WORD 2
RCREG
RCIF
(INTERRUPT FLAG)
ADEN
(ADDRESS MATCH
ENABLE)
Note 1: This timing diagram shows an address byte followed by an data byte. The data byte is read into the RCREG
(Receive Buffer) because ADEN was updated after an address match, and was cleared to a 0, so the contents of
the Receive Shift Register (RSR) are read into the Receive Buffer regardless of the value of Bit 8.
DS40300C-page 78
Preliminary
PIC16F62X
Steps to follow when setting up an Asynchronous
Reception:
1.
2.
3.
4.
5.
6.
7.
8.
9.
TABLE 12-7:
Address
Name
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on
all other
RESETS
EEIF
CMIF RCIF
TXIF
BRGH
TRMT
TX9D 0000 -010 0000 -010
99h
SPBRG Baud Rate Generator Register
0000 0000 0000 0000
Legend: x = unknown, - = unimplemented locations read as '0'. Shaded cells are not used for Asynchronous Reception.
Preliminary
DS40300C-page 79
PIC16F62X
12.3
USART Function
12.3.1
TABLE 12-8:
Address
Name
The ADEN bit will only take effect when the receiver is
configured in 9-bit mode (RX9 = '1'). When ADEN is
disabled (='0'), all data bytes are received and the 9th
bit can be used as the PARITY bit.
Reception is
(RCSTA<4>).
12.3.1.1
enabled
by
setting
bit
CREN
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on
all other
RESETS
EEIF
CMIF
RCIF
TXIF
BRGH
TRMT
TX9D 0000 -010 0000 -010
99h
SPBRG Baud Rate Generator Register
0000 0000 0000 0000
Legend: x = unknown, - = unimplemented locations read as '0'. Shaded cells are not used for Asynchronous Reception.
DS40300C-page 80
Preliminary
PIC16F62X
12.4
12.4.1
Preliminary
DS40300C-page 81
PIC16F62X
TABLE 12-9:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on all
other
RESETS
EEIF
CMIF RCIF TXIF
BRGH
TRMT
TX9D 0000 -010 0000 -010
99h
SPBRG Baud Rate Generator Register
0000 0000 0000 0000
Legend: x = unknown, - = unimplemented, read as '0'. Shaded cells are not used for Synchronous Master Transmission.
FIGURE 12-12:
SYNCHRONOUS TRANSMISSION
RB1/RX/DT Pin
Bit 0
Bit 1
WORD 1
Bit 2
Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4
Bit 7
Bit 0
Bit 1
WORD 2
Bit 7
RB2/TX/CK Pin
WRITE to
TXREG REG
Write WORD1
Write WORD2
TXIF Bit
(Interrupt Flag)
TRMTTRMT
Bit
TXEN Bit
Note
1:
'1'
'1'
FIGURE 12-13:
RB1/RX/DT pin
Bit0
Bit1
Bit2
Bit6
Bit7
RB2/TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
DS40300C-page 82
Preliminary
PIC16F62X
12.4.2
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR
Value on all
other
RESETS
EEIF
CMIF RCIF TXIF
BRGH
TRMT
TX9D 0000 -010 0000 -010
98h
TXSTA
CSRC
99h
SPBRG Baud Rate Generator Register
0000 0000 0000 0000
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used for Synchronous Master Reception.
Preliminary
DS40300C-page 83
PIC16F62X
FIGURE 12-14:
RB1/RX/DT PIN
BIT0
BIT1
BIT2
BIT3
BIT4
BIT5
BIT6
BIT7
RB2/TX/CK PIN
WRITE TO
BIT SREN
SREN BIT
CREN BIT '0'
'0'
RCIF BIT
(INTERRUPT)
READ
RXREG
Note 1: Timing diagram demonstrates Sync Master mode with bit SREN = 1 and bit BRG = 0.
12.5
12.5.1
b)
c)
d)
e)
1.
2.
3.
4.
5.
a)
6.
7.
DS40300C-page 84
Preliminary
PIC16F62X
12.5.2
3.
4.
5.
6.
7.
8.
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on all
other
RESETS
EEIF
CMIF RCIF TXIF
BRGH
TRMT
TX9D 0000 -010 0000 -010
99h
SPBRG Baud Rate Generator Register
0000 0000 0000 0000
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used for Synchronous Slave Transmission.
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on all
other
RESETS
EEIF
CMIF RCIF TXIF
BRGH
TRMT
TX9D 0000 -010 0000
99h
SPBRG Baud Rate Generator Register
0000 0000 0000
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used for Synchronous Slave Reception.
Preliminary
-000
-00x
0000
-000
-010
0000
DS40300C-page 85
PIC16F62X
NOTES:
DS40300C-page 86
Preliminary
PIC16F62X
13.0
EECON1
EECON2 (Not a physically implemented register)
EEDATA
EEADR
REGISTER 13-1:
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Reserved
EADR6
EADR5
EADR4
EADR3
EADR2
EADR1
EADR0
bit 7
bit 0
bit 7
bit 6-0
13.1
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
EEADR
13.2
x = Bit is unknown
Preliminary
DS40300C-page 87
PIC16F62X
REGISTER 13-2:
U-0
U-0
U-0
R/W-x
R/W-0
R/S-0
R/S-x
WRERR
WREN
WR
RD
bit 7
bit 0
bit 7-4
bit 3
bit 2
bit 1
bit 0
DS40300C-page 88
R = Readable bit
W = Writable bit
-n = Value at POR
1 = Bit is set
0 = Bit is cleared
Preliminary
x = Bit is unknown
PIC16F62X
13.3
EXAMPLE 13-1:
BSF
MOVLW
MOVWF
BSF
MOVF
BCF
13.4
STATUS, RP0
CONFIG_ADDR
EEADR
EECON1, RD
EEDATA, W
STATUS, RP0
;
;
;
;
;
;
Bank 1
Address to read
EE Read
W = EEDATA
Bank 0
Required
Sequence
STATUS, RP0
EECON1, WREN
INTCON, GIE
55h
EECON2
AAh
EECON2
EECON1,WR
BSF
INTCON, GIE
;
;
;
;
;
;
;
;
;
;
WRITE VERIFY
BSF
MOVF
BSF
BSF
BSF
BCF
MOVLW
MOVWF
MOVLW
MOVWF
BSF
13.5
EXAMPLE 13-3:
EXAMPLE 13-2:
STATUS, RP0
EEDATA, W
EECON1, RD
;
; Is the value written
; read (in EEDATA) the
;
SUBWF EEDATA, W
BCF
STATUS, RP0
BTFSS STATUS, Z
GOTO WRITE_ERR
:
:
13.6
Bank 1
Enable write
Disable INTs.
WRITE VERIFY
; Bank 1
; Read the
; value written
(in W reg) and
same?
;
;
;
;
;
;
Bank0
Is difference 0?
NO, Write error
YES, Good write
Continue program
PROTECTION AGAINST
SPURIOUS WRITE
Write 55h
Write AAh
Set WR bit
begin write
Enable INTs.
13.7
Preliminary
DS40300C-page 89
PIC16F62X
TABLE 13-1:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
9Ah
9Bh
9Ch
9Dh
Legend:
Note
Bit 1
Bit 0
EEDATA
EEPROM data register
EEADR
EEPROM address register
EECON1
WRERR WREN
WR
RD
EECON2(1) EEPROM control register 2
x = unknown, u = unchanged, - = unimplemented read as '0', q = value depends upon condition.
Shaded cells are not used by data EEPROM.
1: EECON2 is not a physical register
DS40300C-page 90
Preliminary
Value on
Power-on
Reset
xxxx
xxxx
-------
xxxx
xxxx
x000
----
Value on all
other
RESETS
uuuu
uuuu
-------
uuuu
uuuu
q000
----
PIC16F62X
14.0
14.1
Configuration Bits
OSC selection
RESET
Power-on Reset (POR)
Power-up Timer (PWRT)
Oscillator Start-Up Timer (OST)
Brown-out Reset (BOD)
Interrupts
Watchdog Timer (WDT)
SLEEP
Code protection
ID Locations
In-circuit Serial Programming
Preliminary
DS40300C-page 91
PIC16F62X
REGISTER 14-1: CONFIGURATION WORD
CP1
CP0
CP1
CP0
CPD
LVP
BODEN
MCLRE
FOSC2
PWRTE
WDTE
F0SC1
bit 13
bit 13-10:
F0SC0
bit 0
CP1:CP0: Code Protection bits (2)
Code protection for 2K program memory
11 = Program memory code protection off
10 = 0400h-07FFh code protected
01 = 0200h-07FFh code protected
00 = 0000h-07FFhcode protected
Code protection for 1K program memory
11 = Program memory code protection off
10 = Program memory code protection off
01 = 0200h-03FFh code protected
00 = 0000h-03FFh code protected
bit 9:
Unimplemented: Read as 0
bit 8:
bit 7:
bit 6:
bit 5:
bit 3:
bit 2:
bit 4, 1-0:
1:
2:
3:
4:
Enabling Brown-out Detect Reset automatically enables Power-up Timer (PWRT) regardless of the value of bit PWRTE.
Ensure the Power-up Timer is enabled anytime Brown-out Detect Reset is enabled.
All of the CP1:CP0 pairs have to be given the same value to enable the code protection scheme listed.
The entire data EEPROM will be erased when the code protection is turned off.
When MCLR is asserted in INTRC or ER mode, the internal clock oscillator is disabled.
Legend
R = Readable bit
W = Writable bit
-n = Value at POR
1 = bit is set
0 = bit is cleared
DS40300C-page 92
Preliminary
x = bit is unknown
PIC16F62X
14.2
Oscillator Configurations
14.2.1
TABLE 14-1:
OSCILLATOR TYPES
Ranges Characterized:
LP
XT
HS
ER
INTRC
EC
14.2.2
Mode
Freq
OSC1(C1)
OSC2(C2)
XT
455 kHz
2.0 MHz
4.0 MHz
22 - 100 pF
15 - 68 pF
15 - 68 pF
22 - 100 pF
15 - 68 pF
15 - 68 pF
HS
8.0 MHz
16.0 MHz
10 - 68 pF
10 - 22 pF
10 - 68 pF
10 - 22 pF
Note
OSC1(C1)
OSC2(C2)
LP
32 kHz
200 kHz
68 - 100 pF
15 - 30 pF
68 - 100 pF
15 - 30 pF
XT
100 kHz
2 MHz
4 MHz
68 - 150 pF
15 - 30 pF
15 - 30 pF
150 - 200 pF
15 - 30 pF
15 - 30 pF
HS
8 MHz
10 MHz
20 MHz
15 - 30 pF
15 - 30 pF
15 - 30 pF
15 - 30 pF
15 - 30 pF
15 - 30 pF
14.2.3
RF
SLEEP
OSC2
C2
Note
1:
2:
RS
NOTE 1
FOSC
PIC16F62X
C1
XTAL
Higher capacitance increases the stability of the oscillator but also increases the start-up time. These values
are for design guidance only. Since each resonator has
its own characteristics, the user should consult the resonator manufacturer for appropriate values of external
components.
Mode
CRYSTAL OPERATION
(OR CERAMIC
RESONATOR) (HS, XT OR
LP OSC
CONFIGURATION)
OSC1
1:
TABLE 14-2:
Note
FIGURE 14-1:
1:
Higher capacitance increases the stability of the oscillator but also increases the start-up time. These values
are for design guidance only. Rs may be required in HS
mode as well as XT mode to avoid overdriving crystals
with low drive level specification. Since each crystal
has its own characteristics, the user should consult the
crystal manufacturer for appropriate values of external
components.
Preliminary
DS40300C-page 93
PIC16F62X
FIGURE 14-2:
14.2.5
EXTERNAL PARALLEL
RESONANT CRYSTAL
OSCILLATOR CIRCUIT
+5V
TO OTHER
DEVICES
10K
4.7K
74AS04
PIC16F62X
CLKIN
74AS04
10K
XTAL
10K
C1
C2
FIGURE 14-3:
ER OSCILLATOR
FIGURE 14-5:
EXTERNAL RESISTOR
EXTERNAL SERIES
RESONANT CRYSTAL
OSCILLATOR CIRCUIT
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT
330 K
330 K
74AS04
74AS04
TO OTHER
DEVICES
PIC16F62X
74AS04
CLKIN
0.1 PF
TABLE 14-3:
XTAL
14.2.4
EXTERNAL CLOCK IN
FIGURE 14-4:
Clock From
ext. system
RA6
DS40300C-page 94
OSC2/RA6
RESISTANCE AND
FREQUENCY RELATIONSHIP
Resistance
Frequency
10.4 MHz
1K
10 MHz
10K
7.4 MHz
20K
5.3 MHz
47K
3 MHz
100K
1.6 MHz
220K
800 kHz
470K
300 kHz
1M
200 kHz
Preliminary
PIC16F62X
14.2.6
14.4
14.2.7
CLKOUT
14.3
FIGURE 14-6:
RESET
Some registers are not affected in any RESET condition; their status is unknown on POR and unchanged in
any other RESET. Most other registers are reset to a
RESET state on Power-on Reset, MCLR Reset, WDT
Reset and MCLR Reset during SLEEP. They are not
affected by a WDT Wake-up, since this is viewed as the
resumption of normal operation. TO and PD bits are set
or cleared differently in different RESET situations as
indicated in Table 14-5. These bits are used in software
to determine the nature of the RESET. See Table 14-8
for a full description of RESET states of all registers.
A simplified block diagram of the on-chip RESET circuit
is shown in Figure 14-6.
The MCLR Reset path has a noise filter to detect and
ignore small pulses. See Table 17-6 for pulse width
specification.
MCLR/
VPP Pin
SLEEP
WDT
Module
WDT
Timeout
Reset
VDD rise
detect
Power-on Reset
VDD
Brown-out
Detect Reset
BODEN
OST/PWRT
OST
Chip_Reset
10-bit Ripple-counter
R
OSC1/
CLKIN
Pin
On-chip(1)
OSC
PWRT
10-bit Ripple-counter
Enable PWRT
Enable OST
Note
1:
Preliminary
DS40300C-page 95
PIC16F62X
14.5
14.5.1
14.5.3
14.5.4
FIGURE 14-7:
14.5.2
BROWN-OUT SITUATIONS
VDD
VBOD
TBOD
INTERNAL
RESET
72 MS
VDD
INTERNAL
RESET
VBOD
<72 MS
72 MS
VDD
INTERNAL
RESET
DS40300C-page 96
VBOD
72 MS
Preliminary
PIC16F62X
14.5.5
TIMEOUT SEQUENCE
14.5.6
TABLE 14-4:
PWRTE = 1
Brown-out Detect
Reset
72 ms + 1024 TOSC
1024 TOSC
72 ms + 1024 TOSC
1024 TOSC
72 ms
72 ms
Oscillator Configuration
XT, HS, LP
ER, INTRC, EC
TABLE 14-5:
Wake-up
from SLEEP
POR
BOD
TO
PD
Power-on Reset
WDT Reset
WDT Wake-up
TABLE 14-6:
Address
03h
8Eh
Note
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR Reset
Value on all
other
RESETS(1)
STATUS
IRP
RP1
RPO
TO
PD
DC
0001 1xxx
000q quuu
OSCF
Reset
POR
BOD
---- 1-0x
---- u-uq
PCON
1:
Other (non Power-up) Resets include MCLR Reset, Brown-out Detect Reset and Watchdog Timer Reset during normal operation.
Preliminary
DS40300C-page 97
PIC16F62X
TABLE 14-7:
STATUS
Register
PCON
Register
Power-on Reset
000h
0001 1xxx
---- 1-0x
000h
000u uuuu
---- 1-uu
000h
0001 0uuu
---- 1-uu
WDT Reset
000h
0000 uuuu
---- 1-uu
PC + 1
uuu0 0uuu
---- u-uu
000h
000x xuuu
---- 1-u0
uuu1 0uuu
---- u-uu
Condition
WDT Wake-up
Brown-out Detect Reset
(1)
PC + 1
TABLE 14-8:
Register
Address
Power-on
Reset
xxxx xxxx
uuuu uuuu
INDF
00h
TMR0
01h
xxxx xxxx
uuuu uuuu
uuuu uuuu
PCL
02h
0000 0000
0000 0000
PC + 1(3)
STATUS
(4)
uuuu uuuu
uuuq quuu(4)
03h
0001 1xxx
FSR
04h
xxxx xxxx
uuuu uuuu
uuuu uuuu
PORTA
05h
xxxx 0000
xxxx u000
xxxx 0000
PORTB
06h
xxxx xxxx
uuuu uuuu
uuuu uuuu
T1CON
10h
--00 0000
--uu uuuu
--uu uuuu
T2CON
12h
-000 0000
-000 0000
-uuu uuuu
CCP1CON
17h
--00 0000
--00 0000
--uu uuuu
RCSTA
18h
0000 -00x
0000 -00x
uuuu -uuu
CMCON
1Fh
0000 0000
0000 0000
uu-- uuuu
PCLATH
0Ah
---0 0000
---0 0000
---u uuuu
INTCON
0Bh
0000 000x
0000 000u
uuuu uqqq(2)
PIR1
0Ch
0000 -000
0000 -000
-q-- ----(2,5)
OPTION
81h
1111 1111
1111 1111
uuuu uuuu
TRISA
85h
11-1 1111
11-- 1111
uu-u uuuu
TRISB
86h
1111 1111
1111 1111
uuuu uuuu
PIE1
8Ch
0000 -000
0000 -000
uuuu -uuu
PCON
8Eh
---- 1-0x
---- 1-uq(1,6)
---- --uu
TXSTA
98h
0000 -010
0000 -010
uuuu -uuu
EECON1
9Ch
---- x000
---- q000
---- uuuu
VRCON
9Fh
000- 0000
000- 0000
uuu- uuuu
000q quuu
DS40300C-page 98
Preliminary
PIC16F62X
FIGURE 14-8:
VDD
MCLR
INTERNAL POR
Tpwrt
PWRT TIMEOUT
Tost
OST TIMEOUT
INTERNAL RESET
FIGURE 14-9:
VDD
MCLR
INTERNAL POR
Tpwrt
PWRT TIMEOUT
Tost
OST TIMEOUT
INTERNAL RESET
FIGURE 14-10:
VDD
MCLR
INTERNAL POR
Tpwrt
PWRT TIMEOUT
Tost
OST TIMEOUT
INTERNAL RESET
Preliminary
DS40300C-page 99
PIC16F62X
FIGURE 14-11:
VDD
EXTERNAL POWER-ON
RESET CIRCUIT (FOR
SLOW VDD POWER-UP)
FIGURE 14-13:
EXTERNAL BROWN-OUT
PROTECTION CIRCUIT 2
VDD
VDD
VDD
R1
Q1
MCLR
R
R2
R1
40k
PIC16F62X
MCLR
PIC16F62X
Note
FIGURE 14-12:
EXTERNAL BROWN-OUT
PROTECTION CIRCUIT 1
VDD
VDD
1:
2:
3:
R1
R1 + R2
= 0.7V
Internal Brown-out R1
Detect Reset should be
disabled
when
= 0.7 V
Vdd
x using this circuit.
Resistors should
be+adjusted
for the
R1
R2
characteristics of the transistor.
33k
10k
MCLR
40k
PIC16F62X
DS40300C-page 100
Preliminary
PIC16F62X
14.6
Interrupts
FIGURE 14-14:
INTERRUPT LOGIC
TMR1IF
TMR1IE
TMR2IF
TMR2IE
T0IF
T0IE
INTF
INTE
CCP1IF
CCP1IE
CMIF
CMIE
TXIF
TXIE
RCIF
RCIE
EEIF
EEIE
RBIF
RBIE
Interrupt to CPU
PEIE
GIE
Preliminary
DS40300C-page 101
PIC16F62X
14.6.1
RB0/INT INTERRUPT
14.6.2
TMR0 INTERRUPT
14.6.3
PORTB INTERRUPT
14.6.4
COMPARATOR INTERRUPT
FIGURE 14-15:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
CLKOUT
(3)
(4)
INT pin
INTF flag
(INTCON<1>)
(1)
(1)
(5)
GIE bit
(INTCON<7>)
INSTRUCTION FLOW
PC
PC
Instruction
Fetched
Inst (PC)
Instruction
Executed
Inst (PC-1)
PC+1
Inst (PC+1)
Inst (PC)
PC+1
Dummy Cycle
0004h
0005h
Inst (0004h)
Inst (0005h)
Dummy Cycle
Inst (0004h)
DS40300C-page 102
Preliminary
PIC16F62X
TABLE 14-9:
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
0Bh
INTCON
GIE
PEIE
T0IE
INTE
RBIE
0Ch
PIR1
8Ch
PIE1
EEIF
EEIE
CMIF
CMIE
RCIF
RCIE
TXIF
TXIE
Bit 2
Bit 1
Bit 0
T0IF
INTF
RBIF
Value on
POR Reset
Value on all
other
RESETS(1)
0000 000x
0000 000u
0000 -000
0000 -000
0000 -000
0000 -000
Note 1: Other (non Power-up) Resets include MCLR Reset, Brown-out Detect Reset and Watchdog Timer Reset during normal
operation.
14.7
EXAMPLE 14-2:
14.8
14.8.1
MOVWF
W_TEMP
SWAPF
STATUS,W
BCF
STATUS,RP0
MOVWF
STATUS_TEMP
WDT PERIOD
14.8.2
: (ISR)
WDT PROGRAMMING
CONSIDERATIONS
:
SWAPF
MOVWF
STATUS
SWAPF
W_TEMP,F
;swap W_TEMP
SWAPF
W_TEMP,W
Preliminary
DS40300C-page 103
PIC16F62X
FIGURE 14-16:
M
U
1X
Watchdog
Timer
WDT POSTSCALER/
TMR0 PRESCALER
8
8 to 1 MUX
PSA
PS<2:0>
WDT
Enable Bit
To TMR0
(Figure 6-1)
MUX
PSA
WDT
Timeout
Note 1: T0SE, T0CS, PSA, PS0-PS2 are bits in the OPTION register.
Name
2007h
Config.
bits
81h
Legend:
Note 1:
14.9
OPTION
_
Value on
POR Reset
Value on all
other
RESETS
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
LVP
BODEN
MCLRE
FOSC2
PWRTE
WDTE
FOSC1
FOSC0
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
DS40300C-page 104
Preliminary
PIC16F62X
14.9.1
FIGURE 14-17:
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
OSC1
Tost(2)
CLKOUT(4)
INT pin
INTF flag
(INTCON<1>)
Interrupt Latency
(Note 2)
GIE bit
(INTCON<7>)
Processor in
SLEEP
INSTRUCTION FLOW
PC
Instruction
Fetched
Instruction
Executed
Note
1:
2:
3:
4:
PC
Inst(PC) = SLEEP
Inst(PC - 1)
PC+1
PC+2
PC+2
Inst(PC + 1)
Inst(PC + 2)
SLEEP
Inst(PC + 1)
PC + 2
Dummy cycle
0004h
0005h
Inst(0004h)
Inst(0005h)
Dummy cycle
Inst(0004h)
Note:
Preliminary
DS40300C-page 105
PIC16F62X
14.12 In-Circuit Serial Programming
FIGURE 14-18:
TYPICAL IN-CIRCUIT
SERIAL PROGRAMMING
CONNECTION
To Normal
Connections
External
Connector
Signals
PIC16F62X
+5V
VDD
0V
VSS
VPP
RA5/MCLR/VPP
CLK
RB6/PGC
Data I/O
RB7/PGD
VDD
To Normal
Connections
DS40300C-page 106
Preliminary
PIC16F62X
15.0
TABLE 15-1:
Byte-oriented operations
Bit-oriented operations
Literal and control operations
All instructions are executed within one single
instruction cycle, unless a conditional test is true or the
program counter is changed as a result of an
instruction. In this case, the execution takes two
instruction cycles with the second cycle executed as a
NOP. One instruction cycle consists of four oscillator
periods. Thus, for an oscillator frequency of 4 MHz, the
normal instruction execution time is 1 s. If a
conditional test is true or the program counter is
changed as a result of an instruction, the instruction
execution time is 2 s.
Table 15-2 lists the instructions recognized by the
MPASM assembler.
Figure 15-1 shows the three general formats that the
instructions can have.
Note 1: Any unused opcode is reserved. Use of
any reserved opcode may cause unexpected operation.
OPCODE FIELD
DESCRIPTIONS
Field
Description
0xhh
where h signifies a hexadecimal digit.
FIGURE 15-1:
label
Label name
TOS
Top of Stack
PC
Program Counter
PCLA
TH
GIE
WDT
Watchdog Timer/Counter
TO
Timeout bit
PD
Power-down bit
dest
[ ]
Options
General
( )
Contents
13
Assigned to
<>
In the set of
italics
0
f (FILE #)
d = 0 for destination W
d = 1 for destination f
f = 7-bit file register address
Bit-oriented file register operations
13
10 9
76
OPCODE
b (BIT #)
f (FILE #)
8 7
OPCODE
k (literal)
k (literal)
Preliminary
DS40300C-page 107
PIC16F62X
TABLE 15-2:
Mnemonic,
Operands
Description
Cycles
MSb
LSb
Status
Affected
Notes
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
f, d
f, d
f
f, d
f, d
f, d
f, d
f, d
Add W and f
AND W with f
Clear f
Clear W
Complement f
Decrement f
Decrement f, Skip if 0
Increment f
Increment f, Skip if 0
Inclusive OR W with f
Move f
Move W to f
No Operation
Rotate Left f through Carry
Rotate Right f through Carry
Subtract W from f
Swap nibbles in f
Exclusive OR W with f
1
1
1
1
1
1
1(2)
1
1(2)
1
1
1
1
1
1
1
1
1
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
00
0111
0101
0001
0001
1001
0011
1011
1010
1111
0100
1000
0000
0000
1101
1100
0010
1110
0110
dfff
dfff
lfff
0000
dfff
dfff
dfff
dfff
dfff
dfff
dfff
lfff
0xx0
dfff
dfff
dfff
dfff
dfff
ffff
ffff
ffff
0011
ffff
ffff
ffff
ffff
ffff
ffff
ffff
ffff
0000
ffff
ffff
ffff
ffff
ffff
1
1
1(2)
1(2)
01
01
01
01
00bb
01bb
10bb
11bb
bfff
bfff
bfff
bfff
ffff
ffff
ffff
ffff
1
1
2
1
2
1
1
2
2
2
1
1
1
11
11
10
00
10
11
11
00
11
00
00
11
11
111x
1001
0kkk
0000
1kkk
1000
00xx
0000
01xx
0000
0000
110x
1010
kkkk
kkkk
kkkk
0110
kkkk
kkkk
kkkk
0000
kkkk
0000
0110
kkkk
kkkk
kkkk
kkkk
kkkk
0100
kkkk
kkkk
kkkk
1001
kkkk
1000
0011
kkkk
kkkk
C,DC,Z
Z
Z
Z
Z
Z
Z
Z
Z
C
C
C,DC,Z
Z
1,2
1,2
2
1,2
1,2
1,2,3
1,2
1,2,3
1,2
1,2
1,2
1,2
1,2
1,2
1,2
BCF
BSF
BTFSC
BTFSS
Bit Clear f
Bit Set f
Bit Test f, Skip if Clear
Bit Test f, Skip if Set
1,2
1,2
3
3
1:
2:
3:
k
k
k
k
k
k
k
k
C,DC,Z
Z
TO,PD
Z
TO,PD
C,DC,Z
Z
When an I/O register is modified as a function of itself ( e.g., MOVF PORTB, 1), 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'.
If this instruction is executed on the TMR0 register (and, where applicable, d = 1), the prescaler will be cleared if assigned to the
Timer0 Module.
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.
DS40300C-page 108
Preliminary
PIC16F62X
15.1
Instruction Descriptions
ADDLW
Syntax:
[ label ] ADDLW
ANDLW
Syntax:
[ label ] ANDLW
Operands:
0 k 255
Operands:
0 k 255
Operation:
(W) + k (W)
Operation:
Status Affected:
C, DC, Z
Status Affected:
Encoding:
11
Encoding:
11
Description:
Description:
Words:
Words:
Cycles:
Cycles:
Example
ADDLW
Example
ANDLW
111x
kkkk
kkkk
0x15
Before Instruction
W = 0x10
After Instruction
W = 0x25
1001
kkkk
kkkk
0x5F
Before Instruction
W = 0xA3
After Instruction
W = 0x03
ANDWF
AND W with f
Syntax:
[ label ] ANDWF
Operands:
0 f 127
d [0,1]
Operation:
ADDWF
Add W and f
Syntax:
[ label ] ADDWF
Operands:
0 f 127
d [0,1]
Operation:
Status Affected:
Status Affected:
C, DC, Z
Encoding:
00
f,d
0101
f,d
dfff
ffff
Encoding:
00
Description:
Description:
Add the contents of the W register with register 'f'. If 'd' is 0 the
result is stored in the W register.
If 'd' is 1 the result is stored back
in register 'f'.
Words:
Words:
Cycles:
Cycles:
Example
ANDWF
Example
ADDWF
0111
dfff
ffff
REG1, 0
Before Instruction
W
= 0x17
REG1 = 0xC2
After Instruction
W
= 0x17
REG1 = 0x02
Before Instruction
W
= 0x17
REG1 = 0xC2
After Instruction
W
= 0xD9
REG1 = 0xC2
Z
= 0
C
= 0
DC
= 0
REG1, 1
Preliminary
DS40300C-page 109
PIC16F62X
BCF
Bit Clear f
BTFSC
Syntax:
[ label ] BCF
Syntax:
Operands:
0 f 127
0b7
Operands:
0 f 127
0b7
Operation:
0 (f<b>)
Operation:
skip if (f<b>) = 0
Status Affected:
None
Status Affected:
None
f,b
Encoding:
01
Description:
Words:
Cycles:
Example
BCF
00bb
bfff
ffff
Encoding:
Bit Set f
Syntax:
[ label ] BSF
Operands:
0 f 127
0b7
Operation:
1 (f<b>)
Status Affected:
None
Encoding:
01
Description:
Words:
Cycles:
Example
BSF
01bb
ffff
Cycles:
1(2)
f,b
bfff
bfff
Words:
Example
BSF
10bb
REG1, 7
Before Instruction
REG1 = 0xC7
After Instruction
REG1 = 0x47
01
Description:
ffff
HERE
FALSE
TRUE
BTFSC
GOTO
REG1
PROCESS_CODE
Before Instruction
PC = address HERE
After Instruction
if REG<1> = 0,
PC = address TRUE
if REG<1>=1,
PC = address FALSE
REG1, 7
Before Instruction
REG1 = 0x0A
After Instruction
REG1 = 0x8A
DS40300C-page 110
Preliminary
PIC16F62X
BTFSS
CALL
Call Subroutine
Syntax:
Syntax:
[ label ] CALL k
Operands:
0 f 127
0b<7
Operands:
0 k 2047
Operation:
(PC)+ 1 TOS,
k PC<10:0>,
(PCLATH<4:3>) PC<12:11>
Status Affected:
None
Encoding:
10
Description:
Words:
Cycles:
Example
HERE
Operation:
skip if (f<b>) = 1
Status Affected:
None
Encoding:
01
Description:
bfff
ffff
Words:
Cycles:
1(2)
Example
11bb
HERE
FALSE
TRUE
BTFSS
GOTO
REG1
PROCESS_CODE
Before Instruction
PC = address HERE
After Instruction
if FLAG<1> = 0,
PC = address FALSE
if FLAG<1> = 1,
PC = address TRUE
0kkk
kkkk
CALL
kkkk
THERE
Before Instruction
PC = Address HERE
After Instruction
PC = Address THERE
TOS = Address HERE+1
CLRF
Syntax:
Clear f
[ label ] CLRF
Operands:
0 f 127
Operation:
00h (f)
1Z
Status Affected:
Encoding:
00
Description:
Words:
Cycles:
Example
CLRF
0001
1fff
ffff
REG1
Before Instruction
REG1 = 0x5A
After Instruction
REG1 = 0x00
Z
= 1
Preliminary
DS40300C-page 111
PIC16F62X
CLRW
Clear W
COMF
Complement f
Syntax:
[ label ] CLRW
Syntax:
[ label ] COMF
Operands:
None
Operands:
Operation:
00h (W)
1Z
0 f 127
d [0,1]
Operation:
(f) (dest)
Status Affected:
Status Affected:
Encoding:
00
Description:
Words:
Cycles:
Example
f,d
Encoding:
00
Description:
CLRW
Words:
Before Instruction
W = 0x5A
After Instruction
W = 0x00
Z = 1
Cycles:
Example
COMF
CLRWDT
DECF
Syntax:
[ label ] CLRWDT
Operands:
None
Operands:
Operation:
00h WDT
0 WDT prescaler,
1 TO
1 PD
0 f 127
d [0,1]
Operation:
(f) - 1 (dest)
Status Affected:
Status Affected:
TO, PD
Encoding:
Encoding:
00
Description:
0001
0000
0011
1001
dfff
ffff
REG1, 0
Before Instruction
REG1 = 0x13
After Instruction
REG1 = 0x13
W
= 0xEC
Syntax:
Decrement f
[ label ] DECF f,d
00
0011
dfff
ffff
Description:
Words:
Words:
Cycles:
Cycles:
Example
DECF
Example
CLRWDT
0000
0110
Before Instruction
WDT counter = ?
After Instruction
WDT counter =
WDT prescaler =
=
TO
=
PD
DS40300C-page 112
0100
0x00
0
1
1
Preliminary
CNT, 1
Before Instruction
CNT = 0x01
Z
= 0
After Instruction
CNT = 0x00
Z
= 1
PIC16F62X
DECFSZ
Decrement f, Skip if 0
GOTO
Unconditional Branch
Syntax:
Syntax:
0 f 127
d [0,1]
[ label ]
Operands:
Operands:
0 k 2047
Operation:
k PC<10:0>
PCLATH<4:3> PC<12:11>
Status Affected:
None
Operation:
(f) - 1 (dest);
0
Status Affected:
None
Encoding:
00
Description:
Words:
Cycles:
1(2)
Example
HERE
1011
DECFSZ
GOTO
CONTINUE
skip if result =
dfff
ffff
GOTO k
Encoding:
10
Description:
GOTO is an unconditional
branch. The eleven bit
immediate value is loaded into
PC bits <10:0>. The upper bits
of PC are loaded from
PCLATH<4:3>. GOTO is a twocycle instruction.
Words:
Cycles:
Example
GOTO THERE
1kkk
kkkk
kkkk
After Instruction
PC = Address THERE
REG1, 1
LOOP
Before Instruction
PC
= address HERE
After Instruction
REG1 = REG1 - 1
if REG1 = 0,
PC = address CONTINUE
if REG1 0,
PC
= address HERE+1
Preliminary
DS40300C-page 113
PIC16F62X
INCF
Increment f
INCFSZ
Increment f, Skip if 0
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f) + 1 (dest)
Operation:
Status Affected:
Status Affected:
None
INCF f,d
Encoding:
00
Description:
Words:
Cycles:
Example
INCF
1010
dfff
ffff
Encoding:
00
Description:
Words:
Cycles:
1(2)
Example
HERE
REG1, 1
Before Instruction
REG1 = 0xFF
Z
= 0
After Instruction
REG1 = 0x00
Z
= 1
INCFSZ f,d
1111
dfff
INCFSZ
GOTO
CONTINUE
ffff
REG1, 1
LOOP
Before Instruction
PC
= address HERE
After Instruction
REG1 = REG1 + 1
if CNT = 0,
PC = address CONTINUE
if REG1 0,
PC
= address HERE +1
DS40300C-page 114
Preliminary
PIC16F62X
IORLW
MOVLW
Move Literal to W
Syntax:
[ label ]
Syntax:
[ label ]
IORLW k
MOVLW k
Operands:
0 k 255
Operands:
0 k 255
Operation:
Operation:
k (W)
Status Affected:
Status Affected:
None
Encoding:
11
Encoding:
11
Description:
Description:
Words:
Words:
Cycles:
Cycles:
Example
MOVLW
Example
IORLW
1000
kkkk
kkkk
0x35
00xx
0x5A
IORWF
Inclusive OR W with f
MOVF
Move f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
Operation:
(f) (dest)
Status Affected:
Encoding:
00
Description:
Words:
Cycles:
Example
IORWF
0100
f,d
dfff
REG1, 0
Before Instruction
REG1 = 0x13
W
= 0x91
After Instruction
REG1 = 0x13
W
= 0x93
Z
= 1
kkkk
After Instruction
W = 0x5A
Before Instruction
W = 0x9A
After Instruction
W = 0xBF
Z = 0
IORWF
kkkk
ffff
MOVF f,d
Status Affected:
Encoding:
00
Description:
Words:
Cycles:
Example
MOVF
1000
dfff
ffff
REG1, 0
After Instruction
W = value in REG1 register
Z = 1
Preliminary
DS40300C-page 115
PIC16F62X
MOVWF
Move W to f
OPTION
Syntax:
[ label ]
Syntax:
[ label ]
0 f 127
Operands:
None
Operands:
Operation:
(W) (f)
Operation:
(W) OPTION
Status Affected:
None
Status Affected:
None
Encoding:
00
Encoding:
00
Description:
Words:
Cycles:
MOVWF
0000
1fff
ffff
Description:
Words:
Cycles:
Example
MOVWF
REG1
Before Instruction
REG1 = 0xFF
W
= 0x4F
After Instruction
REG1 = 0x4F
W
= 0x4F
OPTION
0000
0110
0010
Example
To maintain upward compatibility with future PICmicro products, do not use this
instruction.
NOP
No Operation
RETFIE
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
None
Operands:
None
Operation:
No operation
Operation:
Status Affected:
None
TOS PC,
1 GIE
Encoding:
00
Status Affected:
None
No operation.
Encoding:
00
Description:
Words:
Description:
Cycles:
Example
NOP
Words:
Cycles:
Example
RETFIE
NOP
0000
0xx0
0000
RETFIE
0000
0000
1001
After Interrupt
PC = TOS
GIE = 1
DS40300C-page 116
Preliminary
PIC16F62X
RETLW
RLF
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 k 255
Operands:
Operation:
k (W);
TOS PC
0 f 127
d [0,1]
Operation:
Status Affected:
None
Status Affected:
Encoding:
11
Encoding:
00
Description:
Description:
Words:
Cycles:
Example
ADDWF PC ;W = offset
RETLW k1 ;Begin table
RETLW k2 ;
TABLE
RETLW k
01xx
kkkk
kkkk
Cycles:
Example
RLF
f,d
1101
Words:
RLF
dfff
ffff
REGISTER F
REG1, 0
Before Instruction
REG1 = 1110 0110
C
= 0
After Instruction
REG1 = 1110 0110
W
= 1100 1100
C
= 1
Before Instruction
W = 0x07
After Instruction
W = value of k8
RETURN
Syntax:
[ label ]
Operands:
None
Operation:
TOS PC
RETURN
Status Affected:
None
Encoding:
00
Description:
Words:
Cycles:
Example
RETURN
0000
0000
1000
After Interrupt
PC = TOS
Preliminary
DS40300C-page 117
PIC16F62X
RRF
SUBLW
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 k 255
Operation:
k - (W) (W)
Operation:
Status
Affected:
C, DC, Z
Status Affected:
Encoding:
11
Description:
Words:
Cycles:
Example 1:
SUBLW
RRF f,d
Encoding:
00
Description:
1100
Words:
Cycles:
Example
RRF
dfff
ffff
REGISTER F
SUBLW k
110x
kkkk
kkkk
0x02
Before Instruction
W = 1
C = ?
REG1, 0
After Instruction
Before Instruction
REG1 = 1110 0110
C
= 0
After Instruction
REG1 = 1110 0110
W
= 0111 0011
C
= 0
W = 1
C = 1; result is positive
Example 2:
Before Instruction
W = 2
C = ?
After Instruction
W = 0
C = 1; result is zero
SLEEP
Example 3:
Syntax:
[ label ]
SLEEP
Operands:
None
Operation:
00h WDT,
0 WDT prescaler,
1 TO,
0 PD
W =
C =
W =
C =
TO, PD
Encoding:
00
Description:
Words:
Cycles:
Example:
SLEEP
DS40300C-page 118
0110
3
?
After Instruction
Status Affected:
0000
Before Instruction
0xFF
0; result is negative
0011
Preliminary
PIC16F62X
SUBWF
Subtract W from f
SWAPF
Swap Nibbles in f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
Operation:
Status
Affected:
C, DC, Z
(f<3:0>) (dest<7:4>),
(f<7:4>) (dest<3:0>)
Status Affected:
None
Encoding:
00
Encoding:
00
Description:
Description:
Words:
Words:
Cycles:
Cycles:
Example 1:
SUBWF
Example
SWAPF
SUBWF f,d
0010
dfff
ffff
REG1, 1
Before Instruction
Example 2:
1
2
1; result is positive
DC = 1
After Instruction
Example 3:
0
2
1; result is zero
DC = 1
TRIS
REG1 = 1
W
= 2
C
= ?
[ label ] TRIS
Operands:
5f7
Operation:
Status Affected:
None
Encoding:
00
Description:
Words:
Cycles:
0000
0110
0fff
Example
After Instruction
=
=
=
=
Syntax:
Before Instruction
REG1
W
C
Z
REG1, 0
REG1 = 0xA5
W
= 0x5A
REG1 = 2
W
= 2
C
= ?
=
=
=
=
ffff
After Instruction
Before Instruction
REG1
W
C
Z
dfff
REG1 = 0xA5
After Instruction
=
=
=
=
1110
Before Instruction
REG1 = 3
W
= 2
C
= ?
REG1
W
C
Z
SWAPF f,d
0xFF
2
0; result is negative
DC = 0
Preliminary
To maintain upward
compatibility with future
PICmicro products, do not
use this instruction.
DS40300C-page 119
PIC16F62X
XORLW
XORWF
Exclusive OR W with f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
Status Affected:
XORLW k
Operands:
0 k 255
Operation:
Status Affected:
Encoding:
11
Description:
1010
Words:
Cycles:
Example:
XORLW
kkkk
kkkk
XORWF
f,d
Encoding:
00
Description:
Words:
Cycles:
Example
XORWF
0110
dfff
ffff
0xAF
Before Instruction
W = 0xB5
REG1, 1
Before Instruction
After Instruction
REG1 = 0xAF
W
= 0xB5
W = 0x1A
After Instruction
REG1 = 0x1A
W
= 0xB5
DS40300C-page 120
Preliminary
Device#
16.0
DEVELOPMENT SUPPORT
16.1
16.2
MPASM Assembler
Preliminary
DS40300C-page 121
Device#
16.3
16.6
16.4
16.5
DS40300C-page 122
16.7
16.8
Preliminary
Device#
16.9
Preliminary
DS40300C-page 123
Device#
16.14 PICDEM 1 PICmicro
Demonstration Board
DS40300C-page 124
Preliminary
Device#
16.19 PICDEM 18R PIC18C601/801
Demonstration Board
Preliminary
DS40300C-page 125
DS40300C-page 126
Software Tools
PIC16C6X
PIC16CXXX
PIC16C43X
PIC16F62X
PIC16C7X
PIC16C7XX
PIC16C7X5
PIC16C8X
PIC16F8XX
PIC16C9XX
Preliminary
PRO MATE II
Universal Device Programmer
**
**
**
* Contact the Microchip web site at www.microchip.com for information on how to use the MPLAB ICD In-Circuit Debugger (DV164001) with PIC16C62, 63, 64, 65, 72, 73, 74, 76, 77.
** Contact Microchip Technology Inc. for availability date.
PICDEM 17 Demonstration
Board
*
*
PICDEM.net Demonstration
Board
PI18CX01
MPLAB ASM30
Assembler/Linker/Librarian
PIC18FXXX
dsPIC30F
PIC16C5X
PIC17C4X
PIC14000
PIC17C7XX
MPASM Assembler/
MPLINK Object Linker
PIC12FXXX
PIC18CXX2
PIC12CXXX
TABLE 16-1:
MPLAB Integrated
Development Environment
Device#
DEVELOPMENT TOOLS FROM MICROCHIP
PIC16F62X
17.0
ELECTRICAL SPECIFICATIONS
Note:
Voltage spikes below VSS at the MCLR pin, inducing currents greater than 80 mA, may cause latchup. Thus,
a series resistor of 50-100 should be used when applying a low level to the MCLR pin rather than pulling
this pin directly to VSS
Preliminary
DS40300C-page 127
PIC16F62X
PIC16F62X VOLTAGE-FREQUENCY GRAPH, 0C TA +70C
FIGURE 17-1:
6.0
5.5
5.0
VDD
(VOLTS)
4.5
4.0
3.5
3.0
2.5
0
10
20
25
FREQUENCY (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
FIGURE 17-2:
6.0
5.5
5.0
VDD
(VOLTS)
4.5
4.0
3.5
3.0
2.5
2.0
0
10
20
25
FREQUENCY (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
DS40300C-page 128
Preliminary
PIC16F62X
PIC16LF62X VOLTAGE-FREQUENCY GRAPH, 0C TA +70C
FIGURE 17-3:
6.0
5.5
5.0
VDD
(VOLTS)
4.5
4.0
3.5
3.0
2.5
2.0
0
10
20
25
FREQUENCY (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
FIGURE 17-4:
VDD
(VOLTS)
4.5
4.0
3.5
3.0
2.5
2.0
0
10
20
25
FREQUENCY (MHz)
Note 1: The shaded region indicates the permissible combinations of voltage and frequency.
Preliminary
DS40300C-page 129
PIC16F62X
17.1
PIC16LF62X-04
(Commercial, Industrial)
PIC16F62X-04
PIC16F62X-20
(Commercial, Industrial, Extended)
Param
No.
Sym
VDD
Characteristic/Device
Min
Typ
Max
Units
Conditions
Supply Voltage
D001
PIC16LF62X
2.0
5.5
D001
PIC16F62X
3.0
5.5
D002
VDR
1.5
D003
VPOR
VSS
D004
SVDD
0.05
V/ms
D005
VBOD
3.65
3.65
4.0
4.35
4.4
V
V
PIC16LF62X
0.30
1.10
4.0
3.80
20
0.6
2.0
7.0
6.0
2.0
30
mA
mA
mA
mA
mA
A
PIC16F62X
0.60
1.10
4.0
3.80
20
0.7
2.0
7.0
6.0
2.0
30
mA
mA
mA
mA
mA
A
IDD
D010
D013
D010
D013
D014
Legend: Rows with standard voltage device data only are shaded for improved readability.
* These parameters are characterized but not tested.
Data in Typ column is at 5.0V, 25C, unless otherwise stated. These parameters are for design guidance only and are
not tested.
Note 1: This is the limit to which VDD can be lowered in SLEEP mode without losing RAM data.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors such as I/O pin loading and
switching rate, oscillator type, internal code execution pattern, and temperature also have an impact on the current consumption.
The test conditions for all IDD measurements in active Operation mode are:
OSC1 = external square wave, from rail to rail; all I/O pins tri-stated, pulled to VDD,
MCLR = VDD; WDT enabled/disabled as specified.
3: The power-down current in SLEEP mode does not depend on the oscillator type. Power-down current is measured with
the part in SLEEP mode, with all I/O pins in hi-impedance state and tied to VDD or VSS.
4: The current is the additional current consumed when this peripheral is enabled. This current should be added to the
base IDD or IPD measurement.
5: For RC osc configuration, current through REXT is not included. The current through the resistor can be estimated by the
formula Ir = VDD/2REXT (mA) with REXT in k.
6: Commercial temperature only.
DS40300C-page 130
Preliminary
PIC16F62X
17.1
PIC16LF62X-04
(Commercial, Industrial)
PIC16F62X-04
PIC16F62X-20
(Commercial, Industrial, Extended)
Param
No.
Sym
IPD
Characteristic/Device
Min
Typ
Max
Units
Conditions
D020
PIC16LF62X
0.20
0.20
2.0
2.2
A
A
VDD = 2.0
VDD = 5.5
D020
PIC16F62X
0.20
0.20
0.20
2.70
2.2
5.0
9.0
15.0
A
A
A
A
VDD = 3.0
VDD = 4.5*
VDD = 5.5
VDD = 5.5 Extended
6.0
75
30
15
125
50
A
A
A
VDD = 3.0V
BOD enabled, VDD = 5.0V
VDD = 3.0V
D023
D023
WDT Current(4)
135
VDD = 3.0V
6.0
20
75
30
25
125
50
A
A
A
135
VDD = 4.0V
Legend: Rows with standard voltage device data only are shaded for improved readability.
* These parameters are characterized but not tested.
Data in Typ column is at 5.0V, 25C, unless otherwise stated. These parameters are for design guidance only and are
not tested.
Note 1: This is the limit to which VDD can be lowered in SLEEP mode without losing RAM data.
2: The supply current is mainly a function of the operating voltage and frequency. Other factors such as I/O pin loading and
switching rate, oscillator type, internal code execution pattern, and temperature also have an impact on the current consumption.
The test conditions for all IDD measurements in active Operation mode are:
OSC1 = external square wave, from rail to rail; all I/O pins tri-stated, pulled to VDD,
MCLR = VDD; WDT enabled/disabled as specified.
3: The power-down current in SLEEP mode does not depend on the oscillator type. Power-down current is measured with
the part in SLEEP mode, with all I/O pins in hi-impedance state and tied to VDD or VSS.
4: The current is the additional current consumed when this peripheral is enabled. This current should be added to the
base IDD or IPD measurement.
5: For RC osc configuration, current through REXT is not included. The current through the resistor can be estimated by the
formula Ir = VDD/2REXT (mA) with REXT in k.
Preliminary
DS40300C-page 131
PIC16F62X
17.2
DC CHARACTERISTICS
Param.
No.
Sym
VIL
Characteristic/Device
Min
Typ
Max
Unit
VSS
VSS
VSS
0.8
0.15 VDD
0.2 VDD
0.2 VDD
V
V
V
V
VSS
VSS
0.3 VDD
0.6 VDD - 1.0
V
V
2.0V
.25 VDD + 0.8V
0.8 VDD
0.8 VDD
0.7 VDD
0.9 VDD
VDD
VDD
VDD
VDD
VDD
V
V
V
V
V
V
50
200
400
1.0
0.5
1.0
5.0
A
A
A
A
0.6
0.6
0.6
0.6
V
V
V
V
VDD - 0.7
VDD - 0.7
VDD - 0.7
VDD - 0.7
V
V
V
V
8.5
OSC2 pin
15
pF
50
pF
D030
D031
D032
D033
VIH
I/O ports
with TTL buffer
D041
D042
D043
D043A
VOL
I/O ports
D083
D092
(Note1)
D090
D150
D080
VOH
(Note1)
D060
D061
D063
D040
D070
Conditions
D100*
D101*
Note
COSC2
Cio
DS40300C-page 132
Preliminary
PIC16F62X
TABLE 17-1:
COMPARATOR SPECIFICATIONS
Operating Conditions: 3.0V < VDD <5.5V, -40C < TA < +125C, unless otherwise stated.
Param
No.
Characteristics
Sym
Min
Typ
Max
Units
VIOFF
5.0
10
mV
D300
D301*
VICM
VDD - 1.5
D302*
CMRR
55
db
300*
300A
Response Time(1)
TRESP
150
400
600
ns
ns
301
TMC2OV
10
Comments
16F62X
16LF62X
TABLE 17-2:
Operating Conditions: 3.0V < VDD < 5.5V, -40C < TA < +125C, unless otherwise stated.
Spec
No.
Characteristics
Sym
Min
Typ
Max
Units
D310
Resolution
VRES
VDD/24
VDD/32
LSb
D311
Absolute Accuracy
VRaa
1/4
1/2
LSb
LSb
D312*
VRur
2k
310*
Settling Time(1)
Tset
10
Comments
Note 1: Settling time measured while VRR = 1 and VR<3:0> transitions from 0000 to 1111.
Preliminary
DS40300C-page 133
PIC16F62X
17.3
The timing parameter symbols have been created with one of the following formats:
1. TppS2ppS
2. TppS
T
F
Frequency
Lowercase subscripts (pp) and their meanings:
pp
ck
CLKOUT
io
I/O port
mc
MCLR
Uppercase letters and their meanings:
S
F
Fall
H
High
I
Invalid (Hi-impedance)
L
Low
FIGURE 17-5:
Time
osc
t0
OSC1
T0CKI
P
R
V
Z
Period
Rise
Valid
Hi-Impedance
LOAD CONDITIONS
Load Condition 1
Load Condition 2
VDD/2
RL
CL
PIN
CL
PIN
VSS
VSS
RL = 464
CL = 50 pF for all pins except OSC2
15 pF for OSC2 output
DS40300C-page 134
Preliminary
PIC16F62X
TABLE 17-3:
DC Characteristics
Parameter
Sym
No.
D120
D121
ED
VDRW
D122
TDEW
D130
D131
EP
VPR
D132
D133
Characteristic
Data EEPROM Memory
Endurance
VDD for read/write
Erase/Write cycle time
Program FLASH Memory
Endurance
VDD for read
Min
Typ
Max
1M*
VMIN
10M
5.5
8*
1000*
Vmin
10000
5.5
5.5
8*
4.5
VPEW VDD for erase/write
TPEW Erase/Write cycle time
Units
Conditions
E/W 25C at 5V
V VMIN = Minimum operating
voltage
ms
E/W
V VMIN = Minimum operating
voltage
V
ms
Data in Typ column is at 5.0V, 25C unless otherwise stated. These parameters are for design guidance only
and are not tested.
17.4
FIGURE 17-6:
Q1
Q3
Q2
Q4
Q1
OSC1
1
2
CLKOUT
Preliminary
DS40300C-page 135
PIC16F62X
TABLE 17-4:
Param
No.
Sym
Characteristic
Min
Typ
Max
DC
DC
DC
20
200
4
37
4.00
4
4
20
200
4.28
Oscillator Frequency(1)
0.1
1
3.65
4
5
1
Oscillator Period(1)
2
3
*
250
250
50
5
4.28
8 MHz
10,000
1,000
250
27
TCY
DC
Units
Conditions
ns
ns
ns
s
ns
s
ns
ns
ER Osc mode
XT Osc mode
HS Osc mode
LP Osc mode
INTRC mode (fast)
INTRC mode (slow)
TCY = 4/FOSC
XT oscillator, TOSC L/H duty
cycle*
Data in Typ column is at 5.0V, 25C unless otherwise stated. These parameters are for design guidance only
and are not tested.
Note 1: Instruction cycle period (Tcy) equals four times the input oscillator time-based period. 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 pin. When an external clock input is used, the Max
cycle time limit is DC (no clock) for all devices.
DS40300C-page 136
Preliminary
PIC16F62X
FIGURE 17-7:
Q4
Q2
Q3
OSC1
11
10
22
CLKOUT
23
13
19
14
12
18
16
I/O PIN
(INPUT)
15
17
I/O PIN
(OUTPUT)
NEW VALUE
OLD VALUE
20, 21
TABLE 17-5:
Param
No.
10*
Sym
Characteristic
10A*
11*
11A*
12*
TckR
12A*
13*
TckF
14*
TckL2ioV
15*
13A*
Min
Typ
16F62X
75
200
ns
16LF62X
400
ns
16F62X
75
200
ns
16LF62X
400
ns
16F62X
35
100
ns
200
ns
16F62X
35
100
ns
200
ns
20
ns
16F62X
Tosc+200 ns
ns
16LF62X
Tosc=400 ns
ns
ns
16F62X
50
150*
ns
300
ns
100
200
ns
16*
TckH2ioI
17*
18*
TosH2ioI
Units
16LF62X
16LF62X
CLKOUT
Max
16LF62X
Preliminary
DS40300C-page 137
PIC16F62X
FIGURE 17-8:
VDD
MCLR
30
Internal
POR
33
PWRT
Timeout
32
OSC
Timeout
Internal
RESET
Watchdog
Timer
RESET
31
34
34
I/O Pins
FIGURE 17-9:
VBOD
VDD
35
TABLE 17-6:
Param
No.
Sym
Characteristic
Min
Typ
Max
Units
Conditions
30
TmcL
2000
TBD
TBD
TBD
ns
ms
31
Twdt
7
TBD
18
TBD
33
TBD
ms
ms
32
Tost
33*
Tpwrt
34
TIOZ
TBOD
35
1024TOSC
28
TBD
72
TBD
132
TBD
ms
ms
2.0
100
DS40300C-page 138
Preliminary
PIC16F62X
FIGURE 17-10:
RA4/T0CKI
41
40
42
RB6/T1OSO/T1CKI
46
45
47
48
TMR0 OR
TMR1
Preliminary
DS40300C-page 139
PIC16F62X
TABLE 17-7:
Param
No.
Sym
Characteristic
40*
Tt0H
41*
Tt0L
42*
Tt0P
T0CKI Period
45*
Tt1H
T1CKI High
Time
46*
Tt1L
47*
Tt1P
Min
No Prescaler
With Prescaler
No Prescaler
With Prescaler
Synchronous, No Prescaler
Synchronous, 16F62X
with Prescaler 16LF62X
Asynchronous 16F62X
16LF62X
T1CKI Low Time Synchronous, No Prescaler
Synchronous, 16F62X
with Prescaler 16LF62X
Asynchronous 16F62X
16LF62X
T1CKI input
Synchronous 16F62X
period
16LF62X
48
*
Asynchronous 16F62X
16LF62X
Ft1
Timer1 oscillator input frequency range
(oscillator enabled by setting bit T1OSCEN)
TCKEZtmr1 Delay from external clock edge to timer
increment
These parameters are characterized but not tested.
0.5TCY + 20
10
0.5TCY + 20
10
Greater of:
TCY + 40
N
0.5TCY + 20
15
25
30
50
0.5TCY + 20
15
25
30
50
Greater of:
TCY + 40
N
Greater of:
TCY + 40
N
60
100
DC
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
200
ns
ns
kHz
2Tosc
7Tosc
Conditions
N = prescale value
(2, 4, ..., 256)
N = prescale value
(1, 2, 4, 8)
Data in Typ column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
FIGURE 17-11:
CAPTURE/COMPARE/PWM TIMINGS
RB3/CCP1
(CAPTURE MODE)
50
51
52
RB3/CCP1
(COMPARE OR PWM MODE)
53
DS40300C-page 140
54
Preliminary
PIC16F62X
TABLE 17-8:
CAPTURE/COMPARE/PWM REQUIREMENTS
Param
Sym
No.
Characteristic
50*
No Prescaler
TccL CCP
input low time
51*
TccH CCP
input high time
Min
0.5TCY + 20
16F62X
With Prescaler 16LF62X
No Prescaler
ns
10
ns
20
ns
0.5TCY + 20
ns
10
ns
20
ns
3TCY + 40
N
ns
10
25
ns
16F62X
With Prescaler 16LF62X
Conditions
52*
53*
16F62X
16LF62X
25
45
ns
54*
16F62X
10
25
ns
16LF62X
25
45
ns
N = prescale value
(1,4 or 16)
Data in Typ column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only
and are not tested.
FIGURE 17-12:
RA4/T0CKI
41
40
42
TMR0
TABLE 17-9:
Param
No.
Sym
Characteristic
40
41
Min
No Prescaler
With Prescaler
No Prescaler
With Prescaler
42
ns
10*
ns
ns
10*
ns
TCY + 40*
N
ns
Conditions
Data in Typ column is at 5.0V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
Preliminary
DS40300C-page 141
PIC16F62X
NOTES:
DS40300C-page 142
Preliminary
PIC16F62X
18.0
DC AND AC
CHARACTERISTICS GRAPHS
AND TABLES
The graphs and tables provided in this section are for design guidance and are not
tested.
FIGURE 18-1:
IDD (mA)
5.5V
5.0V
4.5V
4.0V
0
4
10
12
14
16
18
20
FOSC (MHz)
Preliminary
DS40300C-page 143
PIC16F62X
.
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-2:
IDD (mA)
5.5V
4
5.0V
3
4.5V
4.0V
0
4
10
12
14
16
18
20
FOSC (MHz)
FIGURE 18-3:
1.0
0.8
IDD (mA)
5.5V
5.0V
0.6
4.5V
4.0V
0.4
3.5V
3.0V
2.5V
0.2
2.0V
0.0
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
F OSC (MHz)
DS40300C-page 144
Preliminary
PIC16F62X
.
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-4:
Typical I DD vs F O SC over V DD
(XT m ode)
1.2
1.0
0.8
IDD (mA)
5.5V
5.0V
0.6
4.5V
4.0V
0.4
3.5V
3.0V
2.5V
0.2
2.0V
0.0
0.0
0.5
1.0
1.5
2.0
2.5
3.0
3.5
4.0
F O SC (M H z)
FIGURE 18-5:
Typical:
statistical mean @ 25C
Maximum: mean +PIC16LF628
3 (-40C to 125C)
Minimum: mean 3 (-40C to 125C)
90
80
70
5.5V
Ipd (uA)
60
5.0V
4.5V
50
4.0V
40
3.5V
30
3.0V
20
2.5V
10
0
30.000
40.000
50.000
60.000
70.000
80.000
90.000
100.000
F OSC (kHz)
Preliminary
DS40300C-page 145
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-6:
120.00
100.00
80.00
5.5V
IDD (uA)
5.0V
60.00
4.5V
4.0V
40.00
3.5V
3.0V
20.00
0.00
30.000
2.5V
40.000
50.000
60.000
70.000
80.000
90.000
100.000
F OSC (kHz)
FIGURE 18-7:
T yp ic a l F o s c vs . V D D
(E R M o d e )
3.50
R = 50 k
3.00
Frequency (MHz)
2.50
2.00
R = 100 k
1.50
1.00
R = 200 k
0.50
R = 500 k
R = 1 M
0.00
2.0
2.5
3.0
3.5
4.0
4.5
5.0
V D D (V o lts)
DS40300C-page 146
Preliminary
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-8:
Typical:
statistical mean @ 25C
Maximum: mean + 3 (-40C to 125C)
Minimum: mean 3 (-40C to 125C)
4.1
125 C
85 C
25 C
4.0
FOSC (MHz)
3.9
-40 C
3.8
3.7
3.6
3.5
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 18-9:
60.000
50.000
Typical:
statistical mean @ 25C
PIC16LF628
Maximum: mean + 3
(-40C to 125C)
Minimum: mean 3 (-40C to 125C)
125 C
85 C
40.000
FOSC (KHz)
25 C
-40 C
30.000
20.000
10.000
0.000
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
V DD (V)
Preliminary
DS40300C-page 147
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-10:
IPD vs VDD
Sleep mode, all peripherals disabled
4.0
Max (125C)
IPD (uA)
3.0
2.0
1.0
Max (85C)
Typ (25C)
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 18-11:
0.110
IBOR (mA)
0.100
Max
0.090
Max
Typ Reset (25C)
Typ Sleep (25C)
0.080
0.070
Indeterminate
Device in Reset
Device in Sleep
0.060
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
DS40300C-page 148
Preliminary
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-12:
80
70
ITMR1OSC (uA)
60
50
Max
40
Typ (25C)
30
20
10
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 18-13:
13.0
Typical:
statistical mean @ 25C
Maximum: mean + 3 (-40C to 125C)
Minimum: mean 3 (-40C to 125C)
12.0
11.0
10.0
Max (125C)
9.0
IWDT (uA)
8.0
7.0
Typ (25C)
6.0
5.0
4.0
3.0
2.0
1.0
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
Preliminary
DS40300C-page 149
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-14:
Typical:
statistical mean @ 25C
Maximum: mean + 3 (-40C to 125C)
Minimum: mean 3 (-40C to 125C)
ICOMP vs VDD
Sleep mode, Comparators enabled
140.0
120.0
ICOMP (uA)
100.0
80.0
Max (125C)
Typ (25C)
60.0
40.0
20.0
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 18-15:
IVREF vs VDD
Sleep mode, VREF enabled
90.0
Typical:
statistical mean @ 25C
Maximum: mean + 3 (-40C to 125C)
Minimum: mean 3 (-40C to 125C)
80.0
70.0
Max (125C)
60.0
IVREF (uA)
Typ (25C)
50.0
40.0
30.0
20.0
10.0
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
DS40300C-page 150
Preliminary
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-16:
Typical:
statistical mean @ 25C
PIC16LF228
Maximum: mean
+ 3 (-40C to 125C)
Minimum: mean 3 (-40C to 125C)
45
40
35
30
Max 125C
Max 85C
25
20
Typ 25C
15
Min -40C
10
5
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
V DD (V)
FIGURE 18-17:
45
Typical:
statistical mean @ 25C
PIC16LF228
Maximum: mean + 3 (-40C to 125C)
Minimum: mean 3 (-40C to 125C)
40
35
30
125 C
25
85 C
20
25 C
15
-40 C
10
0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
Preliminary
DS40300C-page 151
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-18:
5.0
4.5
4.0
3.5
Max (-40C)
VOH (V)
3.0
Typ (25C)
2.5
2.0
1.5
Min (125C)
1.0
0.5
0.0
0.0
5.0
10.0
15.0
20.0
25.0
IOH (-mA)
FIGURE 18-19:
3.0
2.5
VOH (V)
2.0
1.5
1.0
0.5
Typ (25C)
Min (125C)
0.0
0.0
2.0
4.0
6.0
8.0
Max (-40C)
10.0
12.0
14.0
IOH (-mA)
DS40300C-page 152
Preliminary
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-20:
0.80
0.70
Max (125C)
0.60
VOL (V)
0.50
Typ (25C)
0.40
Min (-40C)
0.30
0.20
0.10
0.00
0.0
5.0
10.0
15.0
20.0
25.0
IOL (mA)
FIGURE 18-21:
Typical:
statistical mean @ 25C
Maximum: mean + 3 (-40C to 125C)
Minimum: mean 3 (-40C to 125C)
1.40
Max (125C)
1.20
1.00
0.80
VOL (V)
Typ (25C)
0.60
Min (-40C)
0.40
0.20
0.00
0.0
5.0
10.0
15.0
20.0
25.0
IOL (mA)
Preliminary
DS40300C-page 153
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-22:
VIN vs VDD
TTL Input
2.0
1.5
Max (-40C)
Vin (V)
Min (125C)
1.0
0.5
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
FIGURE 18-23:
VIN vs VDD
ST Input
5.0
4.0
Vin (V)
3.0
0.0
2.0
2.5
3.0
3.5
4.0
4.5
5.0
5.5
VDD (V)
DS40300C-page 154
Preliminary
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-24:
30.000
125 C
IDD (A)
25.000
85
25 C
20.000
-40 C
15.000
10.000
2.5
3.0
3.5
4.0
4.5
5.0
5.5
V DD (Volts)
FIGURE 18-25:
30.000
IDD (A)
25.000
125 C
85 C
20.000
25 C
-40C
15.000
10.000
2.5
3.0
3.5
4.0
4.5
5.0
5.5
V DD (Volts)
Preliminary
DS40300C-page 155
PIC16F62X
Note:
The graphs and tables provided in this section are for design guidance and are not tested.
FIGURE 18-26:
1.20
1.10
IDD (mA)
1.00
0.90
125
0.80
85
25 C
-40 C
0.70
0.60
0.50
0.40
2.5
3.0
3.5
4.0
4.5
5.0
5.5
V DD (Volts)
FIGURE 18-27:
1.100
1.000
IDD (mA)
0.900
125 C
0.800
85 C
25 C
-40C
0.700
0.600
0.500
0.400
2.5
3.0
3.5
4.0
4.5
5.0
5.5
V DD (Volts)
DS40300C-page 156
Preliminary
PIC16F62X
19.0
PACKAGING INFORMATION
19.1
18-LEAD PDIP
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
YYWWNNN
18-LEAD SOIC (.300")
PIC16F628/P
9917017
EXAMPLE
XXXXXXXXXXXX
XXXXXXXXXXXX
XXXXXXXXXXXX
PIC16F628/SO
YYWWNNN
20-LEAD SSOP
EXAMPLE
XXXXXXXXXX
XXXXXXXXXX
PIC16F628/SO
YYWWNNN
9910017
Legend: MM...M
XX...X
YY
WW
NNN
Note:
9910017
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.
Standard OTP marking consists of Microchip part number, year code, week code, facility code, mask rev#, and
assembly code. For OTP marking beyond this, certain price adders apply. Please check with your Microchip Sales
Office. For QTP devices, any special marking adders are included in QTP price.
Preliminary
DS40300C-page 157
PIC16F62X
K04-007 18-Lead Plastic Dual In-line (P) 300 mil
E1
2
n
A2
A
L
c
A1
B1
B
eB
Units
Dimension Limits
n
p
MIN
INCHES*
NOM
18
.100
.155
.130
MAX
MILLIMETERS
NOM
18
2.54
3.56
3.94
2.92
3.30
0.38
7.62
7.94
6.10
6.35
22.61
22.80
3.18
3.30
0.20
0.29
1.14
1.46
0.36
0.46
7.87
9.40
5
10
5
10
MIN
Number of Pins
Pitch
Top to Seating Plane
A
.140
.170
Molded Package Thickness
A2
.115
.145
Base to Seating Plane
.015
A1
Shoulder to Shoulder Width
E
.300
.313
.325
Molded Package Width
.240
.250
.260
E1
Overall Length
D
.890
.898
.905
Tip to Seating Plane
L
.125
.130
.135
c
Lead Thickness
.008
.012
.015
Upper Lead Width
B1
.045
.058
.070
Lower Lead Width
B
.014
.018
.022
eB
Overall Row Spacing
.310
.370
.430
DS40300C-page 158
Preliminary
MAX
4.32
3.68
8.26
6.60
22.99
3.43
0.38
1.78
0.56
10.92
15
15
PIC16F62X
K04-051 18-Lead Plastic Small Outline (SO) Wide, 300 mil
E
p
E1
2
B
45
c
A2
Units
Dimension Limits
n
p
Number of Pins
Pitch
Overall Height
Molded Package Thickness
Standoff
Overall Width
Molded Package Width
Overall Length
Chamfer Distance
Foot Length
Foot Angle
Lead Thickness
Lead Width
Mold Draft Angle Top
Mold Draft Angle Bottom
A
A2
A1
E
E1
D
h
L
c
B
MIN
.093
.088
.004
.394
.291
.446
.010
.016
0
.009
.014
0
0
A1
INCHES*
NOM
18
.050
.099
.091
.008
.407
.295
.454
.020
.033
4
.011
.017
12
12
MAX
.104
.094
.012
.420
.299
.462
.029
.050
8
.012
.020
15
15
MILLIMETERS
NOM
18
1.27
2.36
2.50
2.24
2.31
0.10
0.20
10.01
10.34
7.39
7.49
11.33
11.53
0.25
0.50
0.41
0.84
0
4
0.23
0.27
0.36
0.42
0
12
0
12
MIN
MAX
2.64
2.39
0.30
10.67
7.59
11.73
0.74
1.27
8
0.30
0.51
15
15
* Controlling Parameter
Significant Characteristic
Notes:
Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed
.010 (0.254mm) per side.
JEDEC Equivalent: MS-013
Drawing No. C04-051
Preliminary
DS40300C-page 159
PIC16F62X
K04-072 20-Lead Plastic Shrink Small Outline (SS) 5.30 mm
E
E1
p
2
1
A2
A1
Units
Dimension Limits
n
p
Number of Pins
Pitch
Overall Height
Molded Package Thickness
Standoff
Overall Width
Molded Package Width
Overall Length
Foot Length
Lead Thickness
Foot Angle
Lead Width
Mold Draft Angle Top
Mold Draft Angle Bottom
A
A2
A1
E
E1
D
L
c
MIN
.068
.064
.002
.299
.201
.278
.022
.004
0
.010
0
0
INCHES*
NOM
20
.026
.073
.068
.006
.309
.207
.284
.030
.007
4
.013
5
5
MAX
.078
.072
.010
.322
.212
.289
.037
.010
8
.015
10
10
MILLIMETERS
NOM
20
0.65
1.73
1.85
1.63
1.73
0.05
0.15
7.59
7.85
5.11
5.25
7.06
7.20
0.56
0.75
0.10
0.18
0.00
101.60
0.25
0.32
0
5
0
5
MIN
MAX
1.98
1.83
0.25
8.18
5.38
7.34
0.94
0.25
203.20
0.38
10
10
* Controlling Parameter
Significant Characteristic
Notes:
Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed
.010 (0.254mm) per side.
JEDEC Equivalent: MO-150
Drawing No. C04-072
DS40300C-page 160
Preliminary
PIC16F62X
INDEX
A
A/D
Special Event Trigger (CCP)....................................... 63
Absolute Maximum Ratings .............................................. 127
ADDLW Instruction ........................................................... 109
ADDWF Instruction ........................................................... 109
ANDLW Instruction ........................................................... 109
ANDWF Instruction ........................................................... 109
Architectural Overview .......................................................... 7
Assembler
MPASM Assembler ................................................... 121
B
Baud Rate Error .................................................................. 69
Baud Rate Formula ............................................................. 69
BCF Instruction ................................................................. 110
Block Diagram
TMR0/WDT PRESCALER .......................................... 44
Block Diagrams
Comparator I/O Operating Modes............................... 54
Comparator Output ..................................................... 56
RA3:RA0 and RA5 Port Pins ...................................... 35
Timer1 ......................................................................... 47
Timer2 ......................................................................... 50
USART Receive.......................................................... 77
USART Transmit ......................................................... 75
BRGH bit ............................................................................. 69
Brown-Out Detect (BOD) .................................................... 96
BSF Instruction ................................................................. 110
BTFSC Instruction............................................................. 110
BTFSS Instruction ............................................................. 111
Comparator Interrupts......................................................... 57
Comparator Module ............................................................ 53
Comparator Operation ........................................................ 55
Comparator Reference ....................................................... 55
Compare (CCP Module) ..................................................... 62
Block Diagram ............................................................ 62
CCP Pin Configuration ............................................... 62
CCPR1H:CCPR1L Registers ..................................... 62
Software Interrupt ....................................................... 63
Special Event Trigger ................................................. 63
Timer1 Mode Selection............................................... 63
Configuration Bits ............................................................... 91
Configuring the Voltage Reference..................................... 59
Crystal Operation................................................................ 93
D
DATA .................................................................................. 89
Data .................................................................................... 88
Data EEPROM Memory...................................................... 87
EECON1 Register ...................................................... 87
EECON2 Register ...................................................... 87
Data Memory Organization................................................. 13
DECF Instruction .............................................................. 112
DECFSZ Instruction.......................................................... 113
Development Support ....................................................... 121
E
Errata .................................................................................... 3
External Crystal Oscillator Circuit ....................................... 93
G
General purpose Register File............................................ 13
GOTO Instruction.............................................................. 113
Preliminary
DS40300C-page 161
PIC16F62X
MOVLW..................................................................... 115
MOVWF .................................................................... 116
NOP .......................................................................... 116
OPTION .................................................................... 116
RETFIE ..................................................................... 116
RETLW...................................................................... 117
RETURN ................................................................... 117
RLF ........................................................................... 117
RRF........................................................................... 118
SLEEP ...................................................................... 118
SUBLW...................................................................... 118
SUBWF ..................................................................... 119
SWAPF ..................................................................... 119
TRIS .......................................................................... 119
XORLW ..................................................................... 120
XORWF..................................................................... 120
Instruction Set Summary................................................... 107
INT Interrupt ...................................................................... 102
INTCON Register ................................................................ 21
Interrupt Sources
Capture Complete (CCP) ............................................ 62
Compare Complete (CCP) .......................................... 63
TMR2 to PR2 Match (PWM) ....................................... 64
Interrupts ........................................................................... 101
Interrupts, Enable Bits
CCP1 Enable (CCP1IE Bit)......................................... 62
Interrupts, Flag Bits
CCP1 Flag (CCP1IF Bit) ............................................. 62
IORLW Instruction............................................................. 115
IORWF Instruction............................................................. 115
Q
Q-Clock............................................................................... 65
Quick-Turnaround-Production (QTP) Devices...................... 5
M
Memory Organization
Data EEPROM Memory .............................................. 87
MOVF Instruction .............................................................. 115
MOVLW Instruction ........................................................... 115
MOVWF Instruction........................................................... 116
MPLAB C17 and MPLAB C18 C Compilers...................... 122
MPLAB ICD In-Circuit Debugger....................................... 123
MPLAB ICE High Performance Universal In-Circuit Emulator
with MPLAB IDE................................................................ 123
MPLAB Integrated Development Environment Software .. 121
MPLINK Object Linker/MPLIB Object Librarian ................ 122
N
NOP Instruction................................................................. 116
O
OPTION Instruction........................................................... 116
OPTION Register ................................................................ 20
Oscillator Configurations ..................................................... 93
Oscillator Start-up Timer (OST) .......................................... 96
Output of TMR2................................................................... 50
P
Package Marking Information ........................................... 157
Packaging Information ...................................................... 157
PCL and PCLATH ............................................................... 25
PCON.................................................................................. 24
PCON Register ................................................................... 24
PICDEM 1 Low Cost PICmicro Demonstration Board ...... 124
PICDEM 17 Demonstration Board .................................... 124
PICDEM 2 Low Cost PIC16CXX Demonstration Board.... 124
PICSTART Plus Entry Level Development Programmer .. 123
PIE1 Register ...................................................................... 22
DS40300C-page 162
Pin Functions
RC6/TX/CK ........................................................... 6784
RC7/RX/DT........................................................... 6784
PIR1.................................................................................... 23
PIR1 Register ..................................................................... 23
Port RB Interrupt............................................................... 102
PORTA ............................................................................... 29
PORTB ............................................................................... 34
Power Control/Status Register (PCON).............................. 97
Power-Down Mode (SLEEP) ............................................ 104
Power-On Reset (POR) ...................................................... 96
Power-up Timer (PWRT) .................................................... 96
PR2 Register ...................................................................... 50
Prescaler............................................................................. 44
Prescaler, Capture.............................................................. 62
Prescaler, Timer2 ............................................................... 65
PRO MATE II Universal Device Programmer ................... 123
Program Memory Organization........................................... 13
PROTECTION .................................................................... 89
PWM (CCP Module) ........................................................... 64
Block Diagram ............................................................ 64
CCPR1H:CCPR1L Registers...................................... 64
Duty Cycle .................................................................. 65
Example Frequencies/Resolutions ............................. 65
Output Diagram .......................................................... 64
Period ......................................................................... 64
Set-Up for PWM Operation......................................... 65
TMR2 to PR2 Match ................................................... 64
R
RC Oscillator....................................................................... 94
Registers
Maps
PIC16C76 ........................................................... 14
PIC16C77 ........................................................... 14
Reset .................................................................................. 95
RETFIE Instruction ........................................................... 116
RETLW Instruction............................................................ 117
RETURN Instruction ......................................................... 117
RLF Instruction ................................................................. 117
RRF Instruction................................................................. 118
S
Serial Communication Interface (SCI) Module, See USART
Serialized Quick-Turnaround-Production (SQTP) Devices... 5
SLEEP Instruction............................................................. 118
Software Simulator (MPLAB SIM) .................................... 122
Special ................................................................................ 95
Special Event Trigger. See Compare
Special Features of the CPU .............................................. 91
Special Function Registers ................................................. 15
Stack................................................................................... 25
Status Register ................................................................... 19
SUBLW Instruction ........................................................... 118
SUBWF Instruction ........................................................... 119
SWAPF Instruction ........................................................... 119
T
T1CKPS0 bit ....................................................................... 46
T1CKPS1 bit ....................................................................... 46
T1OSCEN bit ...................................................................... 46
Preliminary
PIC16F62X
T1SYNC bit ......................................................................... 46
T2CKPS0 bit ....................................................................... 51
T2CKPS1 bit ....................................................................... 51
Timer0
TIMER0 (TMR0) Interrupt ........................................... 43
TIMER0 (TMR0) Module............................................. 43
TMR0 with External Clock........................................... 43
Timer1
Special Event Trigger (CCP)....................................... 63
Switching Prescaler Assignment................................. 45
Timer2
PR2 Register............................................................... 64
TMR2 to PR2 Match Interrupt ..................................... 64
Timers
Timer1
Asynchronous Counter Mode ............................. 48
Block Diagram .................................................... 47
Capacitor Selection............................................. 49
External Clock Input............................................ 47
External Clock Input Timing ................................ 48
Operation in Timer Mode .................................... 47
Oscillator ............................................................. 49
Prescaler....................................................... 47, 49
Resetting of Timer1 Registers ............................ 49
Resetting Timer1 using a CCP Trigger Output ... 49
Synchronized Counter Mode .............................. 47
TMR1H ............................................................... 48
TMR1L ................................................................ 48
Timer2
Block Diagram .................................................... 50
Module ................................................................ 50
Postscaler ........................................................... 50
Prescaler............................................................. 50
Timing Diagrams
Timer0 ....................................................................... 139
Timer1 ....................................................................... 139
USART Asynchronous Master Transmission.............. 75
USART RX Pin Sampling...................................... 73, 74
USART Synchronous Reception................................. 84
USART Synchronous Transmission............................ 82
USART, Asynchronous Reception .............................. 78
Timing Diagrams and Specifications................................. 135
TMR0 Interrupt .................................................................. 102
TMR1CS bit ........................................................................ 46
TMR1ON bit ........................................................................ 46
TMR2ON bit ........................................................................ 51
TOUTPS0 bit....................................................................... 51
TOUTPS1 bit....................................................................... 51
TOUTPS2 bit....................................................................... 51
TOUTPS3 bit....................................................................... 51
TRIS Instruction ................................................................ 119
TRISA ................................................................................. 29
TRISB ................................................................................. 34
Asynchronous Reception............................................ 79
Asynchronous Transmission....................................... 75
Asynchronous Transmitter.......................................... 74
Baud Rate Generator (BRG) ...................................... 69
Sampling......................................................... 70, 71, 72
Synchronous Master Mode......................................... 81
Synchronous Master Reception ................................. 83
Synchronous Master Transmission ............................ 81
Synchronous Slave Mode........................................... 84
Synchronous Slave Reception ................................... 85
Synchronous Slave Transmit...................................... 84
Transmit Block Diagram ............................................. 75
V
Voltage Reference Module ................................................. 59
W
Watchdog Timer (WDT).................................................... 103
WRITE ................................................................................ 89
WRITING ............................................................................ 88
WWW, On-Line Support ....................................................... 3
X
XORLW Instruction ........................................................... 120
XORWF Instruction........................................................... 120
U
Universal Synchronous Asynchronous Receiver Transmitter
(USART) ............................................................................. 67
Asynchronous Receiver
Setting Up Reception .......................................... 80
Timing Diagram .................................................. 78
Asynchronous Receiver Mode
Block Diagram .................................................... 80
Section ................................................................ 80
USART
Asynchronous Mode ................................................... 74
Asynchronous Receiver .............................................. 77
Preliminary
DS40300C-page 163
PIC16F62X
NOTES:
DS40300C-page 164
Preliminary
PIC16F62X
ON-LINE SUPPORT
Microchip provides on-line support on the Microchip
World Wide Web site.
The web site is used by Microchip as a means to make
files and information easily available to customers. To
view the site, the user must have access to the Internet
and a web browser, such as Netscape or Microsoft
Internet Explorer. Files are also available for FTP
download from our FTP site.
www.microchip.com
The file transfer site is available by using an FTP service to connect to:
ftp://ftp.microchip.com
The web site and file transfer site provide a variety of
services. Users may download files for the latest
Development Tools, Data Sheets, Application Notes,
User's Guides, Articles and Sample Programs. A
variety of Microchip specific business information is
also available, including listings of Microchip sales
offices, distributors and factory representatives. Other
data available for consideration is:
Latest Microchip Press Releases
Technical Support Section with Frequently Asked
Questions
Design Tips
Device Errata
Job Postings
Microchip Consultant Program Member Listing
Links to other useful web sites related to
Microchip Products
Conferences for products, Development Systems,
technical information and more
Listing of seminars and events
Preliminary
DS40300C-page 165
PIC16F62X
READER RESPONSE
It is our intention to provide you with the best documentation possible to ensure successful use of your Microchip product. If you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation
can better serve you, please FAX your comments to the Technical Publications Manager at (480) 792-4150.
Please list the following information, and use this outline to provide us with your comments about this document.
To:
RE:
Reader Response
From: Name
Company
Address
City / State / ZIP / Country
Telephone: (_______) _________ - _________
Application (optional):
Would you like a reply?
Device: PIC16F62X
N
Literature Number: DS40300C
Questions:
1. What are the best features of this document?
2. How does this document meet your hardware and software development needs?
3. Do you find the organization of this document easy to follow? If not, why?
4. What additions to the document do you think would enhance the structure and subject?
5. What deletions from the document could be made without affecting the overall usefulness?
DS40300C-page 166
Preliminary
PIC16F62X
PRODUCT IDENTIFICATION SYSTEM
To order or obtain information, e.g., on pricing or delivery, refer to the factory or the listed sales office.
PART NO.
-XX
Device
Frequency
Range
Temperature
Range
/XX
XXX
Package
Pattern
Device
PIC16F62X:
PIC16F62XT
PIC16LF62X:
PIC16LF62XT:
Frequency Range
04
04
20
=
=
=
Temperature Range
I
E
=
=
=
0C to
-40C to
-40C to
Package
P
SO
SS
=
=
=
PDIP
SOIC (Gull Wing, 300 mil body)
SSOP (209 mil)
Pattern
Examples:
a)
b)
+70C
+85C
+125C
* JW Devices are UV erasable and can be programmed to any device configuration. JW Devices meet the electrical requirement of
each oscillator type.
Please specify which device, revision of silicon and Data Sheet (include Literature #) you are using.
New Customer Notification System
Register on our web site (www.microchip.com/cn) to receive the most current information on our products.
Preliminary
DS40300C-page167
ASIA/PACIFIC
Japan
Corporate Office
Australia
Rocky Mountain
China - Beijing
Atlanta
3780 Mansell Road, Suite 130
Alpharetta, GA 30022
Tel: 770-640-0034 Fax: 770-640-0307
Boston
2 Lan Drive, Suite 120
Westford, MA 01886
Tel: 978-692-3848 Fax: 978-692-3821
Chicago
333 Pierce Road, Suite 180
Itasca, IL 60143
Tel: 630-285-0071 Fax: 630-285-0075
Dallas
4570 Westgrove Drive, Suite 160
Addison, TX 75001
Tel: 972-818-7423 Fax: 972-818-2924
Detroit
Tri-Atria Office Building
32255 Northwestern Highway, Suite 190
Farmington Hills, MI 48334
Tel: 248-538-2250 Fax: 248-538-2260
Kokomo
2767 S. Albright Road
Kokomo, Indiana 46902
Tel: 765-864-8360 Fax: 765-864-8387
Los Angeles
18201 Von Karman, Suite 1090
Irvine, CA 92612
Tel: 949-263-1888 Fax: 949-263-1338
San Jose
Microchip Technology Inc.
2107 North First Street, Suite 590
San Jose, CA 95131
Tel: 408-436-7950 Fax: 408-436-7955
Toronto
6285 Northam Drive, Suite 108
Mississauga, Ontario L4V 1X5, Canada
Tel: 905-673-0699 Fax: 905-673-6509
China - Chengdu
Microchip Technology Consulting (Shanghai)
Co., Ltd., Chengdu Liaison Office
Rm. 2401-2402, 24th Floor,
Ming Xing Financial Tower
No. 88 TIDU Street
Chengdu 610016, China
Tel: 86-28-86766200 Fax: 86-28-86766599
China - Fuzhou
Microchip Technology Consulting (Shanghai)
Co., Ltd., Fuzhou Liaison Office
Unit 28F, World Trade Plaza
No. 71 Wusi Road
Fuzhou 350001, China
Tel: 86-591-7503506 Fax: 86-591-7503521
China - Shanghai
Microchip Technology Consulting (Shanghai)
Co., Ltd.
Room 701, Bldg. B
Far East International Plaza
No. 317 Xian Xia Road
Shanghai, 200051
Tel: 86-21-6275-5700 Fax: 86-21-6275-5060
China - Shenzhen
Microchip Technology Consulting (Shanghai)
Co., Ltd., Shenzhen Liaison Office
Rm. 1812, 18/F, Building A, United Plaza
No. 5022 Binhe Road, Futian District
Shenzhen 518033, China
Tel: 86-755-82901380 Fax: 86-755-82966626
China - Qingdao
Rm. B503, Fullhope Plaza,
No. 12 Hong Kong Central Rd.
Qingdao 266071, China
Tel: 86-532-5027355 Fax: 86-532-5027205
India
Microchip Technology Inc.
India Liaison Office
Divyasree Chambers
1 Floor, Wing A (A3/A4)
No. 11, OShaugnessey Road
Bangalore, 560 025, India
Tel: 91-80-2290061 Fax: 91-80-2290062
Korea
Microchip Technology Korea
168-1, Youngbo Bldg. 3 Floor
Samsung-Dong, Kangnam-Ku
Seoul, Korea 135-882
Tel: 82-2-554-7200 Fax: 82-2-558-5934
Singapore
Microchip Technology Singapore Pte Ltd.
200 Middle Road
#07-02 Prime Centre
Singapore, 188980
Tel: 65-6334-8870 Fax: 65-6334-8850
Taiwan
Microchip Technology (Barbados) Inc.,
Taiwan Branch
11F-3, No. 207
Tung Hua North Road
Taipei, 105, Taiwan
Tel: 886-2-2717-7175 Fax: 886-2-2545-0139
EUROPE
Austria
Microchip Technology Austria GmbH
Durisolstrasse 2
A-4600 Wels
Austria
Tel: 43-7242-2244-399
Fax: 43-7242-2244-393
Denmark
Microchip Technology Nordic ApS
Regus Business Centre
Lautrup hoj 1-3
Ballerup DK-2750 Denmark
Tel: 45 4420 9895 Fax: 45 4420 9910
France
Microchip Technology SARL
Parc dActivite du Moulin de Massy
43 Rue du Saule Trapu
Batiment A - ler Etage
91300 Massy, France
Tel: 33-1-69-53-63-20 Fax: 33-1-69-30-90-79
Germany
Microchip Technology GmbH
Steinheilstrasse 10
D-85737 Ismaning, Germany
Tel: 49-89-627-144 0 Fax: 49-89-627-144-44
Italy
Microchip Technology SRL
Centro Direzionale Colleoni
Palazzo Taurus 1 V. Le Colleoni 1
20041 Agrate Brianza
Milan, Italy
Tel: 39-039-65791-1 Fax: 39-039-6899883
United Kingdom
Microchip Ltd.
505 Eskdale Road
Winnersh Triangle
Wokingham
Berkshire, England RG41 5TU
Tel: 44 118 921 5869 Fax: 44-118 921-5820
12/05/02
DS40300C-page 168
Preliminary