English
Language : 

PIC16F882_09 Datasheet, PDF (229/328 Pages) Microchip Technology – 28/40/44-Pin, Enhanced Flash-Based 8-Bit CMOS Microcontrollers with nanoWatt Technology
PIC16F882/883/884/886/887
FIGURE 14-10: WAKE-UP FROM SLEEP THROUGH INTERRUPT
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1
OSC1
CLKOUT(4)
Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4 Q1 Q2 Q3 Q4
TOST(2)
INT pin
INTF flag
(INTCON<1>)
Interrupt Latency(3)
GIE bit
(INTCON<7>)
Processor in
Sleep
Instruction Flow
PC
PC
Instruction
Fetched
Inst(PC) = Sleep
Instruction
Executed
Inst(PC – 1)
PC + 1
Inst(PC + 1)
Sleep
PC + 2
PC + 2
Inst(PC + 2)
Inst(PC + 1)
PC + 2
Dummy Cycle
0004h
Inst(0004h)
Dummy Cycle
0005h
Inst(0005h)
Inst(0004h)
Note 1:
2:
3:
4:
XT, HS or LP Oscillator mode assumed.
TOST = 1024 TOSC (drawing not to scale). This delay does not apply to EC and RC Oscillator modes.
GIE = 1 assumed. In this case after wake-up, the processor jumps to 0004h. If GIE = 0, execution will continue in-line.
CLKOUT is not available in XT, HS, LP or EC Oscillator modes, but shown here for timing reference.
14.7 Code Protection
If the code protection bit(s) have not been
programmed, the on-chip program memory can be
read out using ICSP™ for verification purposes.
Note:
The entire data EEPROM and Flash
program memory will be erased when the
code protection is switched from on to off.
See the “PIC16F88X Memory Programming
Specification” (DS41287) for more
information.
14.8 ID Locations
Four memory locations (2000h-2003h) are designated
as ID locations where the user can store checksum or
other code identification numbers. These locations are
not accessible during normal execution but are readable
and writable during Program/Verify mode. Only the
Least Significant 7 bits of the ID locations are used.
14.9 In-Circuit Serial Programming™
The PIC16F882/883/884/886/887 microcontrollers can
be serially programmed while in the end application cir-
cuit. This is simply done with two lines for clock and
data and three other lines for:
• power
• ground
• programming voltage
This allows customers to manufacture boards with
unprogrammed devices and then program the micro-
controller just before shipping the product. This also
allows the most recent firmware or a custom firmware
to be programmed.
© 2009 Microchip Technology Inc.
The device is placed into a Program/Verify mode by
holding the RB6/ICSPCLK and RB7/ICSPDAT pins low,
while raising the MCLR (VPP) pin from VIL to VIHH. See
the “PIC16F88X Memory Programming Specification”
(DS41287) for more information. RB7 becomes the
programming data and RB6 becomes the programming
clock. Both RB7 and RB6 are Schmitt Trigger inputs in
this mode.
After Reset, to place the device into Program/Verify
mode, the Program Counter (PC) is at location 00h. A
6-bit command is then supplied to the device.
Depending on the command, 14 bits of program data
are then supplied to or from the device, depending on
whether the command was a Load or a Read. For
complete details of serial programming, please refer to
the “PIC16F88X Memory Programming Specification”
(DS41287).
A typical In-Circuit Serial Programming connection is
shown in Figure 14-11.
DS41291F-page 227