Professional Documents
Culture Documents
PIC16F627
PIC16F628
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:
15 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
Universal Synchronous/Asynchronous Receiver/
Transmitter USART/SCI
16 Bytes of common RAM
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
DS40300B-page 1
PIC16F62X
Pin Diagrams
PDIP, SOIC
1
2
3
4
5
6
7
8
9
PIC16F62X
RA2/AN2/VREF
RA3/AN3/CMP1
RA4/TOCKI/CMP2
RA5/MCLR/THV
VSS
RB0/INT
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
18
17
16
15
14
13
12
11
10
RA1/AN1
RA0/AN0
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT
VDD
RB7/T1OSI
RB6/T1OSO/T1CKI
RB5
RB4/PGM
SSOP
RB0/INT
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
1
2
3
4
5
6
7
8
9
10
PIC16F62X
RA2/AN2/VREF
RA3/AN3/CMP1
RA4/TOCKI/CMP2
RA5/MCLR/THV
VSS
VSS
20
19
18
17
16
15
14
13
12
11
RA1/AN1
RA0/AN0
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT
VDD
VDD
RB7/T1OSI
RB6/T1OSO/T1CKI
RB5
RB4/PGM
Device Differences
Device
Voltage
Range
Oscillator
Process
Technology
(Microns)
PIC16F627
3.0 - 5.5
See Note 1
0.7
PIC16F628
3.0 - 5.5
See Note 1
0.7
PIC16LF627
2.0 - 5.5
See Note 1
0.7
PIC16LF628
2.0 - 5.5
See Note 1
0.7
Note 1: If you change from this device to another device, please verify oscillator characteristics in your application.
DS40300B-page 2
Preliminary
PIC16F62X
Table of Contents
1.0
General Description..................................................................................................................................................................... 5
2.0
PIC16F62X Device Varieties...................................................................................................................................................... 7
3.0
Architectural Overview ................................................................................................................................................................ 9
4.0
Memory Organization ................................................................................................................................................................ 13
5.0
I/O Ports .................................................................................................................................................................................... 27
6.0
Timer0 Module .......................................................................................................................................................................... 45
7.0
Timer1 Module .......................................................................................................................................................................... 50
8.0
Timer2 Module .......................................................................................................................................................................... 54
9.0
Comparator Module................................................................................................................................................................... 57
10.0 Capture/Compare/PWM (CCP) Module .................................................................................................................................... 63
11.0 Voltage Reference Module........................................................................................................................................................ 69
12.0 Universal Synchronous Asynchronous Receiver Transmitter (USART).................................................................................... 71
13.0 Data EEPROM Memory ............................................................................................................................................................ 91
14.0 Special Features of the CPU..................................................................................................................................................... 95
15.0 Instruction Set Summary ......................................................................................................................................................... 113
16.0 Development Support.............................................................................................................................................................. 125
17.0 Electrical Specifications........................................................................................................................................................... 131
18.0 Device Characterization Information ....................................................................................................................................... 145
19.0 Packaging Information............................................................................................................................................................. 147
Index .................................................................................................................................................................................................. 151
On-Line Support................................................................................................................................................................................. 155
Reader Response .............................................................................................................................................................................. 156
PIC16F62X Product Identification System ........................................................................................................................................ 157
Errata
An errata sheet may exist for current devices, describing minor operational differences (from the data sheet) and recommended
workarounds. 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: (602) 786-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
DS40300B-page 3
PIC16F62X
NOTES:
DS40300B-page 4
Preliminary
PIC16F62X
1.0
GENERAL DESCRIPTION
1.1
Development Support
Preliminary
DS40300B-page 5
PIC16F62X
TABLE 1-1:
PIC16F627
PIC16LF627
PIC16LF628
20
20
2048
1024
2048
224
224
224
224
Memory
20
PIC16F628
20
Clock
Maximum Frequency
of Operation (MHz)
128
128
128
128
Timer Module(s)
Capture/Compare/PWM modules 1
Serial Communications
USART
USART
USART
USART
Yes
Yes
Yes
Yes
Interrupt Sources
10
10
10
10
I/O Pins
Peripherals
Comparators(s)
16
16
16
16
3.0-5.5
3.0-5.5
2.0-5.5
2.0-5.5
Brown-out Detect
Yes
Yes
Yes
Yes
Packages
Features
18-pin DIP,
SOIC;
20-pin SSOP
18-pin DIP,
SOIC;
20-pin SSOP
18-pin DIP,
SOIC;
20-pin SSOP
18-pin DIP,
SOIC;
20-pin SSOP
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.
DS40300B-page 6
Preliminary
PIC16F62X
2.0
2.1
Flash Devices
2.2
Quick-Turnaround-Production (QTP)
Devices
2.3
Serialized
Quick-Turnaround-Production
(SQTPSM) Devices
Preliminary
DS40300B-page 7
PIC16F62X
NOTES:
DS40300B-page 8
Preliminary
PIC16F62X
3.0
ARCHITECTURAL OVERVIEW
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
DS40300B-page 9
PIC16F62X
FIGURE 3-1:
BLOCK DIAGRAM
13
Program
Memory
14
Data EEPROM
RAM
File
Registers
8 Level Stack
(13-bit)
Program
Bus
Data Bus
Program Counter
FLASH
PORTA
Addr MUX
Instruction reg
7
Direct Addr
RA0/AN0
RA1/AN1
RA2/AN2/VREF
RA3/AN3/CMP1
RA4/T0CK1/CMP2
RA5/MCLR/THV
RA6/OSC2/CLKOUT
RA7/OSC1/CLKIN
Indirect
Addr
FSR reg
STATUS reg
8
3
Power-up
Timer
Instruction
Decode &
Control
Oscillator
Start-up Timer
Power-on
Reset
Timing
Generation
PORTB
RB0/INT
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
RB4/PGM
RB5
RB6/T1OSO/T1CKI
RB7/T1OSI
ALU
8
Watchdog
Timer
Brown-out
Detect
OSC1/CLKIN
OSC2/CLKOUT
MUX
W reg
Low-Voltage
Programming
MCLR
Comparator
Timer0
VREF
CCP1
VDD, VSS
Timer1
Timer2
USART
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
DS40300B-page 10
Preliminary
PIC16F62X
TABLE 3-1:
SSOP
Pin #
I/O/P
Type
Buffer
Type
RA0/AN0
17
19
I/O
ST
RA1/AN1
18
20
I/O
ST
RA2/AN2/VREF
I/O
ST
RA3/AN3/CMP1
I/O
ST
RA4/T0CKI/CMP2
I/O
ST
RA5/MCLR/THV
ST
RA6/OSC2/CLKOUT
15
17
I/O
ST
RA7/OSC1/CLKIN
16
18
I/O
ST
RB0/INT
I/O
TTL/ST(1)
RB1/RX/DT
I/O
TTL/ST(3)
RB2/TX/CK
I/O
TTL/ST(3)
RB3/CCP1
10
I/O
TTL/ST(4)
RB4/PGM
10
11
I/O
TTL/ST(5)
RB5
11
12
I/O
TTL
RB6/T1OSO/T1CKI
12
13
I/O
TTL/ST(2)
RB7/T1OSI
13
14
I/O
TTL/ST(2)
Name
Description
VSS
5,6
VDD
14
15,16
Legend:
Note 1:
Note 2:
Note 3:
Note 4:
Note 5:
O = output
I/O = input/output
P = power
= Not used
I = Input
ST = Schmitt Trigger input
TTL = TTL input
I/OD =input/open drain output
This buffer is a Schmitt Trigger input when configured as the external interrupt.
This buffer is a Schmitt Trigger input when used in serial programming mode.
This buffer is a Schmitt Trigger I/O when used in USART/Synchronous mode.
This buffer is a Schmitt Trigger I/O when used in CCP mode.
This buffer is a Schmitt Trigger input when used in low voltage program mode.
Preliminary
DS40300B-page 11
PIC16F62X
3.1
3.2
Instruction Flow/Pipelining
FIGURE 3-2:
CLOCK/INSTRUCTION CYCLE
Q1
Q2
Q3
Q4
Q2
Q1
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
Q1
Q2
Internal
phase
clock
Q3
Q4
PC
OSC2/CLKOUT
(ER mode)
EXAMPLE 3-1:
PC
PC+1
PC+2
1. MOVLW 55h
2. MOVWF PORTB
3. CALL
SUB_1
4. BSF
Fetch 1
Execute 1
Fetch 2
Execute 2
Fetch 3
PORTA, BIT3
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.
DS40300B-page 12
Preliminary
PIC16F62X
4.0
MEMORY ORGANIZATION
4.1
FIGURE 4-1:
CALL, RETURN
RETFIE, RETLW
Stack Level 1
Stack Level 2
Stack Level 8
Reset Vector
PC<12:0>
000h
Interrupt Vector
CALL, RETURN
RETFIE, RETLW
13
0004
0005
13
On-chip Program
Memory
Stack Level 1
Stack Level 2
07FFh
0800h
Stack Level 8
Reset Vector
1FFFh
000h
4.2
Interrupt Vector
0004
0005
On-chip Program
Memory
03FFh
0400h
RP0
Bank0
Bank1
Bank2
Bank3
1FFFh
Preliminary
DS40300B-page 13
PIC16F62X
FIGURE 4-3:
Indirect addr.(*)
00h
Indirect addr.(*)
80h
Indirect addr.(*)
100h
Indirect addr.(*)
180h
TMR0
01h
OPTION
81h
TMR0
101h
OPTION
181h
PCL
02h
PCL
82h
PCL
102h
PCL
182h
STATUS
03h
STATUS
83h
STATUS
103h
STATUS
183h
FSR
04h
84h
FSR
104h
FSR
184h
PORTA
05h
TRISA
85h
PORTB
06h
TRISB
86h
FSR
105h
PORTB
106h
185h
TRISB
186h
07h
87h
107h
187h
08h
88h
108h
188h
09h
89h
109h
PCLATH
0Ah
INTCON
0Bh
PIR1
0Ch
PCLATH
INTCON
189h
8Ah
PCLATH
10Ah
PCLATH
18Ah
8Bh
INTCON
10Bh
INTCON
18Bh
8Ch
18Ch
8Dh
PIE1
0Dh
10Ch
10Dh
18Dh
8Eh
10Eh
18Eh
10Fh
18Fh
TMR1L
0Eh
TMR1H
0Fh
8Fh
T1CON
10h
90h
TMR2
11h
91h
T2CON
12h
PCON
PR2
92h
13h
93h
14h
94h
CCPR1L
15h
95h
CCPR1H
16h
96h
CCP1CON
17h
RCSTA
18h
TXSTA
98h
TXREG
19h
RCREG
SPBRG
EEDATA
99h
1Ah
1Bh
EEADR
9Bh
1Ch
EECON1
9Ch
1Dh
EECON2*
9Dh
97h
1Eh
CMCON
1Fh
20h
9Ah
9Eh
VRCON
General
Purpose
Register
80 Bytes
9Fh
A0h
General
Purpose
Register
48 Bytes
General
Purpose
Register
96 Bytes
accesses
70h-7Fh
7Fh
Bank 0
EFh
F0h
accesses
70h-7Fh
14Fh
150h
16Fh
170h
1EFh
1F0h
accesses
70h - 7Fh
17Fh
FFh
Bank 2
Bank 1
11Fh
120h
1FFh
Bank 3
DS40300B-page 14
Preliminary
PIC16F62X
4.2.2
TABLE 4-1:
Address
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Value on
all other
Value on
POR
Reset
Bit 0
Resets(1)
Bank 0
00h
INDF
Addressing this location uses contents of FSR to address data memory (not a physical register)
xxxx xxxx
xxxx xxxx
01h
TMR0
xxxx xxxx
uuuu uuuu
02h
PCL
03h
STATUS
IRP
04h
FSR
05h
PORTA
06h
07h
PORTB
Unimplemented
08h
09h
Unimplemented
Unimplemented
0000 0000
0000 0000
PD
DC
0001 1xxx
000q quuu
RA3
RA2
RA1
RA0
xxxx xxxx
xxxx 0000
uuuu uuuu
xxxx 0000
RB7
RB3
RB2
RB1
RB0
xxxx xxxx
uuuu uuuu
---0 0000
---0 0000
RP0
RP1
RB6
TO
RB5
RB4
0Ah
PCLATH
0Bh
INTCON
GIE
PEIE
T0IE
INTE
0Ch
0Dh
PIR1
Unimplemented
EEIF
CMIF
RCIF
TXIF
0Eh
TMR1L
0Fh
TMR1H
10h
11h
T1CON
TMR2
12h
13h
T2CON
Unimplemented
T0IF
INTF
RBIF
0000 000x
0000 000u
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
Holding register for the least significant byte of the 16-bit TMR1
xxxx xxxx
uuuu uuuu
Holding register for the most significant byte of the 16-bit TMR1
xxxx xxxx
uuuu uuuu
--00 0000
--uu uuuu
0000 0000
0000 0000
-000 0000
-uuu uuuu
T1CKPS1
T1CKPS0
RBIE
T1OSCEN
T1SYNC
TMR1CS
TMR1ON
TOUTPS3
TOUTPS2
TOUTPS1
TOUTPS0
TMR2ON
T2CKPS1 T2CKPS0
14h
Unimplemented
15h
CCPR1L
16h
CCPR1H
17h
CCP1CON
CCP1X
CCP1Y
CCP1M3
CCP1M2
CCP1M1
18h
RCSTA
SPEN
ADEN
FERR
OERR
19h
TXREG
1Ah
1Bh
RCREG
Unimplemented
1Ch
1Dh
Unimplemented
Unimplemented
1Eh
CMCON
SREN
xxxx xxxx
--00 0000
uuuu uuuu
--00 0000
RX9D
0000 -00x
0000 -00x
0000 0000
0000 0000
0000 0000
CREN
CCP1M0
0000 0000
RX9
uuuu uuuu
0000 0000
0000 0000
Unimplemented
1Fh
xxxx xxxx
C2OUT
C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
Preliminary
DS40300B-page 15
PIC16F62X
TABLE 4-2:
Address
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)
Bank 1
80h
INDF
Addressing this location uses contents of FSR to address data memory (not a physical reg- xxxx xxxx
ister)
xxxx xxxx
81h
82h
OPTION
PCL
INTEDG
T0CS
T0SE
PSA
RBPU
Program Counters (PC) Least Significant Byte
1111 1111
83h
84h
STATUS
FSR
IRP
RP1
RP0
TO
Indirect data memory address pointer
85h
86h
TRISA
TRISB
TRISA7
TRISB7
87h
Unimplemented
88h
Unimplemented
89h
Unimplemented
8Ah
PCLATH
TRISA6
TRISB6
PS1
PS0
1111 1111
0000 0000
0000 0000
0001 1xxx
000q quuu
TRISB5
PD
DC
xxxx xxxx
uuuu uuuu
TRISA4
PS2
TRISA3
TRISA2
TRISA1
TRISA0
11-1 1111
11-1 1111
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
1111 1111
1111 1111
---0 0000
---0 0000
8Bh
INTCON
GIE
PEIE
T0IE
INTE
8Ch
PIE1
EEIE
CMIE
RCIE
TXIE
RBIE
T0IF
CCP1IE
INTF
TMR2IE
RBIF
TMR1IE
0000 000x
0000 -000
0000 000u
0000 -000
POR
BOD
---- 1-0x
---- 1-uq
8Dh
Unimplemented
8Eh
PCON
8Fh
90h
Unimplemented
Unimplemented
91h
Unimplemented
92h
PR2
93h
94h
Unimplemented
Unimplemented
95h
96h
Unimplemented
Unimplemented
OSCF
11111111
97h
Unimplemented
98h
TXSTA
CSRC
99h
SPBRG
9Ah
EEDATA
9Bh
9Ch
EEADR
EECON1
9Dh
9Eh
EECON2
Unimplemented
9Fh
VRCON
VREN
11111111
0000 -010
0000 -010
0000 0000
0000 0000
xxxx xxxx
uuuu uuuu
xxxx xxxx
---- x000
uuuu uuuu
---- q000
-------
-------
000- 0000
000- 0000
TX9
TXEN
SYNC
VROE
VRR
WRERR
VR3
BRGH
WREN
VR2
TRMT
WR
VR1
TX9D
RD
VR0
DS40300B-page 16
Preliminary
PIC16F62X
TABLE 4-3:
Address
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)
Bank 1
100h
INDF
Addressing this location uses contents of FSR to address data memory (not a physical reg- xxxx xxxx
ister)
xxxx xxxx
101h
102h
TMR0
PCL
INTEDG
T0CS
T0SE
PSA
RBPU
Program Counters (PC) Least Significant Byte
1111 1111
103h
104h
STATUS
FSR
IRP
RP1
RP0
TO
Indirect data memory address pointer
105h
106h
Unimplemented
107h
Unimplemented
108h
Unimplemented
109h
Unimplemented
10Ah
PCLATH
10Bh
10Ch
INTCON
10Dh
10Eh
Unimplemented
10Fh
110h
PORTB
PS2
PS1
PS0
1111 1111
DC
0000 0000
0001 1xxx
000q quuu
xxxx xxxx
PD
0000 0000
uuuu uuuu
TRISB7
GIE
TRISB6
PEIE
TRISB5
T0IE
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
1111 1111
1111 1111
---0 0000
---0 0000
INTE
0000 000x
0000 000u
RBIE
T0IF
INTF
RBIF
Unimplemented
Unimplemented
111h
112h
Unimplemented
113h
114h
Unimplemented
Unimplemented
115h
116h
Unimplemented
Unimplemented
117h
Unimplemented
118h
119h
11Ah
11Bh
11Ch
11Dh
11Eh
Unimplemented
11Fh
Preliminary
DS40300B-page 17
PIC16F62X
TABLE 4-4:
Address
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)
Bank 1
180h
INDF
Addressing this location uses contents of FSR to address data memory (not a physical reg- xxxx xxxx
ister)
xxxx xxxx
181h
182h
OPTION
PCL
INTEDG
T0CS
T0SE
PSA
RBPU
Program Counters (PC) Least Significant Byte
1111 1111
183h
184h
STATUS
FSR
IRP
RP1
RP0
TO
Indirect data memory address pointer
185h
Unimplemented
186h
TRISB
187h
Unimplemented
188h
Unimplemented
189h
Unimplemented
18Ah
PCLATH
18Bh
INTCON
PS2
PS1
PS0
1111 1111
DC
0000 0000
0001 1xxx
000q quuu
xxxx xxxx
PD
0000 0000
uuuu uuuu
TRISB7
GIE
TRISB6
PEIE
TRISB5
T0IE
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
1111 1111
1111 1111
---0 0000
---0 0000
INTE
0000 000x
0000 000u
RBIE
T0IF
INTF
RBIF
18Ch
18Dh
18Eh
18Fh
190h
191h
192h
193h
194h
195h
196h
197h
198h
199h
19Ah
19Bh
19Ch
19Dh
19Eh
19Fh
DS40300B-page 18
Preliminary
PIC16F62X
4.2.2.1
STATUS REGISTER
bit 7:
R/W-0
RP1
R/W-0
RP0
R-1
TO
R-1
PD
R/W-x
Z
R/W-x
DC
R/W-x
C
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
-n = Value at POR reset
-x = Unknown at POR reset
bit 6-5: RP1:RP0: Register Bank Select bits (used for direct addressing)
11 = Bank 3 (180h - 1FFh)
10 = Bank 2 (100h - 17Fh)
01 = Bank 1 (80h - FFh)
00 = Bank 0 (00h - 7Fh)
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:
Preliminary
DS40300B-page 19
PIC16F62X
4.2.2.2
OPTION REGISTER
R/W-1
R/W-1
INTEDG T0CS
R/W-1
T0SE
R/W-1
PSA
R/W-1
PS2
R/W-1
PS1
R/W-1
PS0
bit0
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
R = Readable bit
W = Writable bit
-n = Value at POR reset
DS40300B-page 20
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
Preliminary
PIC16F62X
4.2.2.3
INTCON REGISTER
Note:
R/W-0
PEIE
R/W-0
T0IE
R/W-0
INTE
R/W-0
RBIE
R/W-0
T0IF
R/W-0
INTF
R/W-x
RBIF
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit, read
as 0
-n = Value at POR reset
-x = Unknown at POR reset
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
bit 2:
bit 1:
bit 0:
Preliminary
DS40300B-page 21
PIC16F62X
4.2.2.4
PIE1 REGISTER
R/W-0
CMIE
R/W-0
RCIE
R/W-0
TXIE
U
-
R/W-0
CCP1IE
bit 7:
bit 5:
bit 4:
bit 3:
Unimplemented: Read as 0
bit 2:
bit 1:
bit 0:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read
as 0
-n = Value at POR reset
bit 6:
R/W-0
R/W-0
TMR2IE TMR1IE
bit0
DS40300B-page 22
Preliminary
PIC16F62X
4.2.2.5
PIR1 REGISTER
Note:
R/W-0
CMIF
R-0
RCIF
R-0
TXIF
R/W-0
CCP1IF
R/W-0
R/W-0
TMR2IF TMR1IF
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit, read
as 0
-n = Value at POR reset
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
Unimplemented: Read as 0
bit 2:
bit 1:
bit 0:
Preliminary
DS40300B-page 23
PIC16F62X
4.2.2.6
PCON REGISTER
bit7
U-0
U-0
U-0
R/W-1
OSCF
U-0
R/W-q
POR
R/W-q
BOD
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit, read
as 0
-n = Value at POR reset
bit 1:
bit 0:
Note 1: When in ER oscillator mode, setting OSCF = 1 will cause the oscillator speed to change to the speed
specified by the external resistor.
DS40300B-page 24
Preliminary
PIC16F62X
4.3
4.3.2
FIGURE 4-7:
LOADING OF PC IN
DIFFERENT SITUATIONS
PCH
PCL
12
PC
5
PCLATH<4:0>
Note 1:
Note 2:
Instruction with
PCL as
Destination
ALU result
PCLATH
PCH
12
11 10
STACK
PCL
8
PC
GOTO, CALL
2
PCLATH<4:3>
11
Opcode <10:0>
PCLATH
4.3.1
COMPUTED GOTO
Preliminary
DS40300B-page 25
PIC16F62X
4.4
EXAMPLE 4-1:
INDIRECT ADDRESSING
movlw
INDF
FSR
;inc pointer
btfss
FSR,4
;all done?
goto
;to RAM
clrf
NEXT
FSR
incf
0x20
movwf
;initialize pointer
NEXT
CONTINUE:
FIGURE 4-8:
RP1
RP0
bank select
from opcode
Indirect Addressing
0
IRP
bank select
location select
00
01
10
FSR register
location select
11
00h
180h
Data
Memory
7Fh
1FFh
Bank 0
Bank 1
Bank 2
Bank 3
DS40300B-page 26
Preliminary
PIC16F62X
5.0
I/O PORTS
5.1
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<7:5> are always
;read as 0.
Preliminary
DS40300B-page 27
PIC16F62X
FIGURE 5-1:
Data
Bus
BLOCK DIAGRAM OF
RA0/AN0:RA1/AN1 PINS
FIGURE 5-2:
Data
Bus
VDD
VDD
WR
PORTA
CK
VDD
VDD
WR
PORTA
CK
Data Latch
Data Latch
D
BLOCK DIAGRAM OF
RA2/VREF PIN
I/O Pin
WR
TRISA
N
CK
WR
TRISA
VSS
CK
VSS
Analog
Input Mode
Analog
Input Mode
RD TRISA
Schmitt Trigger
Input Buffer
RA2 Pin
VSS
TRIS Latch
VSS
TRIS Latch
RD TRISA
Schmitt Trigger
Input Buffer
EN
EN
RD PORTA
RD PORTA
To Comparator
To Comparator
VROE
VREF
DS40300B-page 28
Preliminary
PIC16F62X
FIGURE 5-3:
Data
Bus
VDD
Q
Comparator Output
WR
PORTA
VDD
1
CK
Data Latch
Q
RA3 Pin
WR
TRISA
CK
VSS
VSS
TRIS Latch
Analog
Input Mode
Schmitt Trigger
Input Buffer
RD TRISA
Q
EN
RD PORTA
To Comparator
FIGURE 5-4:
Data
Bus
Q
Comparator Output
WR
PORTA
1
CK
Data Latch
D
WR
TRISA
Q
RA4 Pin
N
CK
Q
VSS
TRIS Latch
VSS
Schmitt Trigger
Input Buffer
RD TRISA
Q
EN
RD PORTA
Preliminary
DS40300B-page 29
PIC16F62X
FIGURE 5-5:
MCLR Filter(1)
Program mode
HV Detect
RA5/MCLR/THV
Data
Bus
WR
PORT
CK
VDD
VSS
Data Latch
D
WR
TRIS
Q
N
CK
TRIS Latch
VSS
RD TRIS
Q
EN
RD Port
DS40300B-page 30
Preliminary
PIC16F62X
FIGURE 5-6:
From OSC1
CLKOUT (FOSC/4)
1
VDD
Data
Bus
WR
PORTA
CK
RA6/OSC2/CLKOUT Pin
VDD
VSS
Data Latch
D
WR
TRISA
Oscillator
Circuit
Q
N
CK
TRIS Latch
VSS
(Fosc=100, 101, 110, 111)
RD TRISA
(Fosc=110, 100)
Q
Schmitt Trigger
Input Buffer
EN
RD PORTA
Preliminary
DS40300B-page 31
PIC16F62X
FIGURE 5-7:
Oscillator
Circuit
VDD
CLKIN to core
Data
Bus
VDD
RA7/OSC1/CLKIN Pin
WR
PORTA
CK
Data Latch
D
WR
TRISA
Schmitt Trigger
VSS
Q
N
CK
TRIS Latch
(Fosc=101, 100)
VSS
(Fosc=101, 100)
Schmitt Trigger
Input Buffer
RD TRISA
Q
EN
RD PORTA
DS40300B-page 32
Preliminary
PIC16F62X
TABLE 5-1:
PORTA FUNCTIONS
Bit #
Buffer
Type
RA0/AN0
RA1/AN1
RA2/AN2/VREF
RA3/AN3
RA4/T0CKI
bit0
bit1
bit2
bit3
bit4
ST
ST
ST
ST
ST
RA5/MCLR/THV
bit5
ST
RA6/OSC2/CLKOUT
bit6
ST
Name
RA7/OSC1/CLKIN
bit7
ST
Legend: ST = Schmitt Trigger input
TABLE 5-2:
Address Name
Function
Bi-directional I/O port/comparator input
Bi-directional I/O port/comparator input
Bi-directional I/O port/analog/comparator input or VREF output
Bi-directional I/O port/analog/comparator input/comparator output
Bi-directional I/O port/external clock input for TMR0 or comparator output.
Output is open drain type.
Input port/master clear (reset input/programming voltage input. When
configured as MCLR, this pin is an active low reset to the device. Voltage
on MCLR/THV must not exceed VDD during normal device operation.
Bi-directional I/O port/Oscillator crystal output. Connects to crystal or resonator in crystal oscillator mode. In ER mode, OSC2 pin outputs CLKOUT
which has 1/4 the frequency of OSC1, and denotes the instruction cycle
rate.
Bi-directional I/O port/oscillator crystal input/external clock source input.
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Value on
All Other
Resets
05h
PORTA
RA7
RA6
RA5
RA4
RA3
RA2
RA1
RA0
xxxx 0000
xxxu 0000
85h
TRISA
TRISA7
TRISA6
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
11-1 1111
11-1 1111
1Fh
CMCON
C2OUT
C1OUT
C2INV
C1INV
CIS
CM2
CM1
CM0
0000 0000
0000 0000
9Fh
VRCON
VREN
VROE
VRR
VR3
VR2
VR1
VR0
000- 0000
000- 0000
Preliminary
DS40300B-page 33
PIC16F62X
5.2
DS40300B-page 34
b)
Preliminary
PIC16F62X
FIGURE 5-8:
RBPU
weak
P pull-up
RB0/INT pin
Data Bus
WR PORTB
Q
VSS
CK
Data Latch
D
WR TRISB
Q
TTL
input
buffer
CK
TRIS Latch
Schmitt Trigger
Buffer
RD TRISB
Q
D
EN
EN
RD PORTB
INT input
Preliminary
DS40300B-page 35
PIC16F62X
FIGURE 5-9:
PORT/PERIPHERAL Select
(1)
0
VDD
1
Data Bus
D
WR PORTB
CK
VDD
Data Latch
D
WR TRISB
CK
RB1/RX/DT
pin
Q
Q
N
VSS
TRIS Latch
VSS
RD TRISB
TTL
input
buffer
Peripheral OE(2)
Q
RD PORTB
EN
USART receive input
Schmitt
Trigger
RD PORTB
Note 1: Port/Peripheral select signal selects between port data and peripheral output.
Note 2: Peripheral OE( output enable) is only active if peripheral select is active.
DS40300B-page 36
Preliminary
PIC16F62X
FIGURE 5-10: BLOCK DIAGRAM OF RB2/TX/CK PIN
VDD
RBPU
P weak pull-up
VDD
PORT/PERIPHERAL Select(1)
USART TX/CK output
0
VDD
1
Data Bus
D
WR PORTB
CK
RB2/TX/CK
pin
VSS
Data Latch
D
WR TRISB
CK
TRIS Latch
Vss
RD TRISB
TTL
input
buffer
Peripheral OE(2)
Q
RD PORTB
EN
EN
USART Slave Clock in
Schmitt
Trigger
RD PORTB
Note 1: Port/Peripheral select signal selects between port data and peripheral output.
Note 2: Peripheral OE( output enable) is only active if peripheral select is active.
Preliminary
DS40300B-page 37
PIC16F62X
FIGURE 5-11: BLOCK DIAGRAM OF THE RB3/CCP1 PIN
VDD
RBPU
P weak pull-up
Port/Peripheral Select(1)
PWM/Compare output
0
VDD
1
Data Bus
D
WR PORTB
CK
VDD
Data Latch
D
WR TRISB
CK
RB3/CCP1
pin
Q
N
VSS
TRIS Latch
Vss
RD TRISB
TTL
input
buffer
Q
RD PORTB
EN
EN
CCP input
Schmitt
Trigger
RD PORTB
DS40300B-page 38
Preliminary
PIC16F62X
FIGURE 5-12: BLOCK DIAGRAM OF RB4/PGM PIN
VDD
RBPU
P weak pull-up
VDD
Data Bus
D
WR PORTB
CK
VDD
Data Latch
D
WR TRISB
CK
RB4/PGM
Q
Q
N
VSS
TRIS Latch
VSS
RD TRISB
LVP
RD PORTB
PGM input
TTL
input
buffer
Schmitt
Trigger
D
Q1
EN
Set RBIF
From other
RB<7:4> pins
D
RD Port
EN
Note:
Q3
The low voltage programming disables the interrupt on change and the weak pullups on RB4.
Preliminary
DS40300B-page 39
PIC16F62X
FIGURE 5-13: BLOCK DIAGRAM OF RB5 PIN
VDD
RBPU
Data Bus
weak VDD
P pull-up
Q
RB5 pin
WR PORTB
CK
Data Latch
VSS
D
WR TRISB
CK
TRIS Latch
TTL
input
buffer
RD TRISB
Q
RD PORTB
EN
Q1
Set RBIF
From other
RB<7:4> pins
EN
DS40300B-page 40
Preliminary
RD Port
Q3
PIC16F62X
FIGURE 5-14:
Data Bus
D
WR PORTB
CK
VDD
Data Latch
D
WR TRISB
CK
RB6/
T1OSO/
T1CKI
pin
Q
N
VSS
TRIS Latch
VSS
RD TRISB
T1OSCEN
TTL
input
buffer
RD PORTB
TMR1 Clock
From RB7
Schmitt
Trigger
TMR1 oscillator
EN
Q1
Set RBIF
From other
RB<7:4> pins
D
RD Port
EN
Preliminary
Q3
DS40300B-page 41
PIC16F62X
FIGURE 5-15: BLOCK DIAGRAM OF THE RB7/T1OSI PIN
VDD
RBPU
TMR1 oscillator
P weak pull-up
To RB6
T1OSCEN
VDD
VDD
Data Bus
D
WR PORTB
CK
P
RB7/T1OSI
pin
Data Latch
D
WR TRISB
CK
VSS
N
TRIS Latch
Vss
RD TRISB
T10SCEN
TTL
input
buffer
RD PORTB
Schmitt
Trigger
Q
EN
Q1
Set RBIF
From other
RB<7:4> pins
D
RD Port
EN
DS40300B-page 42
Preliminary
Q3
PIC16F62X
TABLE 5-3:
PORTB FUNCTIONS
Bit #
Buffer
Type
bit0
Name
TTL/ST(1)
Function
TABLE 5-4:
Address Name
Bit 7
Bit 6
06h
PORTB
RB7
RB6
86h
TRISB
TRISB7
TRISB6
81h
OPTION
RBPU
INTEDG
Legend:
Note:
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
u = unchanged, x = unknown
Shaded bits are not used by PORTB.
Preliminary
DS40300B-page 43
PIC16F62X
5.3
5.3.1
EXAMPLE 5-2:
READ-MODIFY-WRITE
INSTRUCTIONS ON AN
I/O PORT
5.3.2
PC
PC
Instruction
Instruction
fetched
fetched
Q2
Q3
Q3
Q4
PC
PC
MOWF PORTB
MOVWF PORTB
Write to PORTB
Write to
PORTB
Q1
Q1
Q2
Q2
Q3 Q4
Q3 Q4
PC + 1
PC + 1
MOVF PORTB, W
MOVF PORTB, W
Read to PORTB
Read PORTB
Q1
Q2
Q3
Q4
Q1
Q1
PC + 2
PC + 2
NOP
NOP
Q2
Q3
PC + 3
PC + 3
NOP
NOP
Port pin
Port pin
sampledhere
sampled here
DS40300B-page 44
Note:
This example shows write to PORTB
followed by a read from PORTB.
Note that:
data setup time = (0.25 TCY - TPD)
where TCY = instruction cycle and
TPD = propagation delay of Q1 cycle
to output valid.
RB<7:0>
RB <7:0>
TPD
PD
Execute
Execute
MOVWF
MOVWF
PORTB
PORTB
Q4
Execute
Execute
MOVWF
MOVF
PORTB
PORTB, W
Preliminary
Execute
Execute
NOP
NOP
PIC16F62X
6.0
TIMER0 MODULE
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
FIGURE 6-1:
TIMER0 Interrupt
RA4/T0CKI
pin
FOSC/4
PSout
1
1
Programmable
Prescaler
TMR0
PSout
(2 TCY delay)
T0SE
PS2:PS0
8
Sync with
Internal
clocks
PSA
T0CS
Note 1:
2:
Bits T0SE, T0CS, PS2, PS1, PS0 and PSA are located in the OPTION register.
The prescaler is shared with Watchdog Timer (Figure 6-6)
FIGURE 6-2:
PC
(Program
Counter)
Instruction
Fetch
TMR0
PC
MOVWF TMR0
T0
T0+1
Instruction
Executed
PC+1
PC+2
PC+3
MOVF TMR0,W
NT0
T0+2
Write TMR0
executed
PC+4
Read TMR0
reads NT0
Read TMR0
reads NT0
Preliminary
PC+5
MOVF TMR0,W
NT0+1
Read TMR0
reads NT0
PC+6
Read TMR0
reads NT0 + 1
NT0+2
T0
Read TMR0
reads NT0 + 2
DS40300B-page 45
PIC16F62X
FIGURE 6-3:
PC
(Program
Counter)
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
PC-1
PC
PC+1
MOVWF TMR0
Instruction
Fetch
T0
TMR0
PC+2
PC+3
T0+1
Instruction
Execute
PC+5
MOVF TMR0,W
PC+6
MOVF TMR0,W
NT0+1
NT0
Read TMR0
reads NT0
Write TMR0
executed
FIGURE 6-4:
PC+4
Read TMR0
reads NT0
Read TMR0
reads NT0
Read TMR0
reads NT0
Read TMR0
reads NT0 + 1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
CLKOUT(3)
TMR0 timer
FFh
FEh
1
T0IF bit
(INTCON<2>)
00h
01h
02h
GIE bit
(INTCON<7>)
Interrupt Latency Time
INSTRUCTION FLOW
PC
PC
Instruction
fetched
Inst (PC)
Instruction
executed
Inst (PC-1)
PC +1
PC +1
Inst (PC)
Dummy cycle
0005h
Inst (0004h)
Inst (PC+1)
0004h
Inst (0005h)
Dummy cycle
Inst (0004h)
DS40300B-page 46
Preliminary
PIC16F62X
6.2
FIGURE 6-5:
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Small pulse
misses sampling
(1)
(3)
External Clock/Prescaler
Output after sampling
Increment Timer0 (Q4)
Timer0
Note 1:
2:
3:
T0
T0 + 1
T0 + 2
Delay from clock input change to Timer0 increment is 3Tosc to 7Tosc. (Duration of Q = Tosc). Therefore, the error in
measuring the interval between two edges on Timer0 input = 4Tosc max.
External clock if no prescaler selected, Prescaler output otherwise.
The arrows indicate the points in time where sampling occurs.
Preliminary
DS40300B-page 47
PIC16F62X
6.3
Prescaler
FIGURE 6-6:
CLKOUT (=Fosc/4)
0
T0CKI
pin
M
U
X
1
M
U
X
SYNC
2
Cycles
TMR0 reg
T0SE
T0CS
Watchdog
Timer
M
U
X
PSA
8-bit Prescaler
8
8-to-1MUX
PS0 - PS2
PSA
0
MUX
PSA
WDT
Time-out
Note: T0SE, T0CS, PSA, PS0-PS2 are bits in the OPTION register.
DS40300B-page 48
Preliminary
PIC16F62X
6.3.1
EXAMPLE 6-2:
CHANGING PRESCALER
(WDTTIMER0)
CLRWDT
EXAMPLE 6-1:
CHANGING PRESCALER
(TIMER0WDT)
1.BCF
STATUS, RP0
2.CLRWDT
3.CLRF
4.BSF
5.MOVLW
6.MOVWF
TMR0
STATUS, RP0
'00101111b
OPTION
7.CLRWDT
8.MOVLW '00101xxxb
9.MOVWF OPTION
10.BCF
STATUS, RP0
TABLE 6-1:
Address
BSF
MOVLW
MOVWF
BCF
;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
STATUS, RP0
b'xxxx0xxx'
OPTION_REG
STATUS, RP0
Name
01h
TMR0
0Bh/8Bh/
INTCON
10Bh/18Bh
81h
OPTION
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
T0IE
INTE
RBIE
T0IF
INTF
RBIF
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
TRISA7
TRISA6
TRISA2
TRISA1
TRISA4 TRISA3
Preliminary
DS40300B-page 49
PIC16F62X
7.0
TIMER1 MODULE
bit7
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 2:
bit 1:
bit 0:
DS40300B-page 50
Preliminary
PIC16F62X
7.1
7.2
When an external clock input is used for Timer1 in synchronized counter mode, it must meet certain requirements. The external clock requirement is due to
FIGURE 7-1:
TMR1
TMR1H
Synchronized
clock input
TMR1L
1
TMR1ON
on/off
T1SYNC
T1OSC
RB6/T1OSO/T1CKI
RB7/T1OSI
1
T1OSCEN FOSC/4
Enable
Internal
Oscillator(1) Clock
Prescaler
1, 2, 4, 8
Synchronize
det
0
2
T1CKPS1:T1CKPS0
TMR1CS
SLEEP input
Note 1: When the T1OSCEN bit is cleared, the inverter and feedback resistor are turned off. This eliminates power drain.
Preliminary
DS40300B-page 51
PIC16F62X
FIGURE 7-2:
T1CKI
(Default high)
T1CKI
(Default low)
7.3
EXAMPLE 7-1:
; All interrupts
MOVF
TMR1H,
MOVWF TMPH
MOVF
TMR1L,
MOVWF TMPL
MOVF
TMR1H,
SUBWF TMPH,
READING A 16-BIT
FREE-RUNNING TIMER
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 Interrupt (if required)
CONTINUE
;Continue with your code
7.4
Timer1 Oscillator
TABLE 7-1:
Osc Type
Freq
C1
C2
LP
32 kHz
100 kHz
200 kHz
33 pF
15 pF
15 pF
33 pF
15 pF
15 pF
DS40300B-page 52
Preliminary
PIC16F62X
7.5
7.6
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.
7.7
Timer1 Prescaler
In the event that a write to Timer1 coincides with a special event trigger from CCP1, the write will take precedence.
In this mode of operation, the CCPRxH:CCPRxL registers pair effectively becomes the period register for
Timer1.
TABLE 7-2:
Address
Name
Value on
POR
Value on
all other
resets
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
0Bh/8Bh/
INTCON
10Bh/18Bh
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0Ch
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
TMR1IE
PIR1
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
8Ch
PIE1
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 TMR1 register
10h
T1CON
Legend:
T1CKPS1 T1CKPS0 T1OSCEN T1SYNC TMR1CS TMR1ON --00 0000 --uu uuuu
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the Timer1 module.
Preliminary
DS40300B-page 53
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
PR2 reg
DS40300B-page 54
Preliminary
PIC16F62X
REGISTER 8-1: T2CON: TIMER2 CONTROL REGISTER (ADDRESS 12h)
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
T2CKPS1 T2CKPS0
bit7
bit0
bit 7:
bit 6-3:
bit 2:
bit 1-0:
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
TABLE 8-1:
Address
Name
0Bh/8Bh/
INTCON
10Bh/18Bh
Value on
all other
resets
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
8Ch
PIE1
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
TMR1IE
11h
TMR2
12h
T2CON
92h
Legend:
PR2
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by the Timer2 module.
Preliminary
DS40300B-page 55
PIC16F62X
NOTES:
DS40300B-page 56
Preliminary
PIC16F62X
9.0
COMPARATOR MODULE
REGISTER 9-1:
R-0
C2OUT
bit7
bit 7:
R-0
C1OUT
R/W-0
C1INV
R/W-0
CIS
R/W-0
CM2
R/W-0
CM1
R/W-0
CM0
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit, read
as 0
-n = Value at POR reset
bit 6:
bit 5:
bit 4:
bit 3:
Preliminary
DS40300B-page 57
PIC16F62X
9.1
Comparator Configuration
FIGURE 9-1:
Comparators Off
CM2:CM0 = 111
RA0/AN0
Vin-
RA3/AN3/C10
Vin+
RA1/AN1
C1
Off (Read as 0)
C2
Off (Read as 0)
Vin-
RA2/AN2
Note:
Vin+
Vin-
RA3/AN3/C10
Vin+
Vin-
Vin+
RA1/AN1
RA2/AN2
RA3/AN3/C10
RA1/AN1
Vin-
RA2/AN2
Vin+
C2
Off (Read as 0)
C1
C2
C1OUT
RA3/AN3/C10
A
A
RA2/AN2
VinVin+
RA0/AN0
RA1/AN1
Off (Read as 0)
C1
CIS = 0
CIS = 1
Vin-
CIS = 0
CIS = 1
Vin-
C2OUT
Vin+
Vin+
C1
C1OUT
C2
C2OUT
Vin+
RA1/AN1
RA2/AN2
Vin+
RA3/AN3/C10
Vin-
RA3/AN3/C10
Vin+
RA1/AN1
Vin-
RA2/AN2
Vin-
RA0/AN0
Vin+
RA0/AN0
Vin-
C1
C2
C1OUT
C2OUT
RA0/AN0
D
D
Vin+
RA1/AN1
RA2/AN2
Vin+
C1
Off (Read as 0)
Vin-
C2
C2OUT
Vin-
RA3/AN3/C10
C1OUT
Open Drain
RA4/T0CKI/C20
One Independent Comparator
CM2:CM0 = 101
C1
C2
C2OUT
RA0/AN0
RA3/AN3/C10 A
CIS = 0
CIS = 1
VinVin+
RA1/AN1
A
A
Vin+
C1OUT
C2
C2OUT
Vin-
RA2/AN2
C1
DS40300B-page 58
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
BCF
CALL
MOVF
BCF
BSF
BSF
BCF
BSF
BSF
9.2
INITIALIZING
COMPARATOR MODULE
9.3
Comparator Reference
FIGURE 9-2:
EQU
FLAG_REG
PORTA
CMCON, W
0xC0
FLAG_REG,F
0x03
CMCON
STATUS,RP0
0x07
TRISA
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
DELAY 10
;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
Comparator Operation
VIN
Output
VIN
VIN+
Output
9.3.1
VIN+
SINGLE COMPARATOR
Preliminary
DS40300B-page 59
PIC16F62X
9.4
9.5
Comparator Outputs
FIGURE 9-3:
MULTIPLEX
CnINV
Q1
EN
RD CMCON
D
Q3 * RD CMCON
EN
CL
From other Comparator
DS40300B-page 60
NRESET
Preliminary
PIC16F62X
9.6
Comparator Interrupts
9.8
9.9
FIGURE 9-4:
9.7
Effects of a RESET
RS < 10K
RIC
AIN
CPIN
5 pF
VA
VT = 0.6V
ILEAKAGE
500 nA
VSS
Legend
CPIN
VT
ILEAKAGE
RIC
RS
VA
= Input Capacitance
= Threshold Voltage
= Leakage Current At The Pin Due To Various Junctions
= Interconnect Resistance
= Source Impedance
= Analog Voltage
Preliminary
DS40300B-page 61
PIC16F62X
TABLE 9-1:
Address
Name
1Fh
9Fh
Value on
All Other
Resets
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
CMCON
C2OUT
C1OUT
C2INV
C1NV
CIS
CM2
CM1
CM0
VRCON
VREN
VROE
VRR
VR3
VR2
VR1
VR0
0Bh/8Bh/
INTCON
10Bh/18Bh
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
8Ch
PIE1
EEIE
CMIE
RCIE
TXIE
85h
TRISA
TRISA4
TRISA3
TRISA7 TRISA6
TRISA2
TRISA1
TRISA0
DS40300B-page 62
Preliminary
PIC16F62X
10.0
CAPTURE/COMPARE/PWM
(CCP) MODULE
TABLE 10-1
CCP Mode
Capture
Compare
PWM
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.
Timer Resource
Timer1
Timer1
Timer2
U-0
U-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
CCP1X
CCP1Y
CCP1M3
CCP1M2
CCP1M1
CCP1M0
bit7
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit, read
as 0
-n = Value at POR reset
Preliminary
DS40300B-page 63
PIC16F62X
10.1
Capture Mode
10.1.4
In Capture mode, the RB3/CCP1 pin should be configured as an input by setting the TRISB<3> bit.
Note:
If the RB3/CCP1 is configured as an output, a write to the port can cause a capture
condition.
CCP PRESCALER
CCP1CON
NEW_CAPT_PS
MOVWF
CCP1CON
RB3/CCP1
Pin
CCPR1H
and
edge detect
CCPR1L
Capture
Enable
TMR1H
TMR1L
CCP1CON<3:0>
Qs
10.1.2
SOFTWARE INTERRUPT
DS40300B-page 64
Preliminary
PIC16F62X
10.2
10.2.1
Compare Mode
The user must configure the RB3/CCP1 pin as an output by clearing the TRISB<3> bit.
Note:
driven High
driven Low
remains Unchanged
10.2.2
10.2.3
10.2.4
TABLE 10-2
Comparator
TMR1H
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.
Q S Output
Logic
match
RB3/CCP1
R
Pin
TRISB<3>
Output Enable CCP1CON<3:0>
Mode Select
TMR1L
Value on
all other
resets
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
0Bh/8Bh/1
0Bh/18Bh
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
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
DS40300B-page 65
PIC16F62X
10.3
10.3.1
PWM Mode
The PWM period is specified by writing to the PR2 register. The PWM period can be calculated using the following formula:
PWM period = [(PR2) + 1] 4 TOSC
(TMR2 prescale value)
PWM frequency is defined as 1 / [PWM period].
When TMR2 is equal to PR2, the following three events
occur on the next increment cycle:
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:
CCP1CON<5:4>
CCPR1L
10.3.2
CCPR1H (Slave)
Comparator
Q
RB3/CCP1
(Note 1)
TMR2
Clear Timer,
CCP1 pin and
latch D.C.
PR2
TRISB<3>
Comparator
PWM PERIOD
Period
log
Fosc
Fpwm
=
Duty Cycle
)
bits
log (2)
TMR2 = PR2
TMR2 = Duty Cycle
Note:
TMR2 = PR2
For an example PWM period and duty cycle calculation, see the PICmicro Mid-Range Reference Manual
(DS33023).
DS40300B-page 66
Preliminary
PIC16F62X
10.3.3
TABLE 10-3
1.22 kHz 4.88 kHz 19.53 kHz 78.12 kHz 156.3 kHz 208.3 kHz
TABLE 10-4
16
0xFF
10
4
0xFF
10
1
0xFF
10
1
0x3F
8
1
0x1F
7
1
0x17
5.5
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
87h
TRISB
1111 1111
1111 1111
11h
TMR2
0000 0000
0000 0000
92h
PR2
1111 1111
1111 1111
12h
T2CON
-000 0000
uuuu uuuu
15h
CCPR1L
xxxx xxxx
uuuu uuuu
16h
CCPR1H
xxxx xxxx
uuuu uuuu
17h
CCP1CON
--00 0000
Legend:
CCP1X
CCP1Y
x = unknown, u = unchanged, - = unimplemented read as '0'. Shaded cells are not used by PWM and Timer2.
Preliminary
DS40300B-page 67
PIC16F62X
NOTES:
DS40300B-page 68
Preliminary
PIC16F62X
11.0
VOLTAGE REFERENCE
MODULE
11.1
FIGURE 11-1:
R/W-0
VREN
bit7
R/W-0
VROE
R/W-0
VRR
U-0
R/W-0
VR3
R/W-0
VR2
bit 7:
bit 4:
R = Readable bit
W = Writable bit
U = Unimplemented bit, read
as 0
-n = Value at POR reset
bit 5:
R/W-0
VR0
bit0
bit 6:
R/W-0
VR1
8R
8R
VRR
VR3
VREF
(From VRCON<3:0>)
Note:
Preliminary
DS40300B-page 69
PIC16F62X
EXAMPLE 11-1: VOLTAGE REFERENCE
CONFIGURATION
MOVLW
0x02
11.4
A device reset disables the Voltage Reference by clearing bit VREN (VRCON<7>). This reset also disconnects
the reference from the RA2 pin by clearing bit VROE
(VRCON<6>) and selects the high voltage range by
clearing bit VRR (VRCON<5>). The VREF value select
bits, VRCON<3:0>, are also cleared.
; 4 Inputs Muxed
MOVWF
CMCON
; to 2 comps.
BSF
STATUS,RP0
; go to Bank 1
MOVLW
0x07
; RA3-RA0 are
MOVWF
TRISA
; outputs
MOVLW
0xA6
; enable VREF
MOVWF
VRCON
; low range
BCF
STATUS,RP0
; go to Bank 0
CALL
DELAY10
; 10s delay
11.5
11.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
11.2
Effects of a Reset
VREF
R(1)
RA2
Module
VREF Output
Voltage
Reference
Output
Impedance
Note 1: R is dependent upon the Voltage Reference Configuration VRCON<3:0> and VRCON<5>.
TABLE 11-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
TRISA7 TRISA6
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
11-1 1111
11-1 1111
Note:
DS40300B-page 70
Preliminary
PIC16F62X
12.0
UNIVERSAL SYNCHRONOUS
ASYNCHRONOUS RECEIVER
TRANSMITTER (USART)
as a half duplex synchronous system that can communicate with peripheral devices such as A/D or D/A integrated circuits, Serial EEPROMs etc.
The USART can be configured in the following modes:
REGISTER 12-1: TXSTA: TRANSMIT STATUS AND CONTROL REGISTER (ADDRESS 98h)
R/W-0
CSRC
bit7
bit 7:
R/W-0
TX9
R/W-0
TXEN
R/W-0
SYNC
U-0
R/W-0
BRGH
R-1
TRMT
R/W-0
TX9D
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
-n = Value at POR reset
bit 6:
bit 5:
bit 4:
bit 3:
bit 2:
bit 1:
bit 0:
Preliminary
DS40300B-page 71
PIC16F62X
REGISTER 12-2: RCSTA: RECEIVE STATUS AND CONTROL REGISTER (ADDRESS 18h)
R/W-0
SPEN
bit7
R/W-0
RX9
R/W-0
SREN
R/W-0
CREN
R/W-0
ADEN
R-0
FERR
R-0
OERR
R-x
RX9D
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
-n = Value at POR reset
x = unknown
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
bit 2:
bit 1:
bit 0:
DS40300B-page 72
Preliminary
PIC16F62X
12.1
The BRG supports both the Asynchronous and Synchronous modes of the USART. It is a dedicated 8-bit
baud rate generator. The SPBRG register controls the
period of a free running 8-bit timer. In asynchronous
mode bit BRGH (TXSTA<2>) also controls the baud
rate. In synchronous mode bit BRGH is ignored.
Table 12-1 shows the formula for computation of the
baud rate for different USART modes which only apply
in master mode (internal clock).
25.042 = 25
Given the desired baud rate and Fosc, the nearest integer value for the SPBRG register can be calculated
using the formula in Table 12-1. From this, the error in
baud rate can be determined.
9615
(Calculated Baud Rate - Desired Baud Rate)
Desired Baud Rate
0.16%
TABLE 12-1:
SYNC
0
1
TABLE 12-2:
Value on
POR
Value on all
other resets
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
0000 -010
18h
RCSTA
SPEN
RX9
FERR
0000 -00x
99h
SPBRG
0000 0000
0000 0000
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used by the BRG.
Preliminary
DS40300B-page 73
PIC16F62X
TABLE 12-3:
BAUD
RATE
(K)
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
FOSC = 20 MHz
KBAUD
NA
NA
NA
NA
19.53
76.92
96.15
294.1
500
5000
19.53
16 MHz
SPBRG
value
%
KBAUD
ERROR (decimal)
+1.73
+0.16
+0.16
-1.96
0
-
255
64
51
16
9
0
255
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
+0.16
+0.16
-0.79
+2.56
0
-
207
51
41
12
7
0
255
4 MHz
NA
NA
NA
9.766
19.23
75.76
96.15
312.5
500
2500
9.766
7.15909 MHz
SPBRG
SPBRG
value
%
%
value
KBAUD
ERROR (decimal)
ERROR (decimal)
+1.73
+0.16
-1.36
+0.16
+4.17
0
-
255
129
32
25
7
4
0
255
3.579545 MHz
NA
NA
NA
9.622
19.24
77.82
94.20
298.3
NA
1789.8
6.991
+0.23
+0.23
+1.32
-1.88
-0.57
-
1 MHz
185
92
22
18
5
0
255
32.768 kHz
SPBRG
SPBRG
SPBRG
SPBRG
SPBRG
KBAUD
%
value KBAUD
%
value
KBAUD
%
value KBAUD
%
value KBAUD
%
value
ERROR (decimal)
ERROR (decimal)
ERROR (decimal)
ERROR (decimal)
ERROR (decimal)
NA
NA
NA
9.6
19.2
79.2
97.48
316.8
NA
1267
4.950
0
0
+3.13
+1.54
+5.60
-
TABLE 12-4:
BAUD
RATE
(K)
NA
NA
NA
NA
19.23
76.92
95.24
307.69
500
4000
15.625
10 MHz
SPBRG
value
%
KBAUD
ERROR (decimal)
131
65
15
12
3
0
255
NA
NA
NA
9.615
19.231
76.923
1000
NA
NA
100
3.906
NA
1.221
2.404
9.469
19.53
78.13
104.2
312.5
NA
312.5
1.221
103
51
12
9
0
255
NA
NA
NA
9.622
19.04
74.57
99.43
298.3
NA
894.9
3.496
+0.23
-0.83
-2.90
+3.57
-0.57
-
92
46
11
8
2
0
255
NA
1.202
2.404
9.615
19.24
83.34
NA
NA
NA
250
0.9766
+0.16
+0.16
+0.16
+0.16
+8.51
-
207
103
25
12
2
0
255
0.303
1.170
NA
NA
NA
NA
NA
NA
NA
8.192
0.032
+1.14
-2.48
-
26
6
0
255
FOSC = 20 MHz
KBAUD
+0.16
+0.16
+0.16
+4.17
-
16 MHz
SPBRG
%
value
ERROR (decimal) KBAUD
+1.73
+0.16
-1.36
+1.73
+1.73
+8.51
+4.17
-
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
10 MHz
SPBRG
%
value
ERROR (decimal) KBAUD
+0.16
+0.16
+0.16
+0.16
+8.51
-
207
103
25
12
2
0
255
4 MHz
NA
1.202
2.404
9.766
19.53
78.13
NA
NA
NA
156.3
0.6104
7.15909 MHz
SPBRG
SPBRG
%
value
%
value
ERROR (decimal) KBAUD ERROR (decimal)
+0.16
+0.16
+1.73
+1.73
+1.73
-
3.579545 MHz
129
64
15
7
1
0
255
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
-
1 MHz
92
46
11
5
0
255
32.768 kHz
BAUD
RATE
(K)
SPBRG
SPBRG
SPBRG
SPBRG
SPBRG
%
value
%
value
%
value
%
value
%
value
KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal)
0.3
1.2
2.4
9.6
19.2
76.8
96
300
500
HIGH
LOW
0.31
1.2
2.4
9.9
19.8
79.2
NA
NA
NA
79.2
0.3094
+3.13
0
0
+3.13
+3.13
+3.13
-
DS40300B-page 74
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.17
+1.67
+1.67
-
207
51
25
0
255
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
-
Preliminary
185
46
22
5
2
0
255
0.300
1.202
2.232
NA
NA
NA
NA
NA
NA
15.63
0.0610
+0.16
+0.16
-6.99
-
51
12
6
0
255
0.256
NA
NA
NA
NA
NA
NA
NA
NA
0.512
0.0020
-14.67
-
1
0
255
PIC16F62X
TABLE 12-5:
BAUD
RATE
(K)
9.6
19.2
38.4
57.6
115.2
250
625
1250
BAUD
RATE
(K)
FOSC = 20 MHz
KBAUD
9.615
19.230
37.878
56.818
113.636
250
625
1250
16 MHz
SPBRG
value
%
ERROR (decimal) KBAUD
+0.16
+0.16
-1.36
-1.36
-1.36
0
0
0
129
64
32
21
10
4
1
0
9.615
19.230
38.461
58.823
111.111
250
NA
NA
10 MHz
SPBRG
value
%
ERROR (decimal) KBAUD
+0.16
+0.16
+0.16
+2.12
-3.55
0
-
103
51
25
16
8
3
-
9.615
18.939
39.062
56.818
125
NA
625
NA
7.16 MHz
SPBRG
SPBRG
value
%
%
value
ERROR (decimal) KBAUD ERROR (decimal)
+0.16
-1.36
+1.7
-1.36
+8.51
0
-
64
32
15
10
4
0
-
9.520
19.454
37.286
55.930
111.860
NA
NA
NA
-0.83
+1.32
-2.90
-2.90
-2.90
-
46
22
11
7
3
-
4 MHz
3.579 MHz
1 MHz
32.768 kHz
SPBRG
SPBRG
SPBRG
SPBRG
SPBRG
value
value
value
value
%
%
%
%
%
value
KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal) KBAUD ERROR (decimal)
9.6
19.2
9.6
18.645
0
-2.94
32
16
NA
1.202
38.4
57.6
115.2
250
625
1250
39.6
52.8
105.6
NA
NA
NA
+3.12
-8.33
-8.33
-
7
5
2
-
2.403
9.615
19.231
NA
NA
NA
+0.17
+0.13
+0.16
+0.16
-
207
9.727
18.643
+1.32
-2.90
22
11
8.928
20.833
-6.99
+8.51
6
2
NA
NA
103
25
12
-
37.286 -2.90
55.930 -2.90
111.860 -2.90
223.721 -10.51
NA
NA
-
5
3
1
0
-
31.25
62.5
NA
NA
NA
NA
-18.61
+8.51
-
1
0
-
NA
NA
NA
NA
NA
NA
Preliminary
DS40300B-page 75
PIC16F62X
12.1.1
SAMPLING
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
bit0
Start Bit
bit1
baud clk
First falling edge after RX pin goes low
Second rising edge
x4 clk
1
Q2, Q4 clk
Samples
DS40300B-page 76
Samples
Preliminary
Samples
PIC16F62X
FIGURE 12-3: RX PIN SAMPLING SCHEME, BRGH = 1
RX pin
Start Bit
bit0
Baud CLK for all but start bit
Baud CLK
Q2, Q4 CLK
Samples
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
Preliminary
DS40300B-page 77
PIC16F62X
12.2
state of enable bit TXIE and cannot be cleared in software. It will reset only when new data is loaded into the
TXREG register. While flag bit TXIF indicated the status of the TXREG register, another bit TRMT
(TXSTA<1>) shows the status of the TSR register. Status bit TRMT is a read only bit which is set when the
TSR register is empty. No interrupt logic is tied to this
bit, so the user has to poll this bit in order to determine
if the TSR register is empty.
In this mode, the USART uses standard nonreturn-tozero (NRZ) format (one start bit, eight or nine data bits
and one stop bit). The most common data format is
8-bits. An on-chip dedicated 8-bit baud rate generator
can be used to derive standard baud rate frequencies
from the oscillator. The USART transmits and receives
the LSb first. The USARTs transmitter and receiver are
functionally independent but use the same data format
and baud rate. The baud rate generator produces a
clock either x16 or x64 of the bit shift rate, depending
on bit BRGH (TXSTA<2>). Parity is not supported by
the hardware, but can be implemented in software (and
stored as the ninth data bit). Asynchronous mode is
stopped during SLEEP.
12.2.1
TXREG register
TXIE
8
MSb
LSb
(8)
Pin Buffer
and Control
TSR register
RB2/TX/CK pin
Interrupt
TXEN
SPEN
SPBRG
Baud Rate Generator
TX9
TX9D
DS40300B-page 78
Preliminary
PIC16F62X
Steps to follow when setting up an Asynchronous
Transmission:
4.
1.
5.
2.
3.
6.
7.
BRG output
(shift clock)
RB2/TX/CK (pin)
Start Bit
Bit 0
Bit 1
Bit 7/8
Stop Bit
WORD 1
TXIF bit
(Transmit buffer
reg. empty flag)
WORD 1
Transmit Shift Reg
TRMT bit
(Transmit shift
reg. empty flag)
RB2/TX/CK (pin)
Start Bit
TXIF bit
(interrupt reg. flag)
TRMT bit
(Transmit shift
reg. empty flag)
Word 2
Word 1
BRG output
(shift clock)
Bit 0
Bit 1
WORD 1
Bit 7/8
Stop Bit
Start Bit
Bit 0
WORD 2
WORD 1
Transmit Shift Reg.
WORD 2
Transmit Shift Reg.
TABLE 12-6:
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
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
18h
RCSTA
SPEN
RX9
SREN
CREN
ADEN
FERR
OERR
RX9D
0000 -00x
0000 -00x
0000 0000
0000 0000
TMR1IE
0000 -000
0000 -000
TX9D
0000 -010
0000 -010
0000 0000
0000 0000
19h
8Ch
PIE1
EEIE
CSRC
CMIE
TX9
RCIE
TXEN
98h
TXSTA
99h
TXIE
SYNC
CCP1IE
BRGH
TMR2IE
TRMT
Legend: x = unknown, - = unimplemented locations read as '0'. Shaded cells are not used for Asynchronous Transmission.
Preliminary
DS40300B-page 79
PIC16F62X
12.2.2
FERR
OERR
CREN
SPBRG
64
or
16
RSR register
MSb
Stop (8)
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
DS40300B-page 80
Preliminary
PIC16F62X
FIGURE 12-9: ASYNCHRONOUS RECEPTION WITH ADDRESS DETECT
Start
bit
RC7/RX/DT (pin)
bit0
bit1
bit8
Stop
bit
Start
bit
bit0
bit8
Stop
bit
Read Rcv
buffer reg
RCREG
WORD 1
RCREG
RCIF
(interrupt flag)
ADEN = 1
(address match
enable)
Note: 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 bit8 = 0.
RC7/RX/DT (pin)
bit0
Rcv shift
reg
Rcv buffer reg
bit1
bit8
Read Rcv
buffer reg
RCREG
Stop
bit
Start
bit
WORD 1
RCREG
bit0
bit8
Stop
bit
RCIF
(interrupt flag)
ADEN = 1
(address match
enable)
Note: 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 bit8 = 0.
FIGURE 12-11: ASYNCHRONOUS RECEPTION WITH ADDRESS BYTE FIRST FOLLOWED BY VALID
DATA BYTE
RC7/RX/DT (pin)
Start
bit
bit0
Rcv shift
reg
Rcv buffer reg
Read Rcv
buffer reg
RCREG
bit1
bit8
Stop
bit
Start
bit
WORD 1
RCREG
bit0
bit8
Stop
bit
WORD 2
RCREG
RCIF
(interrupt flag)
ADEN
(address match
enable)
Note: 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 bit8.
Preliminary
DS40300B-page 81
PIC16F62X
Steps to follow when setting up an Asynchronous
Reception:
1.
2.
3.
4.
5.
6.
TABLE 12-7:
Flag bit RCIF will be set when reception is complete and an interrupt will be generated if enable
bit RCIE was set.
Read the RCSTA register to get the ninth bit (if
enabled) and determine if any error occurred
during reception.
Read the 8-bit received data by reading the
RCREG register.
If any error occurred, clear the error by clearing
enable bit CREN.
7.
8.
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
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
18h
RCSTA
SPEN
RX9
SREN
CREN
ADEN
FERR
OERR
RX9D
0000 -00x
0000 -00x
1Ah
0000 0000
0000 0000
8Ch
PIE1
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
TMR1IE
0000 -000
0000 -000
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
0000 -010
0000 -010
99h
SPBRG
0000 0000
0000 0000
Legend: x = unknown, - = unimplemented locations read as '0'. Shaded cells are not used for Asynchronous Reception.
DS40300B-page 82
Preliminary
PIC16F62X
12.3
USART Function
12.3.1.1
Preliminary
DS40300B-page 83
PIC16F62X
TABLE 12-1:
Addr
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
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
18h
RCSTA
SPEN
RX9
SREN
CREN
ADEN
FERR
OERR
RX9D
0000 -00x
0000 -00x
1Ah
RCREG
RX7
RX6
RX5
RX4
RX3
RX2
RX1
RX0
0000 0000
0000 0000
8Ch
PIE1
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
TMR1IE
0000 -000
0000 -000
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
0000 -010
0000 -010
99h
SPBRG
0000 0000
0000 0000
Legend: x = unknown, - = unimplemented locations read as '0'. Shaded cells are not used for Asynchronous Reception.
12.4
DS40300B-page 84
Preliminary
PIC16F62X
4.
5.
6.
2.
3.
TABLE 12-2:
7.
Value on all
other Resets
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
RX9D
0000 -00x
0000 -00x
0000 0000
0000 0000
0000 -000
18h
RCSTA
19h
TXREG
SPEN
RX9
SREN
CREN
ADEN
FERR
OERR
8Ch
PIE1
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
TMR1IE
0000 -000
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
0000 -010
0000 -010
0000 0000
0000 0000
99h
SPBRG
Legend: x = unknown, - = unimplemented, read as '0'. Shaded cells are not used for Synchronous Master Transmission.
RB1/RX/DT pin
Bit 0
Bit 1
Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3Q4 Q1Q2 Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4Q1 Q2Q3 Q4
Bit 2
Bit 7
Bit 0
WORD 1
Bit 1
WORD 2
Bit 7
RB2/TX/CK pin
Write to
TXREG reg
Write word1
Write word2
TXIF bit
(Interrupt flag)
TRMT
TRMT bit
TXEN bit
Note: Sync master mode; SPBRG = 0. Continuous transmission of two 8-bit words
bit0
bit1
bit2
bit6
bit7
RB2/TX/CK pin
Write to
TXREG reg
TXIF bit
TRMT bit
TXEN bit
Preliminary
DS40300B-page 85
PIC16F62X
12.4.2
TABLE 12-3:
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
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
RX9D
0000 -00x
0000 -00x
0000 0000
0000 0000
-000 -000
18h
RCSTA
1Ah
RCREG
SPEN
RX9
SREN
CREN
ADEN
FERR
OERR
8Ch
PIE1
EEPIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
TMR1IE
-000 0000
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
0000 -010
0000 -010
0000 0000
0000 0000
99h
SPBRG
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used for Synchronous Master Reception.
DS40300B-page 86
Preliminary
PIC16F62X
FIGURE 12-14: SYNCHRONOUS RECEPTION (MASTER MODE, SREN)
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
RCIF bit
(interrupt)
Read
RXREG
Note: Timing diagram demonstrates SYNC master mode with bit SREN = 1 and bit BRG = 0.
Preliminary
DS40300B-page 87
PIC16F62X
12.5
12.5.2
e)
2.
3.
4.
5.
6.
7.
Enable the synchronous slave serial port by setting bits SYNC and SPEN and clearing bit
CSRC.
Clear bits CREN and SREN.
If interrupts are desired, then set enable bit
TXIE.
If 9-bit transmission is desired, then set bit TX9.
Enable the transmission by setting enable bit
TXEN.
If 9-bit transmission is selected, the ninth bit
should be loaded in bit TX9D.
Start transmission by loading data to the
TXREG register.
DS40300B-page 88
2.
3.
4.
5.
6.
7.
8.
Preliminary
PIC16F62X
TABLE 12-4:
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
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
18h
RCSTA
SPEN
RX9
SREN
CREN
ADEN
FERR
OERR
RX9D
19h
TXREG
8Ch
PIE1
98h
0000 -00x
0000 0000
TMR1IE
0000 -000
0000 -000
TX9D
0000 -010
0000 -010
0000 0000
0000 0000
TXSTA
99h
0000 -00x
0000 0000
CSRC
SPBRG
CMIE
TX9
RCIE
TXEN
TXIE
SYNC
CCP1IE
BRGH
TMR2IE
TRMT
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used for Synchronous Slave Transmission.
TABLE 12-5:
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
0Ch
PIR1
EEIF
CMIF
RCIF
TXIF
CCP1IF
TMR2IF
TMR1IF
0000 -000
0000 -000
RX9D
0000 -00x
0000 -00x
0000 0000
0000 0000
0000 -000
18h
RCSTA
1Ah
RCREG
SPEN
RX9
SREN
CREN
ADEN
FERR
OERR
8Ch
PIE1
EEIE
CMIE
RCIE
TXIE
CCP1IE
TMR2IE
TMR1IE
0000 -000
98h
TXSTA
CSRC
TX9
TXEN
SYNC
BRGH
TRMT
TX9D
0000 -010
0000 -010
0000 0000
0000 0000
99h
SPBRG
Legend: x = unknown, - = unimplemented read as '0'. Shaded cells are not used for Synchronous Slave Reception.
Preliminary
DS40300B-page 89
PIC16F62X
NOTES:
DS40300B-page 90
Preliminary
PIC16F62X
13.0
EECON1
EECON2 (Not a physically implemented register)
EEDATA
EEADR
Additional information on the Data EEPROM is available in the PICmicro Mid-Range Reference Manual,
(DS33023).
bit7
R/W
EADR6
R/W
EADR5
R/W
EADR4
R/W
EADR3
R/W
EADR2
R/W
EADR1
R/W
EADR0
bit0
R = Readable bit
W = Writable bit
S = Settable bit
U = Unimplemented bit, read
as 0
-n = Value at POR reset
bit 7
bit 6:0
13.1
EEADR
Preliminary
DS40300B-page 91
PIC16F62X
13.2
R/W-x
R/W-0
R/S-0
R/S-x
WRERR
WREN
WR
RD
bit7
bit0
R = Readable bit
W = Writable bit
S = Settable bit
U = Unimplemented bit,
read as 0
-n = Value at POR reset
bit 7:4
bit 3
bit 2
bit 1
bit 0
DS40300B-page 92
Preliminary
PIC16F62X
13.3
13.4
STATUS, RP0
CONFIG_ADDR
EEADR
STATUS, RP0
EECON1, RD
STATUS, RP0
EEDATA, W
;
;
;
;
;
;
;
Bank 0
Address to read
Bank 1
EE Read
Bank 0
W = EEDATA
13.5
STATUS, RP0
EECON1, WREN
INTCON, GIE
55h
EECON2
AAh
EECON2
EECON1,WR
BSF
INTCON, GIE
;
;
;
;
;
;
;
;
;
;
Bank 1
Enable write
Disable INTs.
Write 55h
Write AAh
Set WR bit
begin write
Enable INTs.
STATUS, RP0 ;
;
;
EEDATA, W
;
STATUS, RP0 ;
EECON1, RD ;
;
STATUS, RP0 ;
Bank 0
Any code can go here
Must be in Bank 0
Bank 1 READ
YES, Read the
value written
Bank 0
BCF
;
; Is the value written (in W reg) and
; read (in EEDATA) the same?
;
SUBWF EEDATA, W
;
BTFSS STATUS, Z
; Is difference 0?
GOTO WRITE_ERR
; NO, Write error
:
; YES, Good write
:
; Continue program
13.6
WRITE VERIFY
Required
Sequence
13.7
Preliminary
DS40300B-page 93
PIC16F62X
TABLE 13-1
Address
Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
Power-on
Reset
Value on all
other resets
9Ah
EEDATA
xxxx xxxx
uuuu uuuu
9Bh
EEADR
9Ch
EECON1
xxxx xxxx
---- x000
uuuu uuuu
---- q000
9Dh
EECON2(1)
---- ----
---- ----
WRERR
WREN
WR
RD
Legend: x = unknown, u = unchanged, - = unimplemented read as 0, q = value depends upon condition. Shaded cells are not used
by data EEPROM.
Note 1: EECON2 is not a physical register
DS40300B-page 94
Preliminary
PIC16F62X
14.0
Special circuits to deal with the needs of real time applications are what sets a microcontroller apart from other
processors. The PIC16F62X family has a host of such
features intended to maximize system reliability, minimize cost through elimination of external components,
provide power saving operating modes and offer code
protection.
These are:
1.
2.
3.
4.
5.
6.
7.
8.
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
DS40300B-page 95
PIC16F62X
14.1
Configuration Bits
CP0
CP1
CP0
CPD
LVP
BODEN
MCLRE
FOSC2
PWRTE
WDTE
bit13
F0SC1
F0SC0
bit0
Register:CONFIG
Address2007h
bit 7:
bit 6:
bit 5:
bit 3:
bit 2:
DS40300B-page 96
Preliminary
PIC16F62X
14.2
Oscillator Configurations
14.2.1
TABLE 14-1:
OSCILLATOR TYPES
LP
XT
HS
ER
INTRC
EC
14.2.2
C1
XTAL
Ranges Characterized:
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
TABLE 14-2:
Mode
Freq
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
SLEEP
RF
OSC2
RS
C2
see Note
PIC16F62X
OSC1
Open
OSC2
PIC16F62X
Preliminary
DS40300B-page 97
PIC16F62X
14.2.3
14.2.4
PIC16F62X
CLKIN
74AS04
10k
XTAL
10k
20 pF
For applications where a clock is already available elsewhere, users may directly drive the PIC16F62X provided that this external clock source meets the AC/DC
timing requirements listed in Section 17.4. Figure 14-6
below shows how an external clock circuit should be
configured.
20 pF
PIC16F62X
74AS04
74AS04
To other
Devices
330 k
14.2.5
XTAL
DS40300B-page 98
ER OSCILLATOR
Figure 14-7 shows how the controlling resistor is connected to the PIC16F62X. For Rext values below 38k,
the oscillator operation may become unstable, or stop
completely. For very high Rext values (e.g. 1M), the
oscillator becomes sensitive to noise, humidity and
leakage. Thus, we recommend keeping Rext between
38k and 1M.
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT
PIC16F62X
74AS04
CLKIN
0.1 F
OSC2/RA6
RA6
330 k
OSC1/RA7
+5V
4.7k
EXTERNAL CLOCK IN
The Electrical Specification section shows the relationship between the resistance value and the operating
frequency as well as frequency variations due to operating temperature for given R and VDD values.
The ER oscillator mode has two options that control the
unused OSC2 pin. The first allows it to be used as a
general purpose I/O port. The other configures the pin
as an output providing the Fosc signal (internal clock
divided by 4) for test or external synchronization purposes.
Preliminary
PIC16F62X
14.2.6
14.4
The internal RC oscillator provides a fixed 4 MHz (nominal) system clock at Vdd = 5V and 25C, see Electrical
Specifications section for information on variation over
voltage and temperature.
14.2.7
CLKOUT
14.3
Reset
Preliminary
DS40300B-page 99
PIC16F62X
FIGURE 14-8: SIMPLIFIED BLOCK DIAGRAM OF ON-CHIP RESET CIRCUIT
External
Reset
MCLR/
VPP Pin
WDT
Module
SLEEP
WDT
Time-out
Reset
VDD rise
detect
Power-on Reset
VDD
Brown-out
detect
BODEN
OST/PWRT
OST
Chip_Reset
10-bit Ripple-counter
R
OSC1/
CLKIN
Pin
On-chip(1)
ER OSC
PWRT
10-bit Ripple-counter
Enable PWRT
Enable OST
DS40300B-page 100
Preliminary
PIC16F62X
14.5
14.5.1
14.5.3
Internal
Reset
BVDD
72 ms
VDD
Internal
Reset
BVDD
<72 ms
72 ms
VDD
Internal
Reset
BVDD
72 ms
Preliminary
DS40300B-page 101
PIC16F62X
14.5.5
TIME-OUT SEQUENCE
14.5.6
TABLE 14-3:
Oscillator Configuration
Wake-up
from SLEEP
PWRTE = 0
PWRTE = 1
XT, HS, LP
72 ms + 1024 TOSC
1024 TOSC
72 ms + 1024 TOSC
1024 TOSC
ER
72 ms
72 ms
TABLE 14-4:
POR
BOD
TO
PD
Power-on-reset
Brown-out Detect
WDT Reset
WDT Wake-up
TABLE 14-5:
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)
03h
STATUS
IRP
RP1
RPO
TO
PD
DC
0001 1xxx
000q quuu
8Eh
PCON
OSCF
POR
BOD
---- 1-0x
---- u-uq
Address
Note 1:
Other (non power-up) resets include MCLR reset, Brown-out Detect and Watchdog Timer Reset during normal operation.
DS40300B-page 102
Preliminary
PIC16F62X
TABLE 14-6:
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
---- --uu
000h
000x xuuu
---- 1-u0
PC + 1(1)
uuu1 0uuu
---- --uu
Condition
WDT Wake-up
Brown-out Detect
Interrupt Wake-up from SLEEP
Preliminary
DS40300B-page 103
PIC16F62X
TABLE 14-7:
Register
Address
Power-on Reset
Wake up from
SLEEP through
interrupt
Wake up from
SLEEP through
WDT time-out
xxxx xxxx
uuuu uuuu
uuuu uuuu
INDF
00h
TMR0
01h
xxxx xxxx
uuuu uuuu
uuuu uuuu
PCL
02h
0000 0000
0000 0000
PC + 1(3)
STATUS
03h
0001 1xxx
000q quuu(4)
uuuq quuu(4)
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
T2CON
12h
-000 0000
-000 0000
CCP1CON
17h
--00 0000
--00 0000
RCSTA
18h
0000 -00x
0000 -00x
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
1-uq(1,6)
PCON
8Eh
---- 1-0x
TXSTA
98h
0000 -010
0000 -010
EECON1
9Ch
---- x000
---- q000
VRCON
9Fh
000- 0000
000- 0000
----
---- --uu
uuu- uuuu
Legend:
Note 1:
2:
3:
4:
5:
DS40300B-page 104
Preliminary
PIC16F62X
FIGURE 14-10: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 1
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
TOST
OST TIME-OUT
INTERNAL RESET
FIGURE 14-11: TIME-OUT SEQUENCE ON POWER-UP (MCLR NOT TIED TO VDD): CASE 2
VDD
MCLR
INTERNAL POR
TPWRT
PWRT TIME-OUT
TOST
OST TIME-OUT
INTERNAL RESET
TOST
OST TIME-OUT
INTERNAL RESET
Preliminary
DS40300B-page 105
PIC16F62X
FIGURE 14-13: EXTERNAL POWER-ON
RESET CIRCUIT (FOR SLOW
VDD POWER-UP)
VDD
33k
VDD
VDD
10k
MCLR
R
40k
R1
PIC16F62X
MCLR
C
PIC16F62X
VDD
R1
Q1
R2
40k
MCLR
PIC16F62X
DS40300B-page 106
Preliminary
PIC16F62X
14.6
Interrupts
2:
TMR1IF
TMR1IE
TMR2IF
TMR2IE
CCP1IF
CCP1IE
CMIF
CMIE
TXIF
TXIE
RCIF
RCIE
EEIF
EEIE
T0IF
T0IE
INTF
INTE
Interrupt to CPU
RBIF
RBIE
PEIE
GIE
Preliminary
DS40300B-page 107
PIC16F62X
14.6.1
RB0/INT INTERRUPT
14.6.3
PORTB INTERRUPT
14.6.4
TMR0 INTERRUPT
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
CLKOUT 3
INT pin
INTF flag
(INTCON<1>)
Interrupt Latency 2
GIE bit
(INTCON<7>)
INSTRUCTION FLOW
PC
Instruction
fetched
Inst (PC)
Instruction
executed
Inst (PC-1)
0004h
PC+1
PC+1
PC
Inst (0004h)
Inst (0005h)
Dummy Cycle
Inst (0004h)
Inst (PC+1)
Dummy Cycle
Inst (PC)
0005h
TABLE 14-8:
Address
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)
0Bh
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
Note 1:
Other (non power-up) resets include MCLR reset, Brown-out Reset and Watchdog Timer Reset during normal operation.
DS40300B-page 108
Preliminary
PIC16F62X
14.7
14.8
MOVWF
W_TEMP
SWAPF
STATUS,W
BCF
STATUS,RP0
MOVWF
STATUS_TEMP
WDT PERIOD
:
:
The watchdog timer is a free running on-chip RC oscillator which does not require any external components.
This RC oscillator is separate from the ER oscillator of
the CLKIN pin. That means that the WDT will run, even
if the clock on the OSC1 and OSC2 pins of the device
has been stopped, for example, by execution of a
SLEEP instruction. During normal operation, a WDT
time-out generates a device RESET. If the device is in
SLEEP mode, a WDT time-out causes the device to
wake-up and continue with normal operation. The WDT
can be permanently disabled by programming the configuration bit WDTE as clear (Section 14.1).
14.8.1
14.8.2
(ISR)
:
SWAPF
STATUS_TEMP,W
MOVWF
STATUS
SWAPF
W_TEMP,F
W_TEMP,W
;swap W_TEMP
SWAPF
Preliminary
DS40300B-page 109
PIC16F62X
FIGURE 14-18: WATCHDOG TIMER BLOCK DIAGRAM
From TMR0 Clock Source
(Figure 6-6)
0
Watchdog
Timer
M
U
X
Postscaler
8
8 - to -1 MUX
PS<2:0>
PSA
WDT
Enable Bit
0
MUX
PSA
WDT
Time-out
Note: T0SE, T0CS, PSA, PS0-PS2 are bits in the OPTION register.
TABLE 14-9:
Address
Name
2007h
Config. bits
81h
OPTION
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on
POR
Reset
LVP
BOREN
MCLRE
FOSC2
PWRTE
WDTE
FOSC1
FOSC0
uuuu uuuu
uuuu uuuu
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
1111 1111
1111 1111
Bit 7
Value on
all other
Resets
DS40300B-page 110
Preliminary
PIC16F62X
14.9
The first event will cause a device reset. The two latter
events are considered a continuation of program execution. The TO and PD bits in the STATUS register can
be used to determine the cause of device reset. PD
bit, which is set on power-up is cleared when SLEEP is
invoked. TO bit is cleared if WDT Wake-up occurred.
When the SLEEP instruction is being executed, the
next instruction (PC + 1) is pre-fetched. For the device
to wake-up through an interrupt event, the corresponding interrupt enable bit must be set (enabled). Wake-up
is regardless of the state of the GIE bit. If the GIE bit is
clear (disabled), the device continues execution at the
instruction after the SLEEP instruction. If the GIE bit is
set (enabled), the device executes the instruction after
the SLEEP instruction and then branches to the interrupt address (0004h). In cases where the execution of
the instruction following SLEEP is not desirable, the
user should have an NOP after the SLEEP instruction.
Note:
14.9.1
Q1 Q2 Q3 Q4
Q1
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1 Q2 Q3
PC + 2
0004h
0005h
Inst(0004h)
Inst(0005h)
Dummy cycle
Q4
Inst(0004h)
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
PC
Instruction
fetched
Inst(PC) = SLEEP
Instruction
executed
Inst(PC - 1)
Note 1:
2:
3:
4:
PC+1
PC+2
PC+2
Inst(PC + 1)
Inst(PC + 2)
SLEEP
Inst(PC + 1)
Dummy cycle
Preliminary
DS40300B-page 111
PIC16F62X
14.10
Code Protection
External
Connector
Signals
To Normal
Connections
PIC16F62X
+5V
14.11
VSS
VPP
RA5/MCLR/THV
CLK
RB6
Data I/O
14.12
VDD
0V
ID Locations
RB7
VDD
To Normal
Connections
14.13
DS40300B-page 112
Preliminary
PIC16F62X
15.0
TABLE 15-1:
OPCODE FIELD
DESCRIPTIONS
Field
Description
0xhh
d = 0 for destination W
d = 1 for destination f
f = 7-bit file register address
Top of Stack
Program Counter
GIE
WDT
Watchdog Timer/Counter
TO
Time-out bit
PD
Power-down bit
( )
<>
General
Options
Contents
13
OPCODE
Assigned to
0
k (literal)
13
11
OPCODE
10
0
k (literal)
Preliminary
DS40300B-page 113
PIC16F62X
TABLE 15-2:
Mnemonic,
Operands
Description
Cycles
14-Bit Opcode
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
f, b
f, b
f, b
f, b
Bit Clear f
Bit Set f
Bit Test f, Skip if Clear
Bit Test f, Skip if Set
1,2
1,2
3
3
k
k
k
k
k
k
k
k
k
C,DC,Z
Z
TO,PD
Z
TO,PD
C,DC,Z
Z
Note 1: 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.
2: 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.
3: If Program Counter (PC) is modified or a conditional test is true, the instruction requires two cycles. The second cycle is
executed as a NOP.
DS40300B-page 114
Preliminary
PIC16F62X
15.1
Instruction Descriptions
ANDLW
Syntax:
[ label ] ANDLW
ADDLW
Syntax:
[ label ] ADDLW
Operands:
0 k 255
Operands:
0 k 255
Operation:
(W) + k (W)
Operation:
Status Affected:
C, DC, Z
Status Affected:
Encoding:
11
111x
kkkk
kkkk
Encoding:
11
1001
kkkk
kkkk
Description:
Description:
Words:
Words:
Cycles:
Cycles:
Example
ADDLW
Example
0x15
=
0x10
ADDWF
0xA3
After Instruction
After Instruction
W
0x5F
Before Instruction
Before Instruction
W
ANDLW
0x25
Add W and f
ANDWF
0x03
AND W with f
Syntax:
[ label ] ADDWF
Syntax:
[ label ] ANDWF
Operands:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
Operation:
Status Affected:
C, DC, Z
Status Affected:
Encoding:
00
f,d
0111
dfff
ffff
Encoding:
00
f,d
0101
dfff
ffff
Description:
Description:
Words:
Words:
Cycles:
Cycles:
Example
ADDWF
FSR, 0
Example
Before Instruction
W =
FSR =
FSR, 1
Before Instruction
0x17
0xC2
W =
FSR =
After Instruction
W =
FSR =
ANDWF
0x17
0xC2
After Instruction
0xD9
0xC2
W =
FSR =
Preliminary
0x17
0x02
DS40300B-page 115
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
Encoding:
01
f,b
00bb
bfff
ffff
Description:
Words:
Cycles:
Encoding:
Example
BCF
01
10bb
bfff
ffff
Description:
Words:
Cycles:
1(2)
FLAG_REG, 7
Before Instruction
FLAG_REG = 0xC7
After Instruction
FLAG_REG = 0x47
Example
HERE
FALSE
TRUE
BTFSC
GOTO
FLAG,1
PROCESS_CODE
Before Instruction
PC =
address HERE
After Instruction
if FLAG<1> = 0,
PC =
address TRUE
if FLAG<1>=1,
PC =
address FALSE
BSF
Bit Set f
Syntax:
[ label ] BSF
Operands:
0 f 127
0b7
Operation:
1 (f<b>)
Status Affected:
f,b
None
Encoding:
Description:
01
01bb
bfff
ffff
Words:
Cycles:
Example
BSF
FLAG_REG,
Before Instruction
FLAG_REG = 0x0A
After Instruction
FLAG_REG = 0x8A
DS40300B-page 116
Preliminary
PIC16F62X
BTFSS
CLRF
Clear f
Syntax:
Syntax:
[ label ] CLRF
Operands:
0 f 127
0b<7
Operands:
0 f 127
Operation:
Operation:
skip if (f<b>) = 1
00h (f)
1Z
Status Affected:
None
Status Affected:
Encoding:
Description:
01
11bb
bfff
ffff
Words:
Cycles:
Encoding:
HERE
FALSE
TRUE
0001
1fff
ffff
Description:
Words:
Cycles:
Example
1(2)
Example
00
CLRF
FLAG_REG
Before Instruction
FLAG_REG
BTFSS
GOTO
0x5A
=
=
0x00
1
After Instruction
FLAG,1
PROCESS_CODE
FLAG_REG
Z
Before Instruction
PC =
address HERE
After Instruction
if FLAG<1> = 0,
PC =
address FALSE
if FLAG<1> = 1,
PC =
address TRUE
CALL
Call Subroutine
CLRW
Clear W
Syntax:
[ label ] CALL k
Syntax:
[ label ] CLRW
Operands:
0 k 2047
Operands:
None
Operation:
(PC)+ 1 TOS,
k PC<10:0>,
(PCLATH<4:3>) PC<12:11>
Operation:
00h (W)
1Z
Status Affected:
Status Affected:
None
Encoding:
Encoding:
Description:
10
0kkk
kkkk
kkkk
Words:
0000
0011
Words:
Cycles:
Example
Example
0001
Description:
Cycles:
00
CLRW
Before Instruction
W
HERE
CALL
0x5A
After Instruction
THERE
W
Z
Before Instruction
=
=
0x00
1
PC = Address HERE
After Instruction
PC = Address THERE
TOS = Address HERE+1
Preliminary
DS40300B-page 117
PIC16F62X
CLRWDT
DECF
Decrement f
Syntax:
[ label ] CLRWDT
Syntax:
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:
Encoding:
Description:
Encoding:
TO, PD
00
0000
0110
0100
Words:
Cycles:
0011
dfff
ffff
Words:
Cycles:
Example
00
Description:
Example
DECF
CNT, 1
Before Instruction
CLRWDT
CNT
Z
Before Instruction
WDT counter =
COMF
[ label ] COMF
Operands:
=
=
CNT
Z
0x00
0
1
1
Complement f
Syntax:
0x01
0
0x00
1
After Instruction
After Instruction
WDT counter =
WDT prescaler=
TO
=
PD
=
=
=
DECFSZ
Decrement f, Skip if 0
Syntax:
0 f 127
d [0,1]
Operands:
0 f 127
d [0,1]
Operation:
(f) (dest)
Operation:
(f) - 1 (dest);
Status Affected:
Status Affected:
None
Encoding:
Description:
00
1001
f,d
dfff
ffff
Words:
Description:
Cycles:
Encoding:
Example
COMF
REG1,0
=
0x13
REG1
W
=
=
dfff
ffff
Cycles:
1(2)
0x13
0xEC
After Instruction
1011
Words:
Before Instruction
REG1
00
skip if result = 0
Example
HERE
DECFSZ
GOTO
CONTINUE
CNT, 1
LOOP
Before Instruction
PC
address HERE
After Instruction
CNT
if CNT
PC
if CNT
PC
DS40300B-page 118
Preliminary
=
=
=
CNT - 1
0,
address CONTINUE
0,
address HERE+1
PIC16F62X
GOTO
Unconditional Branch
INCFSZ
Increment f, Skip if 0
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 k 2047
Operands:
Operation:
k PC<10:0>
PCLATH<4:3> PC<12:11>
0 f 127
d [0,1]
Operation:
None
Status Affected:
None
Status Affected:
Encoding:
Description:
GOTO k
10
1kkk
kkkk
kkkk
dfff
ffff
Cycles:
Example
1111
Description:
1(2)
Cycles:
00
Words:
Words:
Encoding:
INCFSZ f,d
GOTO THERE
After Instruction
PC =
Address THERE
Example
HERE
INCFSZ
GOTO
CONTINUE
CNT,
LOOP
Before Instruction
PC
address HERE
After Instruction
CNT =
if CNT=
PC
=
if CNT
PC
=
CNT + 1
0,
address CONTINUE
0,
address HERE +1
INCF
Increment f
IORLW
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 k 255
(f) + 1 (dest)
Operation:
Operation:
Status Affected:
Status Affected:
Encoding:
Description:
INCF f,d
Encoding:
00
1010
dfff
ffff
Description:
kkkk
Cycles:
Example
IORLW
0x35
Before Instruction
CNT, 1
Before Instruction
CNT
Z
kkkk
Words:
INCF
1000
Words:
Cycles:
Example
11
IORLW k
0x9A
After Instruction
=
=
0xFF
0
=
=
0x00
1
W
Z
=
=
0xBF
1
After Instruction
CNT
Z
Preliminary
DS40300B-page 119
PIC16F62X
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:
Status Affected:
Encoding:
00
IORWF
f,d
0100
dfff
ffff
Description:
Words:
Cycles:
Encoding:
Example
IORWF
RESULT, 0
00
dfff
ffff
Cycles:
0x13
0x91
1000
Words:
Before Instruction
RESULT =
W
=
Description:
MOVF f,d
Example
After Instruction
MOVF
FSR, 0
After Instruction
RESULT =
W
=
Z
=
0x13
0x93
1
MOVLW
Move Literal to W
MOVWF
Move W to f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 k 255
Operands:
0 f 127
Operation:
k (W)
Operation:
(W) (f)
Status Affected:
None
Status Affected:
None
Encoding:
11
MOVLW k
00xx
kkkk
kkkk
Description:
Words:
Cycles:
Example
Encoding:
00
MOVWF
0000
1fff
ffff
Description:
Words:
Cycles:
Example
MOVLW
0x5A
=
OPTION
Before Instruction
After Instruction
W
MOVWF
OPTION =
W
=
0x5A
0xFF
0x4F
After Instruction
OPTION =
W
=
DS40300B-page 120
Preliminary
0x4F
0x4F
PIC16F62X
NOP
No Operation
RETFIE
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
None
Operands:
None
Operation:
No operation
Operation:
Status Affected:
None
TOS PC,
1 GIE
Status Affected:
None
Encoding:
00
NOP
0000
Description:
Encoding:
Cycles:
0000
No operation.
Words:
0xx0
RETFIE
00
0000
0000
1001
Words:
Cycles:
Example
Description:
NOP
Example
RETFIE
After Interrupt
PC =
GIE =
TOS
1
OPTION
RETLW
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
None
Operands:
0 k 255
Operation:
(W) OPTION
Operation:
k (W);
TOS PC
Status Affected:
None
OPTION
00
0000
0110
0010
Encoding:
RETLW k
11
01xx
kkkk
kkkk
Description:
Words:
Words:
Cycles:
Cycles:
Example
CALL TABLE
Example
To maintain upward compatibility
with future PICmicro products, do
not use this instruction.
value
TABLE
ADDWF
RETLW
RETLW
RETLW
;W contains table
;offset value
;W now has table
PC
k1
k2
;W = offset
;Begin table
;
kn
; End of table
Before Instruction
W
0x07
After Instruction
W
Preliminary
value of k8
DS40300B-page 121
PIC16F62X
RETURN
Syntax:
[ label ]
Operands:
None
Operation:
TOS PC
Status Affected:
RRF
None
Encoding:
Description:
Syntax:
0000
1000
Status Affected:
Encoding:
Description:
Cycles:
0 f 127
d [0,1]
Operation:
0000
[ label ]
Operands:
RETURN
00
Words:
00
1100
dfff
ffff
Example
RRF f,d
Register f
RETURN
After Interrupt
Words:
PC =
Cycles:
TOS
Example
RRF
REG1,0
Before Instruction
REG1
C
=
=
1110 0110
0
=
=
=
1110 0110
0111 0011
0
After Instruction
REG1
W
C
RLF
SLEEP
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
None
Operation:
00h WDT,
0 WDT prescaler,
1 TO,
0 PD
Status Affected:
TO, PD
RLF
f,d
Operation:
Status Affected:
Encoding:
Description:
00
1101
dfff
ffff
Words:
RLF
0110
0011
Words:
Cycles:
REG1,0
Before Instruction
REG1
C
0000
Example:
SLEEP
Register f
Example
00
Description:
Cycles:
Encoding:
SLEEP
=
=
1110 0110
0
=
=
=
1110 0110
1100 1100
1
After Instruction
REG1
W
C
DS40300B-page 122
Preliminary
PIC16F62X
SUBLW
SUBWF
Subtract W from f
Syntax:
[ label ]
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
Status
Affected:
C, DC, Z
Encoding:
00
SUBLW k
Operands:
0 k 255
Operation:
k - (W) (W)
Status
Affected:
C, DC, Z
Encoding:
Description:
11
110x
kkkk
kkkk
The W register is subtracted (2s complement method) from the eight bit literal
'k'. The result is placed in the W register.
Words:
SUBLW
W
C
1
1
=
=
Example 1:
SUBWF
1
?
W
C
=
=
REG1
W
C
1
1; result is positive
=
=
REG1
W
C
2
?
After Instruction
W
C
=
=
Example 2:
0
1; result is zero
=
=
=
=
=
1
2
1; result is positive
=
=
=
2
2
?
After Instruction
3
?
REG1
W
C
After Instruction
W =
C
=
tive
3
2
?
Before Instruction
REG1
W
C
Before Instruction
W
C
=
=
=
After Instruction
Before Instruction
W
C
REG1,1
Before Instruction
After Instruction
Example 3:
ffff
Cycles:
0x02
Before Instruction
Example 2:
dfff
Words:
Example 1:
0010
Description:
Cycles:
SUBWF f,d
0xFF
0; result is nega-
Example 3:
=
=
=
0
2
1; result is zero
Before Instruction
REG1
W
C
=
=
=
1
2
?
After Instruction
REG1
W
C
Preliminary
=
=
=
0xFF
2
0; result is negative
DS40300B-page 123
PIC16F62X
SWAPF
Swap Nibbles in f
XORLW
Syntax:
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operands:
0 k 255
Operation:
(f<3:0>) (dest<7:4>),
(f<7:4>) (dest<3:0>)
Operation:
Status Affected:
None
Encoding:
Status Affected:
Encoding:
Description:
00
1110
dfff
ffff
XORLW k
11
1010
kkkk
kkkk
Description:
Words:
Words:
Cycles:
Cycles:
Example:
XORLW
Example
SWAPF REG,
0xAF
Before Instruction
Before Instruction
REG1
W
=
=
0xB5
After Instruction
0xA5
After Instruction
REG1
W
0x1A
0xA5
0x5A
TRIS
XORWF
Exclusive OR W with f
Syntax:
[ label ] XORWF
Operands:
0 f 127
d [0,1]
Operation:
Status Affected:
Syntax:
[ label ] TRIS
Operands:
5f7
Operation:
00
0000
0110
0fff
Encoding:
00
0110
f,d
dfff
ffff
Words:
1
1
Example
XORWF
Cycles:
Cycles:
Words:
Description:
Example
To maintain upward compatibility
with future PICmicro products, do
not use this instruction.
REG
Before Instruction
REG
W
=
=
0xAF
0xB5
=
=
0x1A
0xB5
After Instruction
REG
W
DS40300B-page 124
Preliminary
PIC16F62X
16.0
DEVELOPMENT SUPPORT
PICmicro
The
microcontrollers are supported with a
full range of hardware and software development tools:
Integrated Development Environment
- MPLAB IDE Software
Assemblers/Compilers/Linkers
- MPASM Assembler
- MPLAB-C17 and MPLAB-C18 C Compilers
- MPLINK/MPLIB Linker/Librarian
Simulators
- MPLAB-SIM Software Simulator
Emulators
- MPLAB-ICE Real-Time In-Circuit Emulator
- PICMASTER/PICMASTER-CE In-Circuit
Emulator
- ICEPIC
In-Circuit Debugger
- MPLAB-ICD for PIC16F877
Device Programmers
- PRO MATE II Universal Programmer
- PICSTART Plus Entry-Level Prototype
Programmer
Low-Cost Demonstration Boards
- SIMICE
- PICDEM-1
- PICDEM-2
- PICDEM-3
- PICDEM-17
- SEEVAL
- KEELOQ
16.1
16.2
MPASM Assembler
16.3
Preliminary
DS40300B-page 125
PIC16F62X
16.4
MPLINK/MPLIB Linker/Librarian
16.5
16.6
DS40300B-page 126
16.7
PICMASTER/PICMASTER CE
16.8
ICEPIC
16.9
Microchips In-Circuit Debugger, MPLAB-ICD, is a powerful, low-cost run-time development tool. This tool is
based on the flash PIC16F877 and can be used to
develop for this and other PICmicro microcontrollers
from the PIC16CXXX family. MPLAB-ICD utilizes the
In-Circuit Debugging capability built into the
PIC16F87X. This feature, along with Microchips In-Circuit Serial Programming protocol, offers cost-effective
in-circuit flash programming and debugging from the
graphical user interface of the MPLAB Integrated
Development Environment. This enables a designer to
develop and debug source code by watching variables,
single-stepping and setting break points. Running at
full speed enables testing hardware in real-time. The
MPLAB-ICD is also a programmer for the flash
PIC16F87X family.
Preliminary
PIC16F62X
16.10
The PRO MATE II Universal Programmer is a full-featured programmer capable of operating in stand-alone
mode as well as PC-hosted mode. PRO MATE II is CE
compliant.
The PRO MATE II has programmable VDD and VPP
supplies which allows it to verify programmed memory
at VDD min and VDD max for maximum reliability. It has
an LCD display for instructions and error messages,
keys to enter commands and a modular detachable
socket assembly to support various package types. In
stand-alone mode the PRO MATE II can read, verify or
program PICmicro devices. It can also set code-protect
bits in this mode.
16.11
The PICSTART programmer is an easy-to-use, lowcost prototype programmer. It connects to the PC via
one of the COM (RS-232) ports. MPLAB Integrated
Development Environment software makes using the
programmer simple and efficient.
PICSTART Plus supports all PICmicro devices with up
to 40 pins. Larger pin count devices such as the
PIC16C92X, and PIC17C76X may be supported with
an adapter socket. PICSTART Plus is CE compliant.
16.12
SIMICE Entry-Level
Hardware Simulator
16.13
16.14
16.15
Preliminary
DS40300B-page 127
PIC16F62X
16.16
PICDEM-17
The PICDEM-17 is an evaluation board that demonstrates the capabilities of several Microchip microcontrollers,
including
PIC17C752,
PIC17C756,
PIC17C762, and PIC17C766. All necessary hardware
is included to run basic demo programs, which are supplied on a 3.5-inch disk. A programmed sample is
included, and the user may erase it and program it with
the other sample programs using the PRO MATE II or
PICSTART Plus device programmers and easily debug
and test the sample code. In addition, PICDEM-17 supports down-loading of programs to and executing out of
external FLASH memory on board. The PICDEM-17 is
also usable with the MPLAB-ICE or PICMASTER emulator, and all of the sample programs can be run and
modified using either emulator. Additionally, a generous prototype area is available for user hardware.
16.17
16.18
DS40300B-page 128
Preliminary
Software Tools
Emulators
Programmers Debugger
PRO MATE II
Universal Programmer
Preliminary
24CXX/
25CXX/
93CXX
* Contact the Microchip Technology Inc. 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.
Development tool is available on select devices.
MCRFXXX
PICDEM-17
PICDEM-14A
PICDEM-3
PICDEM-2
**
PICDEM-1
**
HCSXXX
SIMICE
PIC16C6X
PIC16CXXX
ICEPIC Low-Cost
In-Circuit Emulator
**
PIC16F62X
PICMASTER/PICMASTER-CE
PIC16C7X
MPLAB-ICE
PIC16C7XX
MPASM/MPLINK
PIC16C8X
PIC16F8XX
PIC12CXXX
PIC16C9XX
PIC14000
PIC17C4X
PIC16C5X
PIC17C7XX
PICSTARTPlus
Low-Cost Universal Dev. Kit
PIC18CXX2
TABLE 16-1:
MPLAB Integrated
Development Environment
PIC16F62X
MCP2510
DS40300B-page 129
PIC16F62X
NOTES:
DS40300B-page 130
Preliminary
PIC16F62X
17.0
ELECTRICAL SPECIFICATIONS
Voltage spikes below VSS at the MCLR pin, inducing currents greater than 80 mA, may cause latch-up.
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
DS40300B-page 131
PIC16F62X
FIGURE 17-1: PIC16F62X VOLTAGE-FREQUENCY GRAPH, 0C TA +70C
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: PIC16F62X VOLTAGE-FREQUENCY GRAPH, -40C TA < 0C, +70C < TA 85C
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.
DS40300B-page 132
Preliminary
PIC16F62X
FIGURE 17-3: PIC16LF62X VOLTAGE-FREQUENCY GRAPH, 0C TA +70C
6.0
5.5
5.0
4.5
VDD
(Volts)
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: PIC16LF62X VOLTAGE-FREQUENCY GRAPH, -40C TA < 0C, +70C < TA 85C
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.
Preliminary
DS40300B-page 133
PIC16F62X
17.1
DC CHARACTERISTICS:
Param
No.
Conditions
D001
VDD
Supply Voltage
3.0
5.5
D002
VDR
1.5*
D003
VPOR
Vss
D004
SVDD
0.05*
V/ms
D005
VBOD
3.7
3.7
4.0
4.0
4.3
4.4
D010
IDD
0.7
mA
4.0
7.0
6.0
2.0
mA
mA
mA
D013
IPD
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
IWDT
D020
6.0
75
30
20
25
125
50
A
A
A
A
VDD=4.0V
(125C)
BOD enabled, VDD = 5.0V
VDD = 4.0V
135
VDD = 4.0V
200
4
4
20
KHz
MHz
MHz
MHz
IBOD
Brown-out Detect Current (Note 4)
ICOMP Comparator Current for each
Comparator (Note 4)
IVREF VREF Current (Note 4)
D023
1A
FOSC
Note 1:
2:
3:
4:
5:
0
0
All temperatures
All temperatures
All temperatures
All temperatures
DS40300B-page 134
Preliminary
PIC16F62X
17.2
DC CHARACTERISTICS:
Param
No.
D001
VDD
Supply Voltage
2.0
5.5
D002
VDR
1.5*
D003
VPOR
VSS
D004
SVDD
0.05*
V/ms
D005
VBOD
3.7
4.0
4.3
D010
IDD
0.6
mA
4.0
7.0
6.0
2.0
mA
mA
mA
2.0
2.2
5.0
9.0
15.0
A
A
A
A
A
VDD = 2.5
VDD = 3.0
VDD = 4.5
VDD = 5.5
VDD = 5.5 Extended
6.0
75
15
125
A
A
VDD=3.0V
BOD enabled, VDD = 5.0V
30
50
135
A
A
VDD = 3.0V
VDD = 3.0V
0
0
200
4
4
20
KHz
MHz
MHz
MHz
D013
D020
IPD
D023
IWDT
IBOD
ICOMP
IVREF
1A
FOSC
Note 1:
2:
3:
4:
5:
All temperatures
All temperatures
All temperatures
All temperatures
Preliminary
DS40300B-page 135
PIC16F62X
17.3 DC CHARACTERISTICS: PIC16F62X (Commercial, Industrial, Extended)
PIC16LF62X (Commercial, Industrial, Extended)
Standard Operating Conditions (unless otherwise stated)
Operating temperature
40C TA +85C for industrial and
0C TA +70C for commercial and
40C TA +125C for extended
Operating voltage VDD range as described in DC spec Table 17.1 and Table 12-2
Param.
No.
Sym
VIL
D030
D031
D032
D033
VIH
D040
D041
D042
D043
D043A
D070
D060
D061
D063
Characteristic
Input Low Voltage
I/O ports
with TTL buffer
with Schmitt Trigger input
MCLR, RA4/T0CKI,OSC1 (in ER
mode)
OSC1 (in XT and HS)
OSC1 (in LP)
Input High Voltage
I/O ports
with TTL buffer
D080
D083
VOL
D090
D092
VOH
*D150
VOD
D100
D101
*
Note 1:
2:
3:
Min
Typ
Max
Unit
VSS
V SS
Vss
0.8V
0.15VDD
0.2VDD
0.2VDD
Vss
Vss
0.3VDD
0.6VDD-1.0
V
V
V
V
Conditions
2.0V
.25VDD + 0.8V
0.8V DD
0.8VDD
0.7VDD
0.9VDD
50
VDD
VDD
VDD
VDD
VDD
200
400
Note1
A VDD = 5.0V, VPIN = VSS
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
8.5*
V
V
V
V
V
15
V
V
-40 to +85C
+125C
-40 to +85C
+125C
DS40300B-page 136
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
D300
VIOFF
5.0
10
mV
D301
VICM
VDD - 1.5
D302
Comments
300
300A
Response Time
301
(1)*
55
db
TRESP
150
400
600
ns
ns
TMC2OV
10
16F62X
16LF62X
TABLE 17-2:
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
TSET
10
Comments
310
Settling Time
(1)*
Preliminary
DS40300B-page 137
PIC16F62X
17.4
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
Time
osc
t0
OSC1
T0CKI
P
R
V
Z
Period
Rise
Valid
Hi-Impedance
Load condition 1
VDD/2
RL
CL
Pin
CL
Pin
VSS
VSS
RL = 464
CL = 50 pF
15 pF
TABLE 17-3:
DC Characteristics
Parameter
Sym
No.
Characteristic
Data EEPROM Memory
Endurance
VDD for read/write
D120
D121
Ed
Vdrw
D122
Tdew
D130
D131
Ep
Vpr
D132
D133
Vpew
Tpew
Min
Typ
Max
1M*
VMIN
10M
5.5
8*
1000*
Vmin
10000
5.5
4.5
5.5
8*
Units
Conditions
E/W 25C at 5V
V VMIN = Minimum operating
voltage
ms
E/W
V VMIN = Minimum operating
voltage
V
ms
DS40300B-page 138
Preliminary
PIC16F62X
17.5
Q1
Q3
Q2
Q4
Q1
OSC1
1
2
CLKOUT
TABLE 17-4:
Parameter
No.
Sym
Fosc
Characteristic
Min
Typ
Max
Units
Conditions
DC
MHz
20
200
MHz
kHz
4
37
4
4
20
200
MHz
MHz
MHz
kHz
MHz
kHz
ns
ns
s
ns
10,000 ns
1,000 ns
s
ns
s
DC
ns
ns
0.1
1
2
3
4
5
Tcy
TosL,
TosH
INTRC
ER
250
50
5
Oscillator Period
(Note 1)
Tosc
DC
DC
Oscillator Frequency
(Note 1)
250
250
50
5
1.0
100 *
3.65
10kHz
250
27
TCY
4.00
Preliminary
4.28
8MHz
MHz
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
VDD = 5.0V
VDD = 5.0V
DS40300B-page 139
PIC16F62X
FIGURE 17-7: CLKOUT AND I/O TIMING
Q1
Q4
Q2
Q3
OSC1
11
10
22
CLKOUT
23
13
12
19
18
14
16
I/O Pin
(input)
15
17
I/O Pin
(output)
new value
old value
20, 21
TABLE 17-5:
Parameter
No.
10
Characteristic
TosH2ckL
OSC1 to CLKOUT
TosH2ckH
16F62X
OSC1 to CLKOUT
10A
11
Max
Units
75
200
ns
400
ns
35
100
ns
200
ns
35
100
ns
16LF62X
13A
ns
16F62X
ns
200
16LF62X
TckF
400
75
16F62X
16LF62X
TckR
16F62X
12A
13
Typ
16LF62X
11A
12
Min
200
ns
14
TckL2ioV
20
ns
15
TioV2ckH
16F62X
Tosc
+200
ns
ns
CLKOUT
16LF62X
Tosc
=400
ns
ns
ns
16F62X
50
150 *
ns
16LF62X
300
ns
100
200
ns
16
TckH2ioI
17
TosH2ioV
18
TosH2ioI
DS40300B-page 140
Preliminary
PIC16F62X
FIGURE 17-8: RESET, WATCHDOG TIMER, OSCILLATOR START-UP TIMER AND POWER-UP
TIMER TIMING
VDD
MCLR
30
Internal
POR
33
PWRT
Timeout
32
OSC
Timeout
Internal
RESET
Watchdog
Timer
RESET
31
34
34
I/O Pins
BVDD
VDD
35
TABLE 17-6:
Parameter
No.
Sym
30
TmcL
31
Twdt
Min
Typ
Max
Unit
s
2000
TBD
TBD
TBD
ns
ms
7
TBD
18
TBD
33
TBD
ms
ms
Characteristic
34
TIOZ
35
TBOD
1024TOSC
72
TBD
132
TBD
ms
ms
2.0
100
Tost
Tpwrt
28
TBD
32
33*
Conditions
Preliminary
DS40300B-page 141
PIC16F62X
FIGURE 17-10: TIMER0 AND TIMER1 EXTERNAL CLOCK TIMINGS
RA4/T0CKI
41
40
42
RB6/T1OSO/T1CKI
46
45
47
48
TMR0 or
TMR1
DS40300B-page 142
Preliminary
PIC16F62X
TABLE 17-7:
Param
No.
Sym
40*
Tt0H
41*
Tt0L
42*
Tt0P
T0CKI Period
45*
Tt1H
T1CKI High
Time
46*
Tt1L
T1CKI Low
Time
47*
Tt1P
T1CKI input
period
Characteristic
Min
No Prescaler
With Prescaler
No Prescaler
With Prescaler
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
Synchronous, No Prescaler
Synchronous, 16F62X
with Prescaler 16LF62X
Asynchronous 16F62X
16LF62X
Synchronous, No Prescaler
Synchronous, 16F62X
with Prescaler 16LF62X
Asynchronous 16F62X
16LF62X
Synchronous 16F62X
16LF62X
Conditions
ns
ns
ns
ns
ns N = prescale
value (2, 4, ...,
256)
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns
ns N = prescale
value (1, 2, 4, 8)
Asynchronous 16F62X
ns
16LF62X
ns
Ft1
Timer1 oscillator input frequency range
200 kHz
(oscillator enabled by setting bit T1OSCEN)
48
TCKEZtmr1 Delay from external clock edge to timer
2Tosc
7Tos
increment
c
* These parameters are characterized but not tested.
Data in "Typ" column is at 5V, 25C unless otherwise stated. These parameters are for design guidance only and are not
tested.
51
52
RB3/CCP1
(Compare or PWM Mode)
53
54
Preliminary
DS40300B-page 143
PIC16F62X
TABLE 17-8:
CAPTURE/COMPARE/PWM REQUIREMENTS
Param
Sym
No.
50*
Characteristic
TccL CCP
input low time
Min
0.5TCY + 20
ns
10
No Prescaler
ns
16F62X
With Prescaler 16LF62X
20
ns
ns
10
ns
20
ns
3TCY + 40
N
ns
16F62X
10
25
ns
25
45
ns
16F62X
10
25
ns
16LF62X
TccH CCP
input high time
0.5TCY + 20
16LF62X
51*
25
45
ns
No Prescaler
16F62X
With Prescaler 16LF62X
52*
53*
54*
Conditions
N = prescale
value (1,4 or
16)
41
40
42
TMR0
TABLE 17-9:
Parameter
No.
40
Sym Characteristic
Tt0H T0CKI High Pulse Width
Min
No Prescaler
Typ
Max
ns
10*
ns
ns
With Prescaler
41
42
No Prescaler
With Prescaler
Units Conditions
10*
ns
TCY + 40*
N
ns
N = prescale value
(1, 2, 4, ..., 256)
DS40300B-page 144
Preliminary
PIC16F62X
18.0
DEVICE CHARACTERIZATION
INFORMATION
Preliminary
DS40300B-page 145
PIC16F62X
NOTES:
DS40300B-page 146
Preliminary
PIC16F62X
19.0
PACKAGING INFORMATION
19.1
18-Lead PDIP
Example
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
AABBCDE
18-Lead SOIC (.300")
XXXXXXXXXXXX
XXXXXXXXXXXX
XXXXXXXXXXXX
AABBCDE
20-Lead SSOP
XXXXXXXXXX
XXXXXXXXXX
AABBCDE
Legend: MM...M
XX...X
AA
BB
C
D
E
Note:
PIC16F627
-04I / P456
9923 CBA
Example
PIC16F627
-04I / S0218
9918 CDK
Example
PIC16F627
-04I / 218
9951 CBP
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
DS40300B-page 147
PIC16F62X
Package Type:
2
n
1
E1
A1
A
R
c
A2
B1
B
eB
Units
Dimension Limits
PCB Row Spacing
Number of Pins
Pitch
Lower Lead Width
Upper Lead Width
Shoulder Radius
Lead Thickness
Top to Seating Plane
Top of Lead to Seating Plane
Base to Seating Plane
Tip to Seating Plane
Package Length
Molded Package Width
Radius to Radius Width
Overall Row Spacing
Mold Draft Angle Top
Mold Draft Angle Bottom
INCHES*
NOM
0.300
18
0.100
0.013
0.018
0.055
0.060
0.000
0.005
0.005
0.010
0.110
0.155
0.075
0.095
0.000
0.020
0.125
0.130
0.890
0.895
0.245
0.255
0.230
0.250
0.310
0.349
5
10
5
10
MIN
n
p
B
B1
R
c
A
A1
A2
L
D
E
E1
eB
MAX
0.023
0.065
0.010
0.015
0.155
0.115
0.020
0.135
0.900
0.265
0.270
0.387
15
15
MILLIMETERS
NOM
7.62
18
2.54
0.33
0.46
1.40
1.52
0.00
0.13
0.13
0.25
2.79
3.94
1.91
2.41
0.00
0.51
3.18
3.30
22.61
22.73
6.22
6.48
5.84
6.35
7.87
8.85
5
10
5
10
MIN
MAX
0.58
1.65
0.25
0.38
3.94
2.92
0.51
3.43
22.86
6.73
6.86
9.83
15
15
* Controlling Parameter.
Dimension B1 does not include dam-bar protrusions. Dam-bar protrusions shall not exceed 0.003
(0.076 mm) per side or 0.006 (0.152 mm) more than dimension B1.
Dimensions D and E do not include mold flash or protrusions. Mold flash or protrusions shall not
exceed 0.010 (0.254 mm) per side or 0.020 (0.508 mm) more than dimensions D or E.
DS40300B-page 148
Preliminary
PIC16F62X
Package Type:
2
B
n
X
45
L
R2
c
A
R1
Units
Dimension Limits
Pitch
Number of Pins
Overall Pack. Height
Shoulder Height
Standoff
Molded Package Length
Molded Package Width
Outside Dimension
Chamfer Distance
Shoulder Radius
Gull Wing Radius
Foot Length
Foot Angle
Radius Centerline
Lead Thickness
Lower Lead Width
Mold Draft Angle Top
Mold Draft Angle Bottom
L1
A2
INCHES*
NOM
0.050
18
0.093
0.099
0.048
0.058
0.004
0.008
0.450
0.456
0.292
0.296
0.394
0.407
0.010
0.020
0.005
0.005
0.005
0.005
0.011
0.016
0
4
0.010
0.015
0.009
0.011
0.014
0.017
0
12
0
12
MIN
p
n
A
A1
A2
D
E
E1
X
R1
R2
L
L1
c
B
A1
MAX
0.104
0.068
0.011
0.462
0.299
0.419
0.029
0.010
0.010
0.021
8
0.020
0.012
0.019
15
15
MILLIMETERS
NOM
MAX
1.27
18
2.64
2.36
2.50
1.73
1.22
1.47
0.28
0.10
0.19
11.73
11.43
11.58
7.59
7.42
7.51
10.64
10.01
10.33
0.74
0.25
0.50
0.25
0.13
0.13
0.25
0.13
0.13
0.53
0.28
0.41
4
8
0
0.51
0.25
0.38
0.30
0.23
0.27
0.48
0.36
0.42
0
12
15
0
12
15
MIN
Controlling Parameter.
Dimension B does not include dam-bar protrusions. Dam-bar protrusions shall not exceed 0.003
(0.076 mm) per side or 0.006 (0.152 mm) more than dimension B.
Dimensions D and E do not include mold flash or protrusions. Mold flash or protrusions shall not
exceed 0.010 (0.254 mm) per side or 0.020 (0.508 mm) more than dimensions D or E.
Preliminary
DS40300B-page 149
PIC16F62X
Package Type:
2
1
L
R2
c
A
A1
R1
L1
A2
Units
Dimension Limits
Pitch
Number of Pins
Overall Pack. Height
Shoulder Height
Standoff
Molded Package Length
Molded Package Width
Outside Dimension
Shoulder Radius
Gull Wing Radius
Foot Length
Foot Angle
Radius Centerline
Lead Thickness
Lower Lead Width
Mold Draft Angle Top
Mold Draft Angle Bottom
INCHES
NOM
0.026
20
0.068
0.073
0.026
0.036
0.002
0.005
0.278
0.283
0.205
0.208
0.301
0.306
0.005
0.005
0.005
0.005
0.015
0.020
4
0
0.000
0.005
0.005
0.007
0.010
0.012
0
5
0
5
MIN
p
n
A
A1
A2
D
E
E1
R1
R2
L
L1
c
B
MAX
0.078
0.046
0.008
0.289
0.212
0.311
0.010
0.010
0.025
8
0.010
0.009
0.015
10
10
MILLIMETERS*
NOM
MAX
0.65
20
1.86
1.99
1.73
0.91
1.17
0.66
0.13
0.21
0.05
7.20
7.33
7.07
5.29
5.38
5.20
7.78
7.90
7.65
0.13
0.25
0.13
0.13
0.25
0.13
0.51
0.64
0.38
4
0
8
0.13
0.25
0.00
0.18
0.22
0.13
0.32
0.38
0.25
0
5
10
0
5
10
MIN
Controlling Parameter.
Dimension B does not include dam-bar protrusions. Dam-bar protrusions shall not exceed 0.003
(0.076 mm) per side or 0.006 (0.152 mm) more than dimension B.
Dimensions D and E do not include mold flash or protrusions. Mold flash or protrusions shall not
exceed 0.010 (0.254 mm) per side or 0.020 (0.508 mm) more than dimensions D or E.
DS40300B-page 150
Preliminary
PIC16F62X
INDEX
A
A/D
Special Event Trigger (CCP)....................................... 65
Absolute Maximum Ratings .............................................. 131
ADDLW Instruction ........................................................... 115
ADDWF Instruction ........................................................... 115
ANDLW Instruction ........................................................... 115
ANDWF Instruction ........................................................... 115
Architectural Overview .......................................................... 9
Assembler
MPASM Assembler................................................... 125
B
Baud Rate Error .................................................................. 73
Baud Rate Formula ............................................................. 73
Baud Rates
Asynchronous Mode ................................................... 74
Synchronous Mode ..................................................... 74
BCF Instruction ................................................................. 116
Block Diagram
TIMER0....................................................................... 45
TMR0/WDT PRESCALER .......................................... 48
Block Diagrams
Comparator I/O Operating Modes............................... 58
Comparator Output ..................................................... 60
RA3:RA0 and RA5 Port Pins ...................................... 35
Timer1......................................................................... 51
Timer2......................................................................... 54
USART Receive.......................................................... 80
USART Transmit......................................................... 78
BRGH bit ............................................................................. 73
Brown-Out Detect (BOD) .................................................. 101
BSF Instruction ................................................................. 116
BTFSC Instruction............................................................. 116
BTFSS Instruction ............................................................. 117
C
CALL Instruction ............................................................... 117
Capture (CCP Module) ....................................................... 64
Block Diagram............................................................. 64
CCP Pin Configuration................................................ 64
CCPR1H:CCPR1L Registers...................................... 64
Changing Between Capture Prescalers...................... 64
Software Interrupt ....................................................... 64
Timer1 Mode Selection ............................................... 64
Capture/Compare/PWM (CCP)........................................... 63
CCP1 .......................................................................... 63
CCP1CON Register ............................................ 63
CCPR1H Register............................................... 63
CCPR1L Register ............................................... 63
CCP2 .......................................................................... 63
Timer Resources......................................................... 63
CCP1CON Register ............................................................ 63
CCP1M3:CCP1M0 Bits............................................... 63
CCP1X:CCP1Y Bits .................................................... 63
CCP2CON Register
CCP2M3:CCP2M0 Bits............................................... 63
CCP2X:CCP2Y Bits .................................................... 63
Clocking Scheme/Instruction Cycle .................................... 12
CLRF Instruction ............................................................... 117
CLRW Instruction .............................................................. 117
CLRWDT Instruction ......................................................... 118
CMCON Register ................................................................ 57
Code Protection ................................................................ 112
COMF Instruction .............................................................. 118
Comparator Configuration................................................... 58
Comparator Interrupts......................................................... 61
Comparator Module ............................................................ 57
Comparator Operation ........................................................ 59
Comparator Reference ....................................................... 59
Compare (CCP Module) ..................................................... 65
Block Diagram ............................................................ 65
CCP Pin Configuration ............................................... 65
CCPR1H:CCPR1L Registers ..................................... 65
Software Interrupt ....................................................... 65
Special Event Trigger ................................................. 65
Timer1 Mode Selection............................................... 65
Configuration Bits ............................................................... 96
Configuring the Voltage Reference..................................... 69
Crystal Operation................................................................ 97
D
DATA .................................................................................. 93
Data .................................................................................... 93
Data EEPROM Memory...................................................... 91
EECON1 Register ...................................................... 91
EECON2 Register ...................................................... 91
Data Memory Organization................................................. 13
DECF Instruction .............................................................. 118
DECFSZ Instruction.......................................................... 118
Development Support ....................................................... 125
E
EECON1 ............................................................................. 92
Errata .................................................................................... 3
External Crystal Oscillator Circuit ....................................... 98
G
General purpose Register File............................................ 13
GOTO Instruction.............................................................. 119
I
I/O Ports ............................................................................. 27
I/O Programming Considerations ....................................... 44
ID Locations...................................................................... 112
INCF Instruction................................................................ 119
INCFSZ Instruction ........................................................... 119
In-Circuit Serial Programming........................................... 112
Indirect Addressing, INDF and FSR Registers ................... 26
Instruction Flow/Pipelining .................................................. 12
Instruction Set
ADDLW..................................................................... 115
ADDWF .................................................................... 115
ANDLW..................................................................... 115
ANDWF .................................................................... 115
BCF .......................................................................... 116
BSF........................................................................... 116
BTFSC...................................................................... 116
BTFSS ...................................................................... 117
CALL......................................................................... 117
CLRF ........................................................................ 117
CLRW ....................................................................... 117
CLRWDT .................................................................. 118
COMF ....................................................................... 118
DECF........................................................................ 118
DECFSZ ................................................................... 118
GOTO ....................................................................... 119
INCF ......................................................................... 119
INCFSZ..................................................................... 119
IORLW ...................................................................... 119
IORWF...................................................................... 120
MOVF ....................................................................... 120
MOVLW .................................................................... 120
MOVWF.................................................................... 120
Preliminary
DS40300B-page 151
PIC16F62X
NOP .......................................................................... 121
OPTION .................................................................... 121
RETFIE ..................................................................... 121
RETLW ..................................................................... 121
RETURN ................................................................... 122
RLF ........................................................................... 122
RRF........................................................................... 122
SLEEP ...................................................................... 122
SUBLW ..................................................................... 123
SUBWF ..................................................................... 123
SWAPF ..................................................................... 124
TRIS .......................................................................... 124
XORLW ..................................................................... 124
XORWF..................................................................... 124
Instruction Set Summary................................................... 113
INT Interrupt ...................................................................... 108
INTCON Register ................................................................ 21
Interrupt Sources
Capture Complete (CCP) ............................................ 64
Compare Complete (CCP) .......................................... 65
TMR2 to PR2 Match (PWM) ....................................... 66
Interrupts ........................................................................... 107
Interrupts, Enable Bits
CCP1 Enable (CCP1IE Bit)......................................... 64
Interrupts, Flag Bits
CCP1 Flag (CCP1IF Bit) ....................................... 64, 65
IORLW Instruction............................................................. 119
IORWF Instruction............................................................. 120
Q
Q-Clock............................................................................... 66
Quick-Turnaround-Production (QTP) Devices...................... 7
Memory Organization
Data EEPROM Memory .............................................. 91
MOVF Instruction .............................................................. 120
MOVLW Instruction ........................................................... 120
MOVWF Instruction........................................................... 120
MPLAB Integrated Development Environment Software .. 125
RC Oscillator....................................................................... 98
READING ........................................................................... 93
Registers
Maps
PIC16C76 ........................................................... 14
PIC16C77 ........................................................... 14
RCSTA
Diagram .............................................................. 72
Reset .................................................................................. 99
RETFIE Instruction ........................................................... 121
RETLW Instruction............................................................ 121
RETURN Instruction ......................................................... 122
RLF Instruction ................................................................. 122
RRF Instruction................................................................. 122
K
KeeLoq Evaluation and Programming Tools.................. 128
O
OPTION Instruction........................................................... 121
OPTION Register ................................................................ 20
Oscillator Configurations ..................................................... 97
Oscillator Start-up Timer (OST) ........................................ 101
Output of TMR2................................................................... 54
P
Package Marking Information ........................................... 147
Packaging Information ...................................................... 147
PCL and PCLATH ............................................................... 25
PCON Register ................................................................... 24
PICDEM-1 Low-Cost PICmicro Demo Board.................... 127
PICDEM-2 Low-Cost PIC16CXX Demo Board ................. 127
PICDEM-3 Low-Cost PIC16CXXX Demo Board............... 127
PICSTART Plus Entry Level Development System ....... 127
PIE1 Register ...................................................................... 22
Pin Functions
RC6/TX/CK ........................................................... 7188
RC7/RX/DT ........................................................... 7188
Pinout Description ............................................................... 11
PIR1 Register...................................................................... 23
Port RB Interrupt ............................................................... 108
PORTA................................................................................ 27
PORTB................................................................................ 34
Power Control/Status Register (PCON) ............................ 102
DS40300B-page 152
T
T1CKPS0 bit ....................................................................... 50
T1CKPS1 bit ....................................................................... 50
T1CON Register ................................................................. 50
T1OSCEN bit ...................................................................... 50
T1SYNC bit......................................................................... 50
T2CKPS0 bit ....................................................................... 55
T2CKPS1 bit ....................................................................... 55
T2CON Register ................................................................. 55
Preliminary
PIC16F62X
Timer0
TIMER0....................................................................... 45
TIMER0 (TMR0) Interrupt ........................................... 45
TIMER0 (TMR0) Module............................................. 45
TMR0 with External Clock........................................... 47
Timer1
Special Event Trigger (CCP)....................................... 65
Switching Prescaler Assignment................................. 49
Timer2
PR2 Register............................................................... 66
TMR2 to PR2 Match Interrupt ..................................... 66
Timers
Timer1
Asynchronous Counter Mode ............................. 52
Block Diagram .................................................... 51
Capacitor Selection............................................. 52
External Clock Input............................................ 51
External Clock Input Timing ................................ 52
Operation in Timer Mode .................................... 51
Oscillator ............................................................. 52
Prescaler....................................................... 51, 53
Resetting of Timer1 Registers ............................ 53
Resetting Timer1 using a CCP Trigger Output ... 53
Synchronized Counter Mode .............................. 51
T1CON................................................................ 50
TMR1H ............................................................... 52
TMR1L ................................................................ 52
Timer2
Block Diagram .................................................... 54
Module ................................................................ 54
Postscaler ........................................................... 54
Prescaler............................................................. 54
T2CON................................................................ 55
Timing Diagrams
Timer0....................................................................... 142
Timer1....................................................................... 142
USART Asynchronous Master Transmission.............. 79
USART RX Pin Sampling...................................... 76, 77
USART Synchronous Reception................................. 87
USART Synchronous Transmission ........................... 85
USART, Asynchronous Reception.............................. 81
Timing Diagrams and Specifications................................. 139
TMR0 Interrupt .................................................................. 108
TMR1CS bit ........................................................................ 50
TMR1ON bit ........................................................................ 50
TMR2ON bit ........................................................................ 55
TOUTPS0 bit....................................................................... 55
TOUTPS1 bit....................................................................... 55
TOUTPS2 bit....................................................................... 55
TOUTPS3 bit....................................................................... 55
TRIS Instruction ................................................................ 124
TRISA ................................................................................. 27
TRISB ................................................................................. 34
TXSTA Register .................................................................. 71
USART
Asynchronous Mode................................................... 78
Asynchronous Receiver.............................................. 80
Asynchronous Reception............................................ 82
Asynchronous Transmission ...................................... 79
Asynchronous Transmitter.......................................... 78
Baud Rate Generator (BRG) ...................................... 73
Sampling..................................................................... 76
Synchronous Master Mode......................................... 84
Synchronous Master Reception ................................. 86
Synchronous Master Transmission ............................ 84
Synchronous Slave Mode........................................... 88
Synchronous Slave Reception ................................... 88
Synchronous Slave Transmit...................................... 88
Transmit Block Diagram ............................................. 78
V
Voltage Reference Module ................................................. 69
VRCON Register ................................................................ 69
W
Watchdog Timer (WDT).................................................... 109
WRITE ................................................................................ 93
WRITING ............................................................................ 93
WWW, On-Line Support ....................................................... 3
X
XORLW Instruction ........................................................... 124
XORWF Instruction........................................................... 124
U
Universal Synchronous Asynchronous Receiver
Transmitter (USART) .......................................................... 71
Asynchronous Receiver
Setting Up Reception .......................................... 83
Timing Diagram .................................................. 81
Asynchronous Receiver Mode
Block Diagram .................................................... 83
Section ................................................................ 83
Preliminary
DS40300B-page 153
PIC16F62X
DS40300B-page 154
Preliminary
PIC16F62X
ON-LINE SUPPORT
981103
Preliminary
DS40300B-page 155
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 (602) 786-7578.
Please list the following information, and use this outline to provide us with your comments about this Data Sheet.
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: DS40300B
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 data sheet easy to follow? If not, why?
4. What additions to the data sheet do you think would enhance the structure and subject?
5. What deletions from the data sheet could be made without affecting the overall usefulness?
8. How would you improve our software, systems, and silicon products?
DS40300B-page 156
Preliminary
PIC16F62X
PIC16F62X PRODUCT IDENTIFICATION SYSTEM
To order or to obtain information, e.g., on pricing or delivery, please use the listed part numbers, and refer to the factory or the listed
sales offices.
PART NO.
-XX
X /XX XXX
Pattern:
Package:
P
SO
SS
=
=
=
PDIP
SOIC (Gull Wing, 300 mil body)
SSOP (209 mil)
Temperature Range:
I
E
=
=
=
0C to +70C
40C to +85C
40C to +125C
Frequency
Range:
04
04
20
=
=
=
Device:
Examples:
g) PIC16F627 - 04/P 301 =
Commercial temp., PDIP package, 4 MHz, normal VDD limits,
QTP pattern #301.
h) PIC16LF627- 04I/SO =
Industrial temp., SOIC package, 200kHz, extended VDD
limits.
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
DS40300B-page 157
PIC16F62X
NOTES:
DS40300B-page 158
PIC16F62X
NOTES:
Preliminary
DS40300B-page 159
Note the following details of the code protection feature on PICmicro MCUs.
The PICmicro family meets the specifications contained in the Microchip Data Sheet.
Microchip believes that its family of PICmicro microcontrollers is one of the most secure products 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 PICmicro microcontroller in a manner outside the operating specifications contained in the data sheet.
The person doing so may be 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 product.
If you have any further questions about this matter, please contact the local sales office nearest to you.
Trademarks
The Microchip name and logo, the Microchip logo, FilterLab,
KEELOQ, microID, MPLAB, PIC, PICmicro, PICMASTER,
PICSTART, PRO MATE, SEEVAL and The Embedded Control
Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
dsPIC, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB,
In-Circuit Serial Programming, ICSP, ICEPIC, microPort,
Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM,
MXDEV, PICC, PICDEM, PICDEM.net, rfPIC, Select Mode
and Total Endurance are trademarks of Microchip Technology
Incorporated in the U.S.A.
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.
2002, Microchip Technology Incorporated, Printed in the
U.S.A., All Rights Reserved.
Printed on recycled paper.
M
WORLDWIDE SALES AND SERVICE
AMERICAS
ASIA/PACIFIC
Japan
Corporate Office
Australia
Rocky Mountain
China - Beijing
Atlanta
500 Sugar Mill Road, Suite 200B
Atlanta, GA 30350
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
China - Chengdu
Microchip Technology Consulting (Shanghai)
Co., Ltd., Chengdu Liaison Office
Rm. 2401, 24th Floor,
Ming Xing Financial Tower
No. 88 TIDU Street
Chengdu 610016, China
Tel: 86-28-6766200 Fax: 86-28-6766599
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
San Jose
Hong Kong
New York
Toronto
6285 Northam Drive, Suite 108
Mississauga, Ontario L4V 1X5, Canada
Tel: 905-673-0699 Fax: 905-673-6509
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-334-8870 Fax: 65-334-8850
Taiwan
Microchip Technology Taiwan
11F-3, No. 207
Tung Hua North Road
Taipei, 105, Taiwan
Tel: 886-2-2717-7175 Fax: 886-2-2545-0139
EUROPE
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
Gustav-Heinemann Ring 125
D-81739 Munich, 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
Arizona Microchip Technology Ltd.
505 Eskdale Road
Winnersh Triangle
Wokingham
Berkshire, England RG41 5TU
Tel: 44 118 921 5869 Fax: 44-118 921-5820
01/18/02