Академический Документы
Профессиональный Документы
Культура Документы
Pin Diagrams
PIC16CE623
PIC16CE624
PIC16CE625
Device
Program
Memory
RAM
Data
Memory
EEPROM
Data
Memory
PIC16CE623
512x14
96x8
128x8
PIC16CE624
1Kx14
96x8
128x8
PIC16CE625
2Kx14
128x8
128x8
Interrupt capability
16 special function hardware registers
8-level deep hardware stack
Direct, Indirect and Relative addressing modes
1
2
3
4
5
6
7
8
9
18
17
16
15
14
13
12
11
10
RA1/AN1
RA0/AN0
OSC1/CLKIN
OSC2/CLKOUT
VDD
RB7
RB6
RB5
RB4
PIC16CE62X
RA2/AN2/VREF
RA3/AN3
RA4/T0CKI
MCLR/VPP
VSS
RB0/INT
RB1
RB2
RB3
PIC16CE62X
20
19
18
17
16
15
14
13
12
11
RA1/AN1
RA0/AN0
OSC1/CLKIN
OSC2/CLKOUT
VDD
VDD
RB7
RB6
RB5
RB4
SSOP
RA2/AN2/VREF
RA3/AN3
RA4/T0CKI
MCLR/VPP
VSS
VSS
RB0/INT
RB1
RB2
RB3
1
2
3
4
5
6
7
8
9
10
Peripheral Features:
CMOS Technology:
Low-power, high-speed CMOS EPROM/EEPROM
technology
Fully static design
Wide operating voltage range
- 2.5V 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
DS40182C-page 1
PIC16CE62X
Table of Contents
1.0 General Description ............................................................................................................................................... 3
2.0 PIC16CE62X Device Varieties .............................................................................................................................. 5
3.0 Architectural Overview........................................................................................................................................... 7
4.0 Memory Organization .......................................................................................................................................... 11
5.0 I/O Ports............................................................................................................................................................... 23
6.0 EEPROM Peripheral Operation ........................................................................................................................... 29
7.0 Timer0 Module..................................................................................................................................................... 35
8.0 Comparator Module ............................................................................................................................................. 41
9.0 Voltage Reference Module .................................................................................................................................. 47
10.0 Special Features of the CPU ............................................................................................................................... 49
11.0 Instruction Set Summary ..................................................................................................................................... 65
12.0 Development Support .......................................................................................................................................... 77
13.0 Electrical Specifications ....................................................................................................................................... 83
14.0 Packaging Information ......................................................................................................................................... 97
Appendix A: Code for Accessing EEPROM Data Memory ........................................................................................ 103
Index .......................................................................................................................................................................... 105
On Line Support .......................................................................................................................................................... 107
Reader Response ....................................................................................................................................................... 108
PIC16CE62X Product Identification System .............................................................................................................. 109
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: (480) 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.
DS40182C-page 2
PIC16CE62X
1.0
GENERAL DESCRIPTION
1.1
Development Support
DS40182C-page 3
PIC16CE62X
TABLE 1-1:
PIC16CE623
Clock
PIC16CE624
PIC16CE625
20
20
512
1K
2K
96
96
128
Memory
20
128
128
128
TMR0
TMR0
TMR0
Comparators(s)
Yes
Yes
Yes
Interrupt Sources
I/O Pins
13
13
13
2.5-5.5
2.5-5.5
2.5-5.5
Brown-out Reset
Yes
Yes
Yes
Packages
Features
Timer Module(s)
Internal Reference Voltage
Peripherals
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 PIC16CE62X Family devices use serial programming with clock pin RB6 and data pin RB7.
DS40182C-page 4
PIC16CE62X
2.0
PIC16CE62X DEVICE
VARIETIES
2.1
UV Erasable Devices
The UV erasable version, offered in the CERDIP package is optimal for prototype development and pilot
programs. This version can be erased and
reprogrammed to any of the oscillator modes.
and
PRO MATE
Microchips
PICSTART
programmers both support programming of the
PIC16CE62X.
2.2
One-Time-Programmable (OTP)
Devices
2.3
Quick-Turn-Programming (QTP)
Devices
2.4
Serialized Quick-Turn-Programming
(SQTPSM) Devices
DS40182C-page 5
PIC16CE62X
NOTES:
DS40182C-page 6
PIC16CE62X
3.0
ARCHITECTURAL OVERVIEW
PIC16CE623
Program
Memory
RAM
Data
Memory
EEPROM
Data
Memory
512x14
96x8
128x8
PIC16CE624
1Kx14
96x8
128x8
PIC16CE625
2Kx14
128x8
128x8
DS40182C-page 7
PIC16CE62X
FIGURE 3-1:
BLOCK DIAGRAM
Device
Program Memory
EEPROM DATA
MEMORY
128 x 8
128 x 8
128 x 8
96 x 8
96 x 8
128 x 8
512 x 14
1K x 14
2K x 14
PIC16CE623
PIC16CE624
PIC16CE625
Data Memory
(RAM)
13
Program Counter
Voltage
Reference
Data Bus
EPROM
Program
Memory
Program
Bus
RAM
File
Registers
8 Level Stack
(13-bit)
14
Comparator
RA0/AN0
Addr MUX
Instruction reg
Direct Addr
Indirect
Addr
RA1/AN1
RA2/AN2/VREF
RA3/AN3
FSR reg
STATUS reg
TMR0
3
MUX
Power-up
Timer
Instruction
Decode &
Control
Timing
Generation
OSC1/CLKIN
OSC2/CLKOUT
Oscillator
Start-up Timer
Power-on
Reset
RA4/T0CKI
ALU
W reg
I/O Ports
Watchdog
Timer
Brown-out
Reset
PORTB
EESCL
EESDA
EEVDD
EEINTF
DS40182C-page 8
PIC16CE62X
TABLE 3-1:
Name
SSOP
Pin #
I/O/P
Type
Buffer
Type
Description
OSC1/CLKIN
16
18
OSC2/CLKOUT
15
17
MCLR/VPP
I/P
ST
RA0/AN0
17
19
I/O
ST
RA1/AN1
18
20
I/O
ST
RA2/AN2/VREF
I/O
ST
RA3/AN3
I/O
ST
RA4/T0CKI
I/O
ST
RB0/INT
I/O
TTL/ST(1)
RB1
I/O
TTL
RB2
I/O
TTL
RB3
10
I/O
TTL
RB4
10
11
I/O
TTL
RB5
11
12
I/O
TTL
RB6
12
13
I/O
TTL/ST(2)
RB7
13
14
I/O
TTL/ST(2)
VSS
5,6
VDD
14
15,16
Legend:
O = output
I/O = input/output
P = power
= Not used
I = Input
ST = Schmitt Trigger input
TTL = TTL input
Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
Note 2: This buffer is a Schmitt Trigger input when used in serial programming mode.
DS40182C-page 9
PIC16CE62X
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
(RC mode)
EXAMPLE 3-1:
PC
PC+1
PC+2
1. MOVLW 55h
2. MOVWF PORTB
3. CALL
SUB_1
4. BSF
PORTA, BIT3
5. Instruction @
address SUB_1
Fetch 1
Execute 1
Fetch 2
Execute 2
Fetch 3
Execute 3
Fetch 4
Flush
Fetch SUB_1
Execute SUB_1
All instructions are single cycle, except for any program branches. These take two cycles since the fetch instruction is flushed
from the pipeline, while the new instruction is being fetched and then executed.
DS40182C-page 10
PIC16CE62X
4.0
MEMORY ORGANIZATION
4.1
The PIC16CE62X has a 13-bit program counter capable of addressing an 8K x 14 program memory space.
Only the first 512 x 14 (0000h - 01FFh) for the
PIC16CE623, 1K x 14 (0000h - 03FFh) for the
PIC16CE624 and 2K x 14 (0000h - 07FFh) for the
PIC16CE625 are physically implemented. Accessing a
location above these boundaries will cause a
wrap-around within the first 512 x 14 space
(PIC16CE623) or 1K x 14 space (PIC16CE624) or 2K
x 14 space (PIC16CE625). The reset vector is at 0000h
and the interrupt vector is at 0004h (Figure 4-1,
Figure 4-2, Figure 4-3).
FIGURE 4-1:
FIGURE 4-2:
CALL, RETURN
RETFIE, RETLW
13
Stack Level 1
Stack Level 2
Stack Level 8
Reset Vector
Interrupt Vector
000h
0004
0005
PC<12:0>
CALL, RETURN
RETFIE, RETLW
On-chip Program
Memory
13
03FFh
0400h
Stack Level 1
Stack Level 2
1FFFh
Stack Level 8
Reset Vector
FIGURE 4-3:
000h
CALL, RETURN
RETFIE, RETLW
Interrupt Vector
0004
0005
On-chip Program
Memory
13
Stack Level 1
Stack Level 2
Stack Level 8
01FFh
Reset Vector
000h
Interrupt Vector
0200h
0004
0005
1FFFh
On-chip Program
Memory
07FFh
0800h
1FFFh
DS40182C-page 11
PIC16CE62X
4.2
DS40182C-page 12
4.2.1
PIC16CE62X
FIGURE 4-4:
File
Address
00h
01h
02h
03h
04h
05h
06h
07h
08h
09h
0Ah
0Bh
0Ch
0Dh
0Eh
0Fh
10h
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh
20h
FIGURE 4-5:
INDF(1)
TMR0
PCL
STATUS
FSR
PORTA
PORTB
INDF(1)
OPTION
PCL
STATUS
FSR
TRISA
TRISB
PCLATH
INTCON
PIR1
PCLATH
INTCON
PIE1
PCON
EEINTF
CMCON
VRCON
File
Address
80h
81h
82h
83h
84h
85h
86h
87h
88h
89h
8Ah
8Bh
8Ch
8Dh
8Eh
8Fh
90h
91h
92h
93h
94h
95h
96h
97h
98h
99h
9Ah
9Bh
9Ch
9Dh
9Eh
9Fh
00h
01h
02h
03h
04h
05h
06h
07h
08h
09h
0Ah
0Bh
0Ch
0Dh
0Eh
0Fh
10h
11h
12h
13h
14h
15h
16h
17h
18h
19h
1Ah
1Bh
1Ch
1Dh
1Eh
1Fh
20h
A0h
INDF(1)
OPTION
PCL
STATUS
FSR
TRISA
TRISB
PCLATH
INTCON
PIR1
PCLATH
INTCON
PIE1
PCON
EEINTF
CMCON
EFh
F0h
FFh
Bank 1
INDF(1)
TMR0
PCL
STATUS
FSR
PORTA
PORTB
VRCON
General
Purpose
Register
80h
81h
82h
83h
84h
85h
86h
87h
88h
89h
8Ah
8Bh
8Ch
8Dh
8Eh
8Fh
90h
91h
92h
93h
94h
95h
96h
97h
98h
99h
9Ah
9Bh
9Ch
9Dh
9Eh
9Fh
A0h
BFh
C0h
Accesses
70h-7Fh
Bank 0
File
Address
General
Purpose
Register
General
Purpose
Register
7Fh
Accesses
70h-7Fh
7Fh
F0h
FFh
Bank 0
Bank 1
DS40182C-page 13
PIC16CE62X
4.2.2
TABLE 4-1:
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)
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
0000 0000
0000 0000
0001 1xxx
000q quuu
(2)
RP1(2)
RP0
PD
DC
xxxx xxxx
uuuu uuuu
RA4
RA3
RA2
RA1
RA0
---x 0000
---u 0000
RB4
RB3
RB2
RB1
RB0
xxxx xxxx
uuuu uuuu
Unimplemented
08h
Unimplemented
09h
Unimplemented
0Ah
PCLATH
---0 0000
---0 0000
0Bh
INTCON
0Ch
PIR1
03h
STATUS
04h
FSR
05h
PORTA
06h
PORTB
RB7
RB6
RB5
07h
IRP
TO
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0000 000x
0000 000u
CMIF
-0-- ----
-0-- ----
C2OUT
C1OUT
CIS
CM2
CM1
CM0
00-- 0000
00-- 0000
xxxx xxxx
xxxx xxxx
1111 1111
1111 1111
0Dh-1Eh Unimplemented
1Fh
CMCON
Bank 1
80h
INDF
81h
OPTION
82h
PCL
83h
STATUS
Addressing this location uses contents of FSR to address data memory (not a physical
register)
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
RP1
RP0
TO
0000 0000
PD
DC
000q quuu
84h
FSR
xxxx xxxx
uuuu uuuu
85h
TRISA
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
---1 1111
---1 1111
86h
TRISB
TRISB7
TRISB6
TRISB5
TRISB4
TRISB3
TRISB2
TRISB1
TRISB0
1111 1111
1111 1111
87h
Unimplemented
88h
Unimplemented
89h
Unimplemented
8Ah
PCLATH
---0 0000
---0 0000
8Bh
INTCON
8Ch
PIE1
8Dh
PCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0000 000x
0000 000u
CMIE
-0-- ----
-0-- ----
POR
BOD
---- --0x
---- --uq
Unimplemented
8Eh
0000 0000
0001 1xxx
8Fh-9Eh
Unimplemented
90h
EEINTF
EESCL
EESDA
EEVDD
---- -111
---- -111
9Fh
VRCON
VREN
VROE
VRR
VR3
VR2
VR1
VR0
000- 0000
000- 0000
Other (non power-up) resets include MCLR reset, Brown-out Reset and Watchdog Timer Reset during normal
operation.
Note 2:
IRP & RPI bits are reserved; always maintain these bits clear.
DS40182C-page 14
PIC16CE62X
4.2.2.1
STATUS REGISTER
Note 1:
Note 2:
REGISTER 4-1:
Reserved Reserved
IRP
RP1
R/W-0
R-1
R-1
R/W-x
R/W-x
R/W-x
RP0
TO
PD
DC
bit7
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:
IRP: The IRP bit is reserved on the PIC16CE62X, always maintain this bit clear.
bit 6:5
bit 4:
bit 3:
bit 2:
Z: Zero bit
1 = The result of an arithmetic or logic operation is zero
0 = The result of an arithmetic or logic operation is not zero
bit 1:
DC: Digit carry/borrow bit (ADDWF, ADDLW,SUBLW,SUBWF instructions) (for borrow the polarity is reversed)
1 = A carry-out from the 4th low order bit of the result occurred
0 = No carry-out from the 4th low order bit of the result
bit 0:
DS40182C-page 15
PIC16CE62X
4.2.2.2
OPTION REGISTER
REGISTER 4-2:
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
R/W-1
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
bit7
bit0
bit 7:
bit 6:
bit 5:
bit 4:
bit 3:
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
-n = Value at POR reset
-x = Unknown at POR reset
DS40182C-page 16
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
PIC16CE62X
4.2.2.3
INTCON REGISTER
Note:
REGISTER 4-3:
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-0
R/W-x
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
bit7
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:
DS40182C-page 17
PIC16CE62X
4.2.2.4
PIE1 REGISTER
REGISTER 4-4:
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
U-0
CMIE
bit7
bit0
bit 7:
Unimplemented: Read as 0
bit 6:
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
-n = Value at POR reset
-x = Unknown at POR reset
4.2.2.5
PIR1 REGISTER
This register contains the individual flag bit for the comparator interrupt.
Note:
REGISTER 4-5:
U-0
R/W-0
U-0
U-0
U-0
U-0
U-0
U-0
CMIF
bit7
bit0
bit 7:
Unimplemented: Read as 0
bit 6:
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
-n = Value at POR reset
-x = Unknown at POR reset
DS40182C-page 18
PIC16CE62X
4.2.2.6
PCON REGISTER
REGISTER 4-6:
U-0
U-0
U-0
U-0
U-0
U-0
R/W-0
R/W-0
POR
BOD
bit7
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
-n = Value at POR reset
-x = Unknown at POR reset
bit 0:
DS40182C-page 19
PIC16CE62X
4.3
4.3.2
FIGURE 4-6:
LOADING OF PC IN
DIFFERENT SITUATIONS
PCH
8
PC
8
PCLATH<4:0>
Note 1:
ALU result
PCH
11 10
PCL
8
PC
Note 2:
Instruction with
PCL as
Destination
PCLATH
12
PCL
12
STACK
GOTO, CALL
2
PCLATH<4:3>
11
Opcode <10:0>
PCLATH
4.3.1
COMPUTED GOTO
DS40182C-page 20
PIC16CE62X
4.4
EXAMPLE 4-1:
INDIRECT ADDRESSING
movlw
FIGURE 4-7:
;initialize pointer
FSR
;to RAM
clrf
INDF
incf
NEXT
0x20
movwf
Indirect addressing is possible by using the INDF register. Any instruction using the INDF register actually
accesses data pointed to by the File Select Register
(FSR). Reading INDF itself indirectly will produce 00h.
Writing to the INDF register indirectly results in a
no-operation (although status bits may be affected). An
effective 9-bit address is obtained by concatenating the
8-bit FSR register and the IRP bit (STATUS<7>), as
shown in Figure 4-7. However, IRP is not used in the
PIC16CE62X.
FSR
;inc pointer
btfss
FSR,4
;all done?
goto
NEXT
CONTINUE:
RP1
RP0
(1)
bank select
from opcode
Indirect Addressing
IRP(1)
bank select
location select
00
01
10
FSR Register
location select
11
00h
180h
not used
Data
Memory
7Fh
1FFh
Bank 0
Bank 1
Bank 2
Bank 3
For memory map detail see Figure 4-4 and Figure 4-5.
Note 1: The RP1 and IRP bits are reserved; always maintain these bits clear.
DS40182C-page 21
PIC16CE62X
NOTES:
DS40182C-page 22
PIC16CE62X
5.0
I/O PORTS
Note:
5.1
FIGURE 5-1:
Data
Bus
BLOCK DIAGRAM OF
RA<1:0> PINS
CK
WR
TRISA
EXAMPLE 5-1:
CLRF
FIGURE 5-2:
D
CK
D
WR
TRISA
I/O Pin
Q
N
CK
RD TRISA
VSS
Analog
Input Mode
RD TRISA
Schmitt Trigger
Input Buffer
Q
RD PORTA
VSS
Analog
Input Mode
Schmitt Trigger
Input Buffer
Q
D
EN
RA2 Pin
TRIS Latch
TRIS Latch
Data Latch
INITIALIZING PORTA
PORTA
VDD
Q
CK
The RA2 pin will also function as the output for the
voltage reference. When in this mode, the VREF pin is a
very high impedance output. The user must configure
TRISA<2> bit as an input and use high impedance
loads.
WR
PortA
Data Latch
D
Data
Bus
Q
VDD
WR
PortA
D
EN
RD PORTA
To Comparator
VROE
To Comparator
VREF
DS40182C-page 23
PIC16CE62X
FIGURE 5-3:
Data
Bus
Q
Comparator Output
WR
PORTA
VDD
Q
CK
Data Latch
D
VDD
Q
RA3 Pin
WR
TRISA
CK
Q
VSS
Analog
Input Mode
TRIS Latch
Schmitt Trigger
Input Buffer
RD TRISA
Q
D
EN
RD PORTA
To Comparator
FIGURE 5-4:
Data
Bus
Q
Comparator Output
WR
PORTA
CK
Data Latch
D
WR
TRISA
Q
N
CK
RA4 Pin
Q
VSS
TRIS Latch
Schmitt Trigger
Input Buffer
RD TRISA
Q
D
EN
RD PORTA
DS40182C-page 24
PIC16CE62X
TABLE 5-1:
PORTA FUNCTIONS
Name
Bit #
Buffer
Type
RA0/AN0
RA1/AN1
RA2/AN2/VREF
RA3/AN3
RA4/T0CKI
bit0
bit1
bit2
bit3
bit4
ST
ST
ST
ST
ST
Function
Input/output or comparator input
Input/output or comparator input
Input/output or comparator input or VREF output
Input/output or comparator input/output
Input/output or external clock input for TMR0 or comparator output.
Output is open drain type.
TABLE 5-2:
Address Name
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value on:
POR
Value on
All Other
Resets
05h
PORTA
RA4
RA3
RA2
RA1
RA0
---x 0000
---u 0000
85h
TRISA
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
---1 1111
---1 1111
1Fh
CMCON
C2OUT
C1OUT
CIS
CM2
CM1
CM0
00-- 0000
00-- 0000
9Fh
VRCON
VREN
VROE
VRR
VR3
VR2
VR1
VR0
000- 0000
000- 0000
DS40182C-page 25
PIC16CE62X
5.2
FIGURE 5-5:
FIGURE 5-6:
VDD
RBPU(1)
BLOCK DIAGRAM OF
RB<7:4> PINS
RBPU(1)
P
Data Bus
WR PORTB
WR PORTB
weak
pull-up
weak
pull-up
Data Latch
D
Q
Data Bus
VDD
Data Latch
D
Q
BLOCK DIAGRAM OF
RB<3:0> PINS
I/O pin
CK
I/O pin
CK
WR TRISB
TTL
Input
Buffer
(1)
CK
TRIS Latch
D
Q
WR TRISB(1)
TTL
Input
Buffer
CK
RD TRISB
ST
Buffer
Q
RD PORTB
RD TRISB
D
EN
Latch
Q
D
RB0/INT
Set RBIF
EN
RD PORTB
From other
RB<7:4> pins
ST
Buffer
RD Port
EN
RD Port
RB<7:6> in serial programming mode
DS40182C-page 26
PIC16CE62X
TABLE 5-3:
Name
PORTB FUNCTIONS
Bit #
Buffer Type
Function
bit0
TABLE 5-4:
(1)
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
06h
PORTB
RB7
RB6
RB5
RB4
RB3
RB2
RB1
RB0
xxxx xxxx
uuuu uuuu
86h
TRISB
TRISB7
TRISB6
81h
OPTION
RBPU
INTEDG
T0SE
PSA
PS2
PS1
PS0
1111 1111
1111 1111
1111 1111
DS40182C-page 27
PIC16CE62X
5.3
5.3.1
EXAMPLE 5-2:
READ-MODIFY-WRITE
INSTRUCTIONS ON AN
I/O PORT
BCF
BCF
BSF
BCF
BCF
5.3.2
Q1
fetched
Fetched
pppp
pppp
11pp pppp
11pp pppp
pppp
pppp
11pp pppp
10pp pppp
PC
PC
Instruction
Instruction
; 01pp
; 10pp
;
; 10pp
; 10pp
;
; Note that the user may have expected the pin
; values to be 00pp pppp. The 2nd BCF caused
; RB7 to be latched as the pin value (High).
FIGURE 5-7:
PORTB, 7
PORTB, 6
STATUS,RP0
TRISB, 7
TRISB, 6
Q3
Q4
PC
M
OVW PORTB
F
W to
rite
PORTB
Q1
Q2
Q3
Q4
PC + 1
MOVF PORTB, W
Read PORTB
Q1
Q2
Q3
Q4
Q1
Q2
Q3
PC + 2
PC + 3
NOP
NOP
Port pin
sampled here
TPD
DS40182C-page 28
Note:
RB<7:0>
RB <7:0>
Execute
MOVW
F
PORTB
Q4
Execute
MOVF
PORTB, W
Execute
NOP
PIC16CE62X
6.0
EEPROM PERIPHERAL
OPERATION
SERIAL DATA
SERIAL CLOCK
EEINTF REGISTER
U-0
U-0
U-0
U-0
R/W-1
R/W-1
R/W-1
EESCL
EESDA
EEVDD
bit7
bit0
R = Readable bit
W = Writable bit
U = Unimplemented bit,
read as 0
- n = Value at POR reset
bit 1:
bit 0:
Note:
DS40182C-page 29
PIC16CE62X
6.1
Bus Characteristics
6.1.5
ACKNOWLEDGE
DS40182C-page 30
PIC16CE62X
FIGURE 6-1:
SCL
(A)
(C)
(D)
(C)
(A)
SDA
START
CONDITION
FIGURE 6-2:
STOP
CONDITION
ADDRESS OR
DATA
ACKNOWLEDGE ALLOWED
VALID
TO CHANGE
ACKNOWLEDGE TIMING
Acknowledge
Bit
SCL
SDA
Device Addressing
6.2
FIGURE 6-3:
Device Select
Bits
S
Dont Care
Bits
0
R/W ACK
EEPROM Address
Start Bit
Acknowledge Bit
DS40182C-page 31
PIC16CE62X
6.3
Write Operations
6.4
6.3.1
BYTE WRITE
Acknowledge Polling
FIGURE 6-4:
PAGE WRITE
ACKNOWLEDGE POLLING
FLOW
Send
Write Command
The write control byte, word address and the first data
byte are transmitted to the EEPROM in the same way
as in a byte write. But instead of generating a stop condition, the processor transmits up to eight data bytes to
the EEPROM, which are temporarily stored in the onchip page buffer and will be written into the memory
after the processor has transmitted a stop condition.
After the receipt of each word, the three lower order
address pointer bits are internally incremented by one.
The higher order five bits of the word address remains
constant. If the processor should transmit more than
eight words prior to generating the stop condition, the
address counter will roll over and the previously
received data will be overwritten. As with the byte write
operation, once the stop condition is received, an internal write cycle will begin (Figure 6-6).
Send Stop
Condition to
Initiate Write Cycle
Send Start
Did EEPROM
Acknowledge
(ACK = 0)?
NO
YES
Next
Operation
FIGURE 6-5:
BYTE WRITE
BUS ACTIVITY
PROCESSOR
S
T
A
R
T
SDA LINE
S 1
BUS ACTIVITY
CONTROL
BYTE
0
X X
WORD
ADDRESS
X
S
T
O
P
DATA
0
A
C
K
A
C
K
A
C
K
DS40182C-page 32
PIC16CE62X
FIGURE 6-6:
BUS ACTIVITY
PROCESSOR
SDA LINE
PAGE WRITE
S
T
A
R
T
CONTROL
BYTE
A
C
K
Read Operation
The EEPROM contains an address counter that maintains the address of the last word accessed, internally
incremented by one. Therefore, if the previous access
(either a read or write operation) was to address n, the
next current address read operation would access data
from address n + 1. Upon receipt of the EEPROM
address with R/W bit set to one, the EEPROM issues
an acknowledge and transmits the eight bit data word.
The processor will not acknowledge the transfer, but
does generate a stop condition and the EEPROM discontinues transmission (Figure 6-7).
6.7
S
T
O
P
DATAn + 7
6.6
DATAn + 1
DATAn
BUS ACTIVITY
6.5
WORD
ADDRESS (n)
Random Read
A
C
K
A
C
K
6.8
A
C
K
A
C
K
Sequential Read
Sequential reads are initiated in the same way as a random read except that after the EEPROM transmits the
first data byte, the processor issues an acknowledge as
opposed to a stop condition in a random read. This
directs the EEPROM to transmit the next sequentially
addressed 8-bit word (Figure 6-9).
To provide sequential reads, the EEPROM contains an
internal address pointer which is incremented by one at
the completion of each operation. This address pointer
allows the entire memory contents to be serially read
during one operation.
6.9
Noise Protection
The EEPROM employs a VCC threshold detector circuit, which disables the internal erase/write logic if the
VCC is below 1.5 volts at nominal conditions.
The SCL and SDA inputs have Schmitt trigger and filter
circuits, which suppress noise spikes to assure proper
device operation even on a noisy bus.
DS40182C-page 33
PIC16CE62X
FIGURE 6-7:
BUS ACTIVITY
PROCESSOR
S
T
A
R
T
SDA LINE
CONTROL
BYTE
S
T
O
P
DATAn
P
N
O
A
C
K
BUS ACTIVITY
A
C
K
FIGURE 6-8:
RANDOM READ
S
T
BUS ACTIVITY A
PROCESSOR R
T
CONTROL
BYTE
S
T
A
R
T
WORD
ADDRESS (n)
SDA LINE
CONTROL
BYTE
S
T
O
P
DATAn
S
A
C
K
A
C
K
BUS ACTIVITY
N
O
A
C
K
A
C
K
FIGURE 6-9:
SEQUENTIAL READ
BUS ACTIVITY
PROCESSOR
A
C
K
CONTROL
BYTE
S
T
O
P
A
C
K
A
C
K
SDA LINE
BUS ACTIVITY
P
A
C
K
DATAn
DATAn + 1
DATAn + 2
DATAn + X
N
O
A
C
K
DS40182C-page 34
PIC16CE62X
7.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
7.1
FIGURE 7-1:
Timer0 Interrupt
RA4/T0CKI
pin
FOSC/4
PSout
1
1
Programmable
Prescaler
TMR0
PSout
(2 TCY delay)
T0SE
PS<2:0>
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 7-6)
FIGURE 7-2:
PC
(Program
Counter)
Instruction
Fetch
TMR0
PC
MOVWF TMR0
T0
T0+1
PC+1
PC+2
PC+3
T0+2
PC+4
MOVF TMR0,W
NT0
PC+5
PC+6
MOVF TMR0,W
NT0+1
NT0+2
T0
Instruction
Executed
Write TMR0
executed
Read TMR0
reads NT0
Read TMR0
reads NT0
Read TMR0
reads NT0
Read TMR0
reads NT0 + 1
Read TMR0
reads NT0 + 2
DS40182C-page 35
PIC16CE62X
FIGURE 7-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
Instruction
Fetch
TMR0
PC+1
MOVWF TMR0
MOVF TMR0,W
T0
PC+2
PC+3
T0+1
Instruction
Execute
PC+4
PC+5
MOVF TMR0,W
PC+6
MOVF TMR0,W
NT0+1
NT0
Write TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0 Read TMR0
executed
reads NT0 reads NT0 reads NT0 reads NT0
reads NT0 + 1
FIGURE 7-4:
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
Q1
Q2
Q3
Q4
OSC1
CLKOUT(3)
TMR0 timer
FEh
FFh
1
T0IF bit
(INTCON<2>)
00h
01h
02h
GIE bit
(INTCON<7>)
INSTRUCTION FLOW
PC
PC
Instruction
fetched
Inst (PC)
Instruction
executed
Inst (PC-1)
PC +1
PC +1
Inst (PC+1)
Inst (PC)
0004h
0005h
Inst (0004h)
Dummy cycle
Inst (0005h)
Dummy cycle
Inst (0004h)
DS40182C-page 36
PIC16CE62X
7.2
FIGURE 7-5:
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Small pulse
misses sampling
(1)
External Clock/Prescaler
Output after sampling
(3)
T0
T0 + 1
T0 + 2
Note 1: 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.
2: External clock if no prescaler selected; prescaler output otherwise.
3: The arrows indicate the points in time where sampling occurs.
DS40182C-page 37
PIC16CE62X
7.3
Prescaler
FIGURE 7-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
PS<2:0>
PSA
0
MUX
PSA
WDT
Time-out
Note: T0SE, T0CS, PSA, PS<2:0> are bits in the OPTION register.
DS40182C-page 38
PIC16CE62X
7.3.1
EXAMPLE 7-2:
CHANGING PRESCALER
(WDTTIMER0)
CLRWDT
EXAMPLE 7-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 7-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
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
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
81h
OPTION
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
85h
TRISA
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
DS40182C-page 39
PIC16CE62X
NOTES:
DS40182C-page 40
PIC16CE62X
8.0
COMPARATOR MODULE
REGISTER 8-1:
R-0
C2OUT
bit7
R-0
C1OUT
U-0
U-0
bit 7:
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:
R/W-0
CIS
DS40182C-page 41
PIC16CE62X
8.1
Comparator Configuration
FIGURE 8-1:
RA0/AN0
RA3/AN3
RA1/AN1
RA2/AN2
VIN-
VIN+
VIN-
VIN+
Off
(Read as 0)
C1
Off
(Read as 0)
C2
RA0/AN0
RA3/AN3
RA1/AN1
RA2/AN2
VIN-
VIN+
VIN-
VIN+
C1
C2
Off
(Read as 0)
Off
(Read as 0)
CM<2:0> = 000
Comparators Reset
RA0/AN0
RA3/AN3
RA1/AN1
RA2/AN2
A
A
VINVIN+
VIN-
VIN+
CM<2:0> = 111
Comparators Off
RA0/AN0 A
C1
C1OUT
C2
C2OUT
CIS=0 VIN-
RA3/AN3 A
CIS=1 VIN+
RA1/AN1 A
CIS=0 VIN-
RA2/AN2 A
CIS=1 VIN+
RA0/AN0
RA3/AN3
RA1/AN1
RA2/AN2
VIN-
VIN+
VIN-
VIN+
C1
C1OUT
C2
C2OUT
CM<2:0> = 011
RA1/AN1
VIN-
VIN+
VIN-
RA0/AN0
RA3/AN3
C2
C2OUT
C1OUT
CM<2:0> = 100
Two Independent Comparators
C1
VIN+
RA2/AN2
RA4 Open Drain
CM<2:0> = 010
+
C1
C1OUT
C2
C2OUT
CM<2:0> = 110
VIN-
VIN+
VIN-
VIN+
C1
Off
(Read as 0)
RA0/AN0
RA3/AN3
C2
C2OUT
RA1/AN1
RA2/AN2
CIS=0
VINCIS=1
VIN+
VIN-
VIN+
CM<2:0> = 101
One Independent Comparator
C1
C1OUT
C2
C2OUT
CM<2:0> = 001
PIC16CE62X
The code example in Example 8-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 8-1:
INITIALIZING
COMPARATOR MODULE
BCF
CALL
MOVF
BCF
BSF
BSF
BCF
BSF
BSF
0X20
;Init flag register
;Init PORTA
;Move comparator contents to W
;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
8.2
Comparator Operation
8.3
FIGURE 8-2:
FLAG_REG EQU
CLRF
FLAG_REG
CLRF
PORTA
MOVF
CMCON,W
ANDLW
0xC0
IORWF
FLAG_REG,F
MOVLW
0x03
MOVWF
CMCON
BSF
STATUS,RP0
MOVLW
0x07
MOVWF
TRISA
Comparator Reference
VIN+
VIN
SINGLE COMPARATOR
Output
VIN
VIN
VIN+
VIN+
Output
Output
8.3.1
DS40182C-page 43
PIC16CE62X
8.4
8.5
Comparator Outputs
FIGURE 8-3:
MULTIPLEX
+
To RA3 or
RA4 Pin
Data
Bus
Q
RD CMCON
Set
CMIF
Bit
D
EN
Q
From
Other
Comparator
EN
CL
RD CMCON
NRESET
DS40182C-page 44
PIC16CE62X
8.6
Comparator Interrupts
8.8
8.9
FIGURE 8-4:
8.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
DS40182C-page 45
PIC16CE62X
TABLE 8-1:
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
1Fh
CMCON
C2OUT
C1OUT
CIS
CM2
CM1
CM0
9Fh
VRCON
VREN
VROE
VRR
VR3
VR2
VR1
VR0
0Bh
INTCON
GIE
PEIE
T0IE
INTE
RBIE
T0IF
INTF
RBIF
0Ch
PIR1
CMIF
8Ch
PIE1
CMIE
85h
TRISA
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
DS40182C-page 46
PIC16CE62X
9.0
VOLTAGE REFERENCE
MODULE
9.1
REGISTER 9-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
Unimplemented: Read as 0
FIGURE 9-1:
VREN
8R
8R
VRR
VR3
VREF
(From VRCON<3:0>)
Note:
DS40182C-page 47
PIC16CE62X
EXAMPLE 9-1:
MOVLW
VOLTAGE REFERENCE
CONFIGURATION
0x02
9.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
9.5
9.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
9.2
Effects of a Reset
FIGURE 9-2:
R(1)
VREF
Module
RA2
VREF Output
Voltage
Reference
Output
Impedance
Note 1:
TABLE 9-1:
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
Value On
POR / BOD
Value On
All Other
Resets
VRCON
VREN
VROE
VRR
VR3
VR2
VR1
VR0
000- 0000
000- 0000
1Fh
CMCON
C2OUT
C1OUT
CIS
CM2
CM1
CM0
00-- 0000
00-- 0000
85h
TRISA
TRISA4
TRISA3
TRISA2
TRISA1
TRISA0
---1 1111
---1 1111
Address
Name
9Fh
DS40182C-page 48
PIC16CE62X
10.0
Special circuits to deal with the needs of real time applications are what sets a microcontroller apart from other
processors. The PIC16CE62X 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
DS40182C-page 49
PIC16CE62X
10.1
Configuration Bits
CP0(2)
CP1
CP0(2)
CP1
CP0(2)
BODEN(1) CP1
bit13
F0SC0
bit0
CONFIG
Address
REGISTER: 2007h
Unimplemented: Read as 1
bit 6:
bit 3:
bit 2:
bit 1-0:
Note 1: Enabling Brown-out Reset automatically enables Power-up Timer (PWRT), regardless of the value of bit PWRTE.
Ensure the Power-up Timer is enabled anytime Brown-out Reset is enabled.
2: All of the CP<1:0> pairs have to be given the same value to enable the code protection scheme listed.
DS40182C-page 50
PIC16CE62X
10.2
Oscillator Configurations
10.2.1
OSCILLATOR TYPES
LP
XT
HS
RC
10.2.2
Mode
OSC1
OSC2
455 kHz
2.0 MHz
4.0 MHz
68 - 100 pF
15 - 68 pF
15 - 68 pF
68 - 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 10-2:
Osc Type
LP
Cap. Range
C1
Cap. Range
C2
33 pF
33 pF
15 pF
15 pF
200 kHz
47-68 pF
47-68 pF
1 MHz
XT
32 kHz
200 kHz
15 pF
15 pF
4 MHz
HS
15 pF
15 pF
4 MHz
15 pF
15 pF
8 MHz
15-33 pF
15-33 pF
20 MHz
15-33 pF
15-33 pF
To Internal Logic
RF
SLEEP
OSC2
RS
C2 see Note
1.
2.
3.
C1
Since each resonator/crystal has its own characteristics, the user should consult the resonator/crystal
manufacturer for appropriate values of external components.
4.
PIC16CE62X
Freq
XT
XTAL
CERAMIC RESONATORS,
PIC16CE62X
Ranges Tested:
TABLE 10-1:
OSC1
PIC16CE62X
Open
OSC2
DS40182C-page 51
PIC16CE62X
10.2.3
4.7k
PIC16CE62X
CLKIN
74AS04
RC OSCILLATOR
10k
XTAL
10k
20 pF
10.2.4
20 pF
VDD
PIC16CE62X
Rext
330
To other
Devices
330
74AS04
74AS04
74AS04
OSC1
Internal Clock
PIC16CE62X
CLKIN
0.1 F
Cext
VDD
FOSC/4 OSC2/CLKOUT
XTAL
DS40182C-page 52
PIC16CE62X
10.3
Reset
SLEEP
WDT
Time-out
Reset
VDD rise
detect
Power-on Reset
VDD
Brown-out
Reset
BODEN
OST/PWRT
OST
Chip_Reset
10-bit Ripple-counter
OSC1/
CLKIN
Pin
On-chip(1)
RC OSC
PWRT
10-bit Ripple-counter
Enable PWRT
Enable OST
Note 1: This is a separate oscillator from the RC oscillator of the CLKIN pin.
DS40182C-page 53
PIC16CE62X
10.4
10.4.1
10.4.3
VDD
Internal
Reset
BVDD
72 ms
VDD
Internal
Reset
BVDD
<72 ms
72 ms
VDD
Internal
Reset
DS40182C-page 54
BVDD
72 ms
PIC16CE62X
10.4.5
TIME-OUT SEQUENCE
10.4.6
TABLE 10-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
RC
72 ms
72 ms
TABLE 10-4:
POR
BOR
TO
PD
Power-on-reset
Brown-out Reset
WDT Reset
WDT Wake-up
DS40182C-page 55
PIC16CE62X
TABLE 10-5:
STATUS
Register
PCON
Register
Power-on Reset
000h
0001 1xxx
---- --0x
000h
000u uuuu
---- --uu
000h
0001 0uuu
---- --uu
WDT reset
000h
0000 uuuu
---- --uu
PC + 1
uuu0 0uuu
---- --uu
000h
000x xuuu
---- --u0
uuu1 0uuu
---- --uu
Condition
WDT Wake-up
Brown-out Reset
Interrupt Wake-up from SLEEP
PC + 1
(1)
TABLE 10-6:
Power-on Reset
Register
Address
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
---x xxxx
---u uuuu
---u uuuu
PORTB
06h
xxxx xxxx
uuuu uuuu
uuuu uuuu
CMCON
1Fh
00-- 0000
00-- 0000
uu-- uuuu
PCLATH
0Ah
---0 0000
---0 0000
---u uuuu
INTCON
0Bh
0000 000x
0000 000u
uuuu uqqq(2)
PIR1
0Ch
-0-- ----
-0-- ----
-q-- ----(2,5)
OPTION
81h
1111 1111
1111 1111
uuuu uuuu
TRISA
85h
---1 1111
---1 1111
---u uuuu
TRISB
86h
1111 1111
1111 1111
uuuu uuuu
PIE1
8Ch
-0-- ----
-0-- ----
-u-- ----
PCON
8Eh
---- --0x
---- --uq(1,6)
---- --uu
EEINTF
90h
---- -111
---- -111
---- -111
VRCON
9Fh
000- 0000
000- 0000
uuu- uuuu
xxxx xxxx
uuuu uuuu
uuuu uuuu
Legend: u = unchanged, x = unknown, - = unimplemented bit, reads as 0,q = value depends on condition.
Note 1: If VDD goes too low, Power-on Reset will be activated and registers will be affected differently.
2: One or more bits in INTCON, PIR1 and/or PIR2 will be affected (to cause wake-up).
3: When the wake-up is due to an interrupt and the GIE bit is set, the PC is loaded with the interrupt vector (0004h).
4: See Table 10-5 for reset value for specific condition.
5: If wake-up was due to comparator input changing , then bit 6 = 1. All other interrupts generating a wake-up will cause
bit 6 = u.
6: If reset was due to brown-out, then PCON bit 0 = 0. All other resets will cause bit 0 = u.
DS40182C-page 56
PIC16CE62X
FIGURE 10-8: 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 10-9: 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
DS40182C-page 57
PIC16CE62X
FIGURE 10-11: EXTERNAL POWER-ON
RESET CIRCUIT (FOR SLOW
VDD POWER-UP)
VDD
VDD
VDD
R1
Q1
MCLR
R
R2
R1
40k
PIC16CE62X
MCLR
PIC16CE62X
Note 1:
Note 1:
VDD
VDD
33k
= 0.7 V
R1 + R2
VSS
VDD
bypass
capacitor
VDD
RST
10k
MCLR
40k
Note 1:
PIC16CE62X
PIC16CE62X
DS40182C-page 58
MCLR
PIC16CE62X
10.5
Interrupts
2:
Wake-up
(If in SLEEP mode)
INTF
INTE
RBIF
RBIE
CMIF
CMIE
Interrupt
to CPU
PEIE
GIE
DS40182C-page 59
PIC16CE62X
10.5.1
RB0/INT INTERRUPT
10.5.3
PORTB INTERRUPT
10.5.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
PC
Instruction
fetched
Inst (PC)
Instruction
executed
Inst (PC-1)
PC+1
Inst (PC+1)
Inst (PC)
0004h
PC+1
Dummy Cycle
0005h
Inst (0004h)
Inst (0005h)
Dummy Cycle
Inst (0004h)
DS40182C-page 60
PIC16CE62X
10.6
W_TEMP
SWAPF
STATUS,W
BCF
STATUS,RP0
MOVWF
STATUS_TEMP
:
:
10.7
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 RC 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
have 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 10.1).
10.7.1
:
SWAPF
STATUS_TEMP,W
MOVWF
STATUS
SWAPF
W_TEMP,F
W_TEMP,W
;swap W_TEMP
SWAPF
WDT PERIOD
10.7.2
(ISR)
DS40182C-page 61
PIC16CE62X
FIGURE 10-17: WATCHDOG TIMER BLOCK DIAGRAM
From TMR0 Clock Source
(Figure 7-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, PS<2:0> are bits in the OPTION register.
Name
2007h
Config. bits
81h
OPTION
Bit 7
Bit 6
Bit 5
Bit 4
Bit 3
Bit 2
Bit 1
Bit 0
BOREN
CP1
CP0
PWRTE
WDTE
FOSC1
FOSC0
RBPU
INTEDG
T0CS
T0SE
PSA
PS2
PS1
PS0
Legend:
Note:
DS40182C-page 62
PIC16CE62X
10.8
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:
10.8.1
Q1 Q2 Q3 Q4
Q1
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1 Q2 Q3 Q4
Q1 Q2 Q3
Q4
OSC1
TOST(2)
CLKOUT(4)
INT pin
INTF flag
(INTCON<1>)
Interrupt Latency
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 + 1)
Dummy cycle
0004h
0005h
Inst(0004h)
Inst(PC + 2)
SLEEP
PC + 2
Inst(0005h)
Dummy cycle
Inst(0004h)
DS40182C-page 63
PIC16CE62X
10.9
Code Protection
10.10
ID Locations
10.11
External
Connector
Signals
To Normal
Connections
PIC16CE62X
+5V
VDD
0V
VSS
VPP
MCLR/VPP
CLK
RB6
Data I/O
RB7
VDD
To Normal
Connections
DS40182C-page 64
PIC16CE62X
11.0
TABLE 11-1:
OPCODE FIELD
DESCRIPTIONS
Field
Description
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
Power-down bit
Time-out bit
PD
Options
( )
<>
Contents
13
OPCODE
Assigned to
0
k (literal)
11
OPCODE
10
0
k (literal)
DS40182C-page 65
PIC16CE62X
TABLE 11-2:
Mnemonic,
Operands
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.
DS40182C-page 66
PIC16CE62X
11.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
Before Instruction
W =
FSR =
ANDWF
FSR, 1
Before Instruction
0x17
0xC2
After Instruction
W =
FSR =
Example
W =
FSR =
0x17
0xC2
After Instruction
0xD9
0xC2
W =
FSR =
0x17
0x02
DS40182C-page 67
PIC16CE62X
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:
None
Encoding:
Description:
01
f,b
01bb
bfff
ffff
Words:
Cycles:
Example
BSF
FLAG_REG,
Before Instruction
FLAG_REG = 0x0A
After Instruction
FLAG_REG = 0x8A
DS40182C-page 68
PIC16CE62X
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:
0001
1fff
Words:
Cycles:
Example
CLRF
FLAG_REG
Before Instruction
FLAG_REG
HERE
FALSE
TRUE
ffff
1(2)
Example
00
Description:
Cycles:
Encoding:
0x5A
=
=
0x00
1
After Instruction
BTFSS
GOTO
FLAG_REG
Z
FLAG,1
PROCESS_CODE
Before Instruction
PC =
address HERE
After Instruction
if FLAG<1> = 0,
PC =
address FALSE
if FLAG<1> = 1,
PC =
address TRUE
CLRW
Clear W
CALL
Call Subroutine
Syntax:
[ label ] CLRW
Syntax:
[ label ] CALL k
Operands:
None
Operands:
0 k 2047
Operation:
Operation:
(PC)+ 1 TOS,
k PC<10:0>,
(PCLATH<4:3>) PC<12:11>
00h (W)
1Z
Status Affected:
None
Description:
Words:
Cycles:
Status Affected:
Encoding:
Description:
10
0kkk
kkkk
kkkk
Words:
Example
00
0001
0000
0011
CLRW
Before Instruction
W
0x5A
After Instruction
W
Z
Cycles:
Encoding:
=
=
0x00
1
Example
HERE
CALL
THERE
Before Instruction
PC = Address HERE
After Instruction
PC = Address THERE
TOS = Address HERE+1
DS40182C-page 69
PIC16CE62X
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:
Example
00
0011
dfff
ffff
Description:
Words:
Cycles:
Example
DECF
CNT, 1
Before Instruction
CLRWDT
CNT
Z
Before Instruction
WDT counter =
0x01
0
=
=
0x00
1
After Instruction
CNT
Z
After Instruction
WDT counter =
WDT prescaler=
TO
=
PD
=
=
=
0x00
0
1
1
COMF
Complement f
Syntax:
[ label ] COMF
Operands:
0 f 127
d [0,1]
Operation:
(f) (dest)
Operation:
(f) - 1 (dest);
Status Affected:
Status Affected:
None
Encoding:
00
Syntax:
dfff
ffff
Description:
Words:
Encoding:
Cycles:
Decrement f, Skip if 0
Operands:
1001
DECFSZ
f,d
Example
COMF
dfff
ffff
Words:
Before Instruction
=
0x13
After Instruction
REG1
W
1011
Description:
Cycles:
1(2)
REG1,0
REG1
00
skip if result = 0
=
=
0x13
0xEC
Example
HERE
DECFSZ
GOTO
CONTINUE
CNT, 1
LOOP
Before Instruction
PC
address HERE
After Instruction
CNT
if CNT
PC
if CNT
PC
DS40182C-page 70
=
=
=
CNT - 1
0,
address CONTINUE
0,
address HERE+1
PIC16CE62X
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
GOTO THERE
After Instruction
PC =
dfff
ffff
Cycles:
1(2)
Example
1111
Description:
Cycles:
00
Words:
Words:
Encoding:
INCFSZ f,d
Address THERE
Example
HERE
INCFSZ
GOTO
CONTINUE
CNT,
LOOP
Before Instruction
PC
address HERE
After Instruction
CNT =
if CNT=
PC
=
if CNT
PC
=
INCF
Increment f
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Operation:
(f) + 1 (dest)
Status Affected:
CNT + 1
0,
address CONTINUE
0,
address HERE +1
Encoding:
Syntax:
ffff
Description:
Words:
Cycles:
Example
0 k 255
Operation:
dfff
[ label ]
Operands:
1010
Status Affected:
00
IORLW
INCF f,d
Encoding:
Description:
11
Words:
IORLW
0x35
W
=
=
0xFF
0
=
=
0x9A
0x00
1
After Instruction
CNT
Z
kkkk
Before Instruction
Before Instruction
CNT
Z
kkkk
Example
CNT, 1
1000
Cycles:
INCF
IORLW k
After Instruction
W
Z
=
=
0xBF
1
DS40182C-page 71
PIC16CE62X
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
00
1000
dfff
ffff
Before Instruction
0x13
0x91
Description:
Words:
Cycles:
RESULT, 0
RESULT =
W
=
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
0x5A
OPTION =
W
=
0xFF
0x4F
After Instruction
OPTION =
W
=
DS40182C-page 72
0x4F
0x4F
PIC16CE62X
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 =
OPTION
Syntax:
[ label ]
Operands:
None
Operation:
(W) OPTION
RETLW
Description:
00
0000
0 k 255
Operation:
0010
[ label ]
Operands:
0110
Syntax:
OPTION
TOS
1
k (W);
TOS PC
Status Affected:
None
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
value of k8
DS40182C-page 73
PIC16CE62X
RETURN
Syntax:
[ label ]
Operands:
None
Operation:
None
TOS PC
Status Affected:
RRF
Encoding:
Description:
Syntax:
0000
0000
1000
Words:
Status Affected:
Encoding:
Description:
Cycles:
0 f 127
d [0,1]
Operation:
00
[ label ]
Operands:
RETURN
00
1100
dfff
ffff
Example
RRF f,d
Register f
RETURN
Words:
PC =
TOS
Cycles:
After Interrupt
Example
RRF
REG1,0
Before Instruction
REG1
C
=
=
1110 0110
0
=
=
=
1110 0110
0111 0011
0
After Instruction
REG1
W
C
RLF
Syntax:
[ label ]
Operands:
0 f 127
d [0,1]
Syntax:
[ label ]
Operands:
None
Operation:
Operation:
Status Affected:
00h WDT,
0 WDT prescaler,
1 TO,
0 PD
Status Affected:
TO, PD
Encoding:
Description:
RLF
00
f,d
1101
dfff
ffff
Words:
Encoding:
RLF
0110
0011
Words:
Cycles:
Example:
SLEEP
Register f
REG1,0
Before Instruction
REG1
C
0000
Example
00
SLEEP
Description:
Cycles:
SLEEP
=
=
1110 0110
0
=
=
=
1110 0110
1100 1100
1
After Instruction
REG1
W
C
DS40182C-page 74
PIC16CE62X
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:
=
=
1
?
SUBWF
W
C
=
=
REG1
W
C
1
1; result is positive
=
=
W
C
=
=
REG1
W
C
2
?
After Instruction
Example 2:
0
1; result is zero
=
=
0xFF
0; result is nega-
=
=
=
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
Example 3:
=
=
=
0
2
1; result is zero
Before Instruction
REG1
W
C
=
=
=
1
2
?
After Instruction
REG1
W
C
=
=
=
0xFF
2
0; result is negative
DS40182C-page 75
PIC16CE62X
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:
Words:
Cycles:
11
1010
kkkk
kkkk
Description:
Words:
Cycles:
Example:
XORLW
Encoding:
Description:
XORLW k
00
1110
dfff
ffff
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
DS40182C-page 76
PIC16CE62X
12.0
DEVELOPMENT SUPPORT
12.1
12.2
MPASM Assembler
12.3
DS40182C-page 77
PIC16CE62X
12.4
MPLINK/MPLIB Linker/Librarian
12.5
12.6
DS40182C-page 78
12.7
PICMASTER/PICMASTER CE
12.8
ICEPIC
12.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.
PIC16CE62X
12.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.
12.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.
12.12
SIMICE Entry-Level
Hardware Simulator
12.13
12.14
12.15
DS40182C-page 79
PIC16CE62X
12.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.
12.17
12.18
DS40182C-page 80
Software Tools
Emulators
Programmers Debugger
PIC18CXX2
PIC17C7XX
PIC17C4X
PIC16C9XX
PIC16F8XX
PIC16C8X
PIC16C7XX
PIC16C7X
PIC16F62X
PIC16CXXX
PIC16C6X
MCP2510
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
ICEPIC Low-Cost
In-Circuit Emulator
PICMASTER/PICMASTER-CE
PRO MATE II
Universal Programmer
PICSTARTPlus
Low-Cost Universal Dev. Kit
**
PIC12CXXX
PIC14000
PIC16C5X
MPASM/MPLINK
MPLAB -ICE
TABLE 12-1:
MPLAB Integrated
Development Environment
PIC16CE62X
DS40182C-page 81
PIC16CE62X
NOTES:
DS40182C-page 82
PIC16CE62X
13.0
ELECTRICAL SPECIFICATIONS
DS40182C-page 83
PIC16CE62X
FIGURE 13-1: PIC16CE62X 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.
2: The maximum rated speed of the part limits the permissible combinations of voltage and frequency.
Please reference the Product Identification System section for the maximum rated speed of the parts.
FIGURE 13-2: PIC16CE62X VOLTAGE-FREQUENCY GRAPH, -40C TA < 0C, +70C < TA +125C
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.
2: The maximum rated speed of the part limits the permissible combinations of voltage and frequency.
Please reference the Product Identification System section for the maximum rated speed of the parts.
DS40182C-page 84
PIC16CE62X
FIGURE 13-3: PIC16LCE62X VOLTAGE-FREQUENCY GRAPH, -40C TA < +125C
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.
2: The maximum rated speed of the part limits the permissible combinations of voltage and frequency.
Please reference the Product Identification System section for the maximum rated speed of the parts.
DS40182C-page 85
PIC16CE62X
13.1
DC CHARACTERISTICS:
DC CHARACTERISTICS
Param
No.
Sym
Characteristic
Min
Conditions
D001
VDD
Supply Voltage
3.0
5.5
D002
VDR
1.5*
D003
VPOR
VSS
D004
SVDD
0.05*
D005
VBOR
3.7
4.0
4.35
D010
IDD
1.2
2.0
mA
0.4
1.2
mA
1.0
2.0
mA
4.0
6.0
mA
4.0
7.0
mA
35
70
D020
IPD
2.2
5.0
9.0
15
A
A
A
A
VDD = 3.0V
VDD = 4.5V*
VDD = 5.5V
VDD = 5.5V Extended
D022
IWDT
6.0
75
30
10
12
125
60
A
A
A
A
VDD = 4.0V
(125C)
BOD enabled, VDD = 5.0V
VDD = 4.0V
80
135
VDD = 4.0V
IEE Write
IEE Read
IEE
IEE
Operating Current
Operating Current
Standby Current
Standby Current
3
1
30
100
mA
mA
A
A
FOSC
0
0
0
0
200
4
4
20
kHz
MHz
MHz
MHz
All temperatures
All temperatures
All temperatures
All temperatures
D022A IBOR
ICOMP
D023
D023A IVREF
1A
Note 1:
2:
3:
4:
5:
6:
DS40182C-page 86
PIC16CE62X
13.2
DC CHARACTERISTICS:
DC CHARACTERISTICS
Param
No.
Sym
Characteristic
Min
Typ
Max
Units
Conditions
D001
VDD
Supply Voltage
2.5
5.5
D002
VDR
1.5*
D003
VPOR
VSS
D004
SVDD
.05*
V/ms
D005
VBOR
3.7
4.0
4.35
D010
IDD
1.2
2.0
mA
1.1
mA
35
70
2.0
2.2
9.0
15
A
A
A
A
VDD = 2.5V
VDD = 3.0V*
VDD = 5.5V
VDD = 5.5V Extended
A
A
A
VDD=4.0V
(125C)
BOD enabled, VDD = 5.0V
VDD = 4.0V
D020
IPD
D022
IWDT
6.0
D022A
IBOR
75
D023
ICOMP
10
12
125
30
60
80
135
VDD = 4.0V
3
1
30
100
mA
mA
A
A
200
4
4
20
kHz
MHz
MHz
MHz
All temperatures
All temperatures
All temperatures
All temperatures
D023A
IVREF
IEE Write
IEE Read
IEE
IEE
Note 1:
2:
3:
4:
5:
6:
FOSC
1A
Operating Current
Operating Current
Standby Current
Standby Current
LP Oscillator Operating Frequency
RC Oscillator Operating Frequency
XT Oscillator Operating Frequency
HS Oscillator Operating Frequency
0
0
0
0
DS40182C-page 87
PIC16CE62X
13.3
DC CHARACTERISTICS:
DC CHARACTERISTICS
Parm
No.
Sym
VIL
D030
D031
D032
D033
VIH
D040
D041
D042
D043
D043A
D070
IPURB
IIL
D060
D061
D063
Characteristic
Input Low Voltage
I/O ports
with TTL buffer
with Schmitt Trigger input
MCLR, RA4/T0CKI,OSC1 (in RC
mode)
OSC1 (in XT and HS)
OSC1 (in LP)
Input High Voltage
I/O ports
with TTL buffer
with Schmitt Trigger input
MCLR RA4/T0CKI
OSC1 (XT, HS and LP)
OSC1 (in RC mode)
PORTB weak pull-up current
Input Leakage Current
(Notes 2, 3)
I/O ports (Except PORTA)
PORTA
RA4/T0CKI
OSC1, MCLR
D080
D083
VOL
D090
D092
VOH
*D150
D100
D101
Typ
Max
Unit
Conditions
VSS
VSS
VSS
0.8V
0.15VDD
0.2VDD
0.2VDD
V
V
Note1
VSS
VSS
0.3VDD
0.6VDD - 1.0
V
V
2.0V
.25VDD + 0.8V
0.8VDD
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
V
V
-40 to +85C
+125C
-40 to +85C
+125C
-40 to +85C
+125C
-40 to +85C
+125C
Data in Typ column is at 5.0V, 25C unless otherwise stated. These parameters are for design guidance only and are
not tested.
Note 1: In RC oscillator configuration, the OSC1 pin is a Schmitt Trigger input. It is not recommended that the PIC16CE62X be
driven with external clock in RC mode.
2: The leakage current on the MCLR pin is strongly dependent on applied voltage level. The specified levels represent
normal operating conditions. Higher leakage current may be measured at different input voltages.
3: Negative current is defined as coming out of the pin.
VOD
DS40182C-page 88
PIC16CE62X
TABLE 13-1:
COMPARATOR SPECIFICATIONS
Characteristics
Sym
Min
Typ
Max
Units
10
mV
VDD - 1.5
5.0
D300
VIOFF
D301
VICM
D302
CMRR
CMRR
300
Response Time(1)
TRESP
301
TMC2OV
0
+55*
Comments
db
150*
400*
ns
10*
PIC16CE62X
TABLE 13-2:
Characteristics
Sym
D310
Resolution
VRES
D311
Absolute Accuracy
Unit Resistor Value (R)
VRUR
Time(1)
TSET
Typ
310
Settling
Units
LSB
+1/4
+1/2
VDD/24
Max
VDD/32
VRAA
D312
Min
LSB
LSB
2K*
10*
Comments
DS40182C-page 89
PIC16CE62X
13.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
VSS
CL
Pin
VSS
RL = 464
CL = 50 pF
15 pF
DS40182C-page 90
PIC16CE62X
13.5
Q1
Q3
Q2
Q4
Q1
OSC1
1
2
CLKOUT
TABLE 13-3:
Parameter
No.
Sym
Characteristic
Min
1A
Fosc
DC
MHz
DC
20
MHz
HS osc mode
DC
200
kHz
LP osc mode
DC
MHz
0.1
MHz
XT osc mode
Oscillator Frequency
(Note 1)
Typ
Max
Units Conditions
Oscillator Period
(Note 1)
HS osc mode
kHz
LP osc mode
250
ns
50
ns
HS osc mode
LP osc mode
250
ns
RC osc mode
250
10,000
ns
XT osc mode
1,000
ns
HS osc mode
MHz
200
50
Tosc
20
DC
LP osc mode
TCY
200
DC
ns
TCY=FOSC/4
3*
TosL,
TosH
100*
ns
Note 1:
TosR,
TosF
ns
25*
ns
XT oscillator
50*
ns
LP oscillator
15*
4*
2*
20*
ns
HS oscillator
DS40182C-page 91
PIC16CE62X
FIGURE 13-6: CLKOUT AND I/O TIMING
Q1
Q4
Q2
Q3
OSC1
11
10
22
23
CLKOUT
13
19
14
12
18
16
I/O Pin
(input)
15
17
I/O Pin
(output)
new value
old value
20, 21
Note: All tests must be do with specified capacitance loads (Figure 13-4) 50 pF on I/O pins and CLKOUT
TABLE 13-4:
Parameter #
Characteristic
Min
10*
TosH2ckL
11*
TosH2ckH
12*
TckR
13*
TckF
14*
TckL2ioV
15*
TioV2ckH
OSC1 to CLKOUT
75
200
ns
75
200
ns
35
100
ns
35
100
ns
(1)
Units
(1)
Max
(1)
Typ
20
ns
Tosc +200 ns
ns
16*
TckH2ioI
17*
TosH2ioV
18*
TosH2ioI
19*
TioV2osH
20*
TioR
10
40
ns
21*
TioF
10
40
ns
(1)
22*
Tinp
23
Trbp
ns
50
150
ns
100
ns
ns
25
ns
TCY
ns
DS40182C-page 92
PIC16CE62X
FIGURE 13-7: 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 13-5:
Parameter
No.
Sym
Characteristic
Min
30
31
TmcL
2000
ns
-40 to +85C
Twdt
7*
18
33*
ms
1024 TOSC
28*
72
132*
ms
2.0
32
Tost
33
Tpwrt
34
*
TIOZ
35
TBOR
100*
Typ
Max
Units
Conditions
DS40182C-page 93
PIC16CE62X
FIGURE 13-9: TIMER0 CLOCK TIMING
RA4/T0CKI
41
40
42
TMR0
TABLE 13-6:
Parameter
No.
40
Sym Characteristic
Tt0H T0CKI High Pulse Width
Min
No Prescaler
With Prescaler
41
No Prescaler
With Prescaler
42
*
Typ
Max
Units Conditions
ns
10*
ns
ns
10*
ns
TCY + 40*
N
ns
N = prescale value
(1, 2, 4, ..., 256)
DS40182C-page 94
PIC16CE62X
13.6
EEPROM Timing
TF
THIGH
TLOW
SCL
TSU:STA
THD:DAT
TSU:DAT
TSU:STO
THD:STA
SDA
IN
TSP
TAA
THD:STA
TAA
TBUF
SDA
OUT
TABLE 13-7:
AC CHARACTERISTICS
Parameter
Symbol
STANDARD
MODE
Min.
Max.
Min.
Units
Remarks
Max.
Clock frequency
Clock high time
Clock low time
SDA and SCL rise time
SDA and SCL fall time
START condition hold time
FCLK
THIGH
TLOW
TR
TF
THD:STA
4000
4700
4000
100
1000
300
600
1300
600
400
300
300
kHz
ns
ns
ns
ns
ns
TSU:STA
4700
600
ns
THD:DAT
TSU:DAT
TSU:STO
TAA
TBUF
0
250
4000
4700
3500
0
100
600
1300
900
ns
ns
ns
ns
ns
TOF
250
250
ns
TSP
50
20 + 0.1
CB
(Note 2)
Time the bus must be free
before a new transmission
can start
(Note 1), CB 100 pF
50
ns
(Note 3)
TWR
10M
1M
10
10M
1M
10
ms
(Note 1)
(Note 1)
After this period the first
clock pulse is generated
Only relevant for repeated
START condition
(Note 2)
Note 1: Not 100% tested. CB = total capacitance of one bus line in pF.
2: As a transmitter, the device must provide an internal minimum delay time to bridge the undefined region (minimum 300 ns)
of the falling edge of SCL to avoid unintended generation of START or STOP conditions.
3: The combined TSP and VHYS specifications are due to new Schmitt trigger inputs which provide improved noise spike suppression. This eliminates the need for a TI specification for standard operation.
4: This parameter is not tested but guaranteed by characterization. For endurance estimates in a specific application, please
consult the Total Endurance Model which can be obtained on our website.
DS40182C-page 95
PIC16CE62X
NOTES:
DS40182C-page 96
PIC16CE62X
14.0
PACKAGING INFORMATION
18-Lead Ceramic Dual In-line with Window (JW) 300 mil (CERDIP)
E1
W2
2
n
1
W1
E
A2
A
c
L
A1
eB
B1
p
B
Units
Dimension Limits
n
p
Number of Pins
Pitch
Top to Seating Plane
Ceramic Package Height
Standoff
Shoulder to Shoulder Width
Ceramic Pkg. Width
Overall Length
Tip to Seating Plane
Lead Thickness
Upper Lead Width
Lower Lead Width
Overall Row Spacing
Window Width
Window Length
*Controlling Parameter
JEDEC Equivalent: MO-036
Drawing No. C04-010
A
A2
A1
E
E1
D
L
c
B1
B
eB
W1
W2
MIN
.170
.155
.015
.300
.285
.880
.125
.008
.050
.016
.345
.130
.190
INCHES*
NOM
18
.100
.183
.160
.023
.313
.290
.900
.138
.010
.055
.019
.385
.140
.200
MAX
.195
.165
.030
.325
.295
.920
.150
.012
.060
.021
.425
.150
.210
MILLIMETERS
NOM
18
2.54
4.32
4.64
3.94
4.06
0.38
0.57
7.62
7.94
7.24
7.37
22.35
22.86
3.18
3.49
0.20
0.25
1.27
1.40
0.41
0.47
8.76
9.78
3.30
3.56
4.83
5.08
MIN
MAX
4.95
4.19
0.76
8.26
7.49
23.37
3.81
0.30
1.52
0.53
10.80
3.81
5.33
DS40182C-page 97
PIC16CE62X
18-Lead Plastic Dual In-line (P) 300 mil (PDIP)
E1
2
n
A2
A
L
c
A1
B1
B
eB
Units
Dimension Limits
n
p
MIN
INCHES*
NOM
18
.100
.155
.130
MAX
MILLIMETERS
NOM
18
2.54
3.56
3.94
2.92
3.30
0.38
7.62
7.94
6.10
6.35
22.61
22.80
3.18
3.30
0.20
0.29
1.14
1.46
0.36
0.46
7.87
9.40
5
10
5
10
MIN
Number of Pins
Pitch
Top to Seating Plane
A
.140
.170
Molded Package Thickness
.115
.145
A2
Base to Seating Plane
A1
.015
Shoulder to Shoulder Width
E
.300
.313
.325
Molded Package Width
E1
.240
.250
.260
Overall Length
D
.890
.898
.905
Tip to Seating Plane
L
.125
.130
.135
c
Lead Thickness
.008
.012
.015
Upper Lead Width
B1
.045
.058
.070
Lower Lead Width
B
.014
.018
.022
eB
Overall Row Spacing
.310
.370
.430
DS40182C-page 98
MAX
4.32
3.68
8.26
6.60
22.99
3.43
0.38
1.78
0.56
10.92
15
15
PIC16CE62X
20-Lead Plastic Shrink Small Outline (SS) 209 mil, 5.30 mm (SSOP)
E
E1
p
2
1
A2
A1
Units
Dimension Limits
n
p
Number of Pins
Pitch
Overall Height
Molded Package Thickness
Standoff
Overall Width
Molded Package Width
Overall Length
Foot Length
Lead Thickness
Foot Angle
Lead Width
Mold Draft Angle Top
Mold Draft Angle Bottom
A
A2
A1
E
E1
D
L
c
MIN
.068
.064
.002
.299
.201
.278
.022
.004
0
.010
0
0
INCHES*
NOM
20
.026
.073
.068
.006
.309
.207
.284
.030
.007
4
.013
5
5
MAX
.078
.072
.010
.322
.212
.289
.037
.010
8
.015
10
10
MILLIMETERS
NOM
20
0.66
1.73
1.85
1.63
1.73
0.05
0.15
7.59
7.85
5.11
5.25
7.06
7.20
0.56
0.75
0.10
0.18
0.00
101.60
0.25
0.32
0
5
0
5
MIN
MAX
1.98
1.83
0.25
8.18
5.38
7.34
0.94
0.25
203.20
0.38
10
10
*Controlling Parameter
Notes:
Dimensions D and E1 do not include mold flash or protrusions. Mold flash or protrusions shall not exceed
.010 (0.254mm) per side.
JEDEC Equivalent: MO-150
Drawing No. C04-072
DS40182C-page 99
PIC16CE62X
18-Lead Plastic Small Outline (SO) Wide, 300 mil (SOIC)
E
p
E1
2
B
45
c
A2
Units
Dimension Limits
n
p
MIN
A1
INCHES*
NOM
18
.050
.099
.091
.008
.407
.295
.454
.020
.033
4
.011
.017
12
12
MAX
MILLIMETERS
NOM
18
1.27
2.36
2.50
2.24
2.31
0.10
0.20
10.01
10.34
7.39
7.49
11.33
11.53
0.25
0.50
0.41
0.84
0
4
0.23
0.27
0.36
0.42
0
12
0
12
MIN
Number of Pins
Pitch
Overall Height
A
.093
.104
Molded Package Thickness
A2
.088
.094
Standoff
A1
.004
.012
Overall Width
E
.394
.420
Molded Package Width
E1
.291
.299
Overall Length
D
.446
.462
Chamfer Distance
h
.010
.029
Foot Length
L
.016
.050
Foot Angle
0
8
c
Lead Thickness
.009
.012
Lead Width
B
.014
.020
DS40182C-page 100
MAX
2.64
2.39
0.30
10.67
7.59
11.73
0.74
1.27
8
0.30
0.51
15
15
PIC16CE62X
14.1
Example
XXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXX
AABBCDE
18-Lead SOIC (.300")
XXXXXXXXXXXX
XXXXXXXXXXXX
XXXXXXXXXXXX
AABBCDE
PIC16CE625
-04I/P423
9907CDK
Example
PIC16CE625
-04I/SO218
9907CDK
Example
XXXXXXXX
XXXXXXXX
AABBCDE
20-Lead SSOP
XXXXXXXXXX
XXXXXXXXXX
AABBCDE
Legend: MM...M
XX...X
AA
BB
C
D
E
Note:
16CE625
/JW
9907CBA
Example
PIC16CE625
-04I/218
9907CBP
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.
DS40182C-page 101
PIC16CE62X
NOTES:
DS40182C-page 102
PIC16CE62X
APPENDIX A: CODE FOR
ACCESSING EEPROM
DATA MEMORY
Please check our web site at www.microchip.com for
code availability.
DS40182C-page 103
PIC16CE62X
NOTES:
DS40182C-page 104
PIC16CE62X
INDEX
A
BTFSC........................................................................ 68
BTFSS ........................................................................ 69
CALL........................................................................... 69
CLRF .......................................................................... 69
CLRW ......................................................................... 69
CLRWDT .................................................................... 70
COMF ......................................................................... 70
DECF.......................................................................... 70
DECFSZ ..................................................................... 70
GOTO ......................................................................... 71
INCF ........................................................................... 71
INCFSZ....................................................................... 71
IORLW ........................................................................ 71
IORWF........................................................................ 72
MOVF ......................................................................... 72
MOVLW ...................................................................... 72
MOVWF...................................................................... 72
NOP............................................................................ 73
OPTION...................................................................... 73
RETFIE....................................................................... 73
RETLW ....................................................................... 73
RETURN..................................................................... 74
RLF............................................................................. 74
RRF ............................................................................ 74
SLEEP ........................................................................ 74
SUBLW....................................................................... 75
SUBWF....................................................................... 75
SWAPF....................................................................... 76
TRIS ........................................................................... 76
XORLW ...................................................................... 76
XORWF ...................................................................... 76
Instruction Set Summary .................................................... 65
INT Interrupt ....................................................................... 60
INTCON Register................................................................ 17
Interrupts ............................................................................ 59
IORLW Instruction .............................................................. 71
IORWF Instruction .............................................................. 72
B
BCF Instruction ................................................................... 68
Block Diagram
TIMER0....................................................................... 35
TMR0/WDT PRESCALER .......................................... 38
Brown-Out Detect (BOD) .................................................... 54
BSF Instruction ................................................................... 68
BTFSC Instruction............................................................... 68
BTFSS Instruction ............................................................... 69
E
EEPROM Peripheral Operation .......................................... 29
Errata .................................................................................... 2
External Crystal Oscillator Circuit ....................................... 52
G
General purpose Register File ............................................ 12
GOTO Instruction ................................................................ 71
I
I/O Ports .............................................................................. 23
I/O Programming Considerations........................................ 28
ID Locations ........................................................................ 64
INCF Instruction .................................................................. 71
INCFSZ Instruction ............................................................. 71
In-Circuit Serial Programming ............................................. 64
Indirect Addressing, INDF and FSR Registers ................... 21
Instruction Flow/Pipelining .................................................. 10
Instruction Set
ADDLW ....................................................................... 67
ADDWF....................................................................... 67
ANDLW ....................................................................... 67
ANDWF....................................................................... 67
BCF............................................................................. 68
BSF ............................................................................. 68
M
MOVF Instruction................................................................ 72
MOVLW Instruction............................................................. 72
MOVWF Instruction ............................................................ 72
MPLAB Integrated Development Environment Software.... 77
N
NOP Instruction .................................................................. 73
O
One-Time-Programmable (OTP) Devices ............................ 5
OPTION Instruction ............................................................ 73
OPTION Register................................................................ 16
Oscillator Configurations..................................................... 51
Oscillator Start-up Timer (OST) .......................................... 54
P
Package Marking Information ........................................... 101
Packaging Information ........................................................ 97
PCL and PCLATH............................................................... 20
PCON Register ................................................................... 19
PICDEM-1 Low-Cost PICmicro Demo Board ..................... 79
PICDEM-2 Low-Cost PIC16CXX Demo Board................... 79
PICDEM-3 Low-Cost PIC16CXXX Demo Board ................ 79
PICSTART Plus Entry Level Development System ......... 79
PIE1 Register ..................................................................... 18
Pinout Description................................................................. 9
PIR1 Register ..................................................................... 18
DS40182C-page 105
PIC16CE62X
Port RB Interrupt ................................................................. 60
PORTA................................................................................ 23
PORTB................................................................................ 26
Power Control/Status Register (PCON) .............................. 55
Power-Down Mode (SLEEP)............................................... 63
Power-On Reset (POR) ...................................................... 54
Power-up Timer (PWRT)..................................................... 54
Prescaler ............................................................................. 38
PRO MATE II Universal Programmer............................... 79
Program Memory Organization ........................................... 11
Q
Quick-Turnaround-Production (QTP) Devices ...................... 5
R
RC Oscillator ....................................................................... 52
Reset................................................................................... 53
RETFIE Instruction.............................................................. 73
RETLW Instruction .............................................................. 73
RETURN Instruction............................................................ 74
RLF Instruction.................................................................... 74
RRF Instruction ................................................................... 74
S
SEEVAL Evaluation and Programming System ............... 80
Serialized Quick-Turnaround-Production (SQTP) Devices ... 5
SLEEP Instruction ............................................................... 74
Software Simulator (MPLAB-SIM)....................................... 78
Special Features of the CPU............................................... 49
Special Function Registers ................................................. 14
Stack ................................................................................... 20
Status Register.................................................................... 15
SUBLW Instruction.............................................................. 75
SUBWF Instruction.............................................................. 75
SWAPF Instruction.............................................................. 76
T
Timer0
TIMER0 ....................................................................... 35
TIMER0 (TMR0) Interrupt ........................................... 35
TIMER0 (TMR0) Module ............................................. 35
TMR0 with External Clock........................................... 37
Timer1
Switching Prescaler Assignment................................. 39
Timing Diagrams and Specifications................................... 91
TMR0 Interrupt .................................................................... 60
TRIS Instruction .................................................................. 76
TRISA.................................................................................. 23
TRISB.................................................................................. 26
V
Voltage Reference Module.................................................. 47
VRCON Register................................................................. 47
W
Watchdog Timer (WDT) ...................................................... 61
WWW, On-Line Support........................................................ 2
X
XORLW Instruction ............................................................. 76
XORWF Instruction ............................................................. 76
DS40182C-page 106
PIC16CE62X
ON-LINE SUPPORT
Microchip provides on-line support on the Microchip
World Wide Web (WWW) site.
The web site is used by Microchip as a means to make
files and information easily available to customers. To
view the site, the user must have access to the Internet
and a web browser, such as Netscape or Microsoft
Explorer. Files are also available for FTP download
from our FTP site.
DS40182C-page 107
PIC16CE62X
READER RESPONSE
It is our intention to provide you with the best documentation possible to ensure successful use of your Microchip product. If you wish to provide your comments on organization, clarity, subject matter, and ways in which our documentation
can better serve you, please FAX your comments to the Technical Publications Manager at (480) 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: PIC16CE62X
N
Literature Number: DS40182C
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?
DS40182C-page 108
PIC16CE62X
PIC16CE62X 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
JW*
=
=
=
=
PDIP
SOIC (Gull Wing, 300 mil body)
SSOP (209 mil)
Examples:
Windowed CERDIP
Temperature
Range:
I
E
=
=
=
0C to +70C
40C to +85C
40C to +125C
Frequency
Range:
04
04
20
=
=
=
Device:
a) PIC16CE623-04/P301 =
Commercial temp., PDIP package, 4 MHz, normal VDD limits,
QTP pattern #301.
b) PIC16CE623-04I/SO =
Industrial temp., SOIC package, 4MHz, industrial VDD limits.
* JW Devices are UV erasable and can be programmed to any device configuration. JW Devices meet the electrical requirement of
each oscillator type.
Please specify which device, revision of silicon and Data Sheet (include Literature #) you are using.
New Customer Notification System
Register on our web site (www.microchip.com/cn) to receive the most current information on our products.
DS40182C-page 109
PIC16CE62X
NOTES:
DS40182C-page 110
PIC16CE62X
NOTES:
DS40182C-page 111
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