
PIC16F87XA
DS39589C-page 6 Advance Information 2010 Microchip Technology Inc.
2.4.2.1 Load Configuration
After receiving this command, the program counter
(PC) will be s et to 2000h. By the n applying 16 c ycles to
the cloc k p in, t he chip will loa d 14 bits in a “da t a w o rd,”
as described above, to be programmed into the config-
uration memory. A description of the memory mapping
schemes of the program memory for normal operation
and configuration mode operation is shown in
Figure 2-1. After the configuration memory is entered,
the only way to get back to the user program memory
is to ex it the Program/V e rify Test m ode by ta king MCLR
low ( VIL).
2.4.2.2 Load Data for Program Memory
After receiving this command, the chip will load one
word (with 14 bits as a “data word”) to be programmed
into use r program m emory when 16 cycl es are app lied.
A timing diagram for this command is shown in
Figure 6-1.
2.4.2.3 Load Data for Data Memory
After receiving this command, the chip will load in a
14-bit “data word” when 16 cycles are applied.
However, the data memory is only 8-bits wide, and
thus, onl y the first 8 bit s of dat a after the Start bit will be
prog ram me d i nt o the da ta m em ory. It is stil l ne ce ss ary
to cycl e the clo ck the fu ll 16 cy cles in order to al low the
internal circuitry to reset properly. The data memory
contains up to 256 bytes. If the device is
code-protected, the data is read as all zeros. A timing
diagram for this command is shown in Figure 6-2.
2.4.2.4 Read Data from Program Memory
After receiving this command, the chip will transmit
data bi ts out o f the pr ogram memor y (use r or co nfigu -
ration) currently ac ce ss ed , s t art ing w i th the s ec ond ri s-
ing edge of the clock input. The RB7 pin will go into
Output mode on the second rising clock edge, and it
will revert back to Input mode (high-impedance) after
the 16th ris ing edge. A timing dia gram of this comman d
is shown in Figure 6-3.
2.4.2.5 Read Data from Data Memory
After receiving this command, the chip will transmit
data bits out of the data memory, starting with the sec-
ond rising edge of the clock input. The RB7 pin will go
into Outp ut mod e on the sec ond risin g edg e, and it will
revert back to Input mode (high-impedance) after the
16th rising edge. As previously stated, the data mem-
ory i s 8-bits wide, a nd therefore , only th e first 8 b its th at
are output are actual data. A timing diagram for this
command is shown in Figure 6-4.
2.4.2.6 Increment Address
The PC is incremented when this command is
received. A timing diagram of this command is shown
in Figure 6-5.
2.4.2.7 Begin Erase/Program Cycle
Eight locations must be loaded before every
‘Begin Erase/Programming’ command. After this
command is received and decoded, eight words of
program memory will be erased and programmed with
the values contained in the program data latches. The
PC address will decode which eight words are pro-
grammed. The lower three bits of the PC are ignored,
so if the PC points to address 003h, then all eight
locations from 000h to 007h are written.
An internal timing mechanism executes an erase
before write. The user must allow the combined time
for erase and programming, as specified in the electri-
cal specs, for programming to complete. No ‘End
Programming’ command is required.
1. If the address is pointing to user memory, the
user memory alone will be affected.
2. If the address is pointing to the physic ally imple-
mented test memory (2000h - 201Fh), test mem-
ory will be written. The configuration word will not
be written unless the address is specifically
pointi ng to 2007h.
This command can be used to perform programming
over the entire VDD range of the device.
A timing diagram for this command is shown in
Figure 6-6.
2.4.2.8 Begin Programming Only
This command is similar to the ‘Erase/Programming
Cycle’ command, except that a word erase is not
done, and the internal timer is not used. Programming
of pro gram an d data memo ry wil l begi n after this com-
mand is received and decoded. The user must allow
the time for programming, as specified in the electrical
specs, for programming to complete. An ‘End
Programming’ command is required.
The intern al ti mer is not used for thi s c omma nd, so the
‘End Programming’ command must be used to stop
programming.
1. If the address is pointing to user memory, the
user memory alone will be affected.
2. If the add ress i s poin ting to the phy sically impl e-
mented test memory (2000h - 201Fh), the test
memory will be written. The configuration word
will not be written unless the address is
specifically pointing to 2007h.
A timing diagram for this command is shown in
Figure 6-7.
Note 1: The code-protect bits cannot be erased
with this command.
2: All Begin Erase/Programming operations
can take place over the entire VDD range.
Note: Begin Programming Only operations must
take place at the 4.5V to 5.5V VDD range.