Datasheet

© 2007 Microchip Technology Inc. Preliminary DS41208C-page 3
PIC16F57
2.4.1 FOUR-WORD PROGRAMMING
The normal sequence for writing the program array is
to load four words to sequential addresses, then issue
a Begin Programming command. The PC must be
advanced following the first three loads, but not
advanced following the last program load until after the
programming cycle. The programming cycle is started
and timed externally. Then, the PC is advanced after
the programming cycle. The cycle repeats to program
the array. After writing the array, the PC may be reset
and read back to verify the write. It is not possible to
verify immediately following the write because the PC
can only increment, not decrement. See Figure 2-10.
It is important that the PC is not advanced after the 4th
word is loaded as the programming cycle writes the row
selected by the PC <11:2>. If the PC is advanced, the
data will be written to the next row.
2.4.2 ONE-WORD PROGRAMMING
Configuration memory must be written one word at a
time. The one-word sequence loads a word, programs,
verifies, and finally increments the PC. See Figure 2-9.
A device Reset will clear the PC and set the address to
0xFFF. The Increment Address command will
increment the PC. The available commands are shown
in Table 2-1.
FIGURE 2-2: ENTERING HIGH
VOLTAGE PROGRAM/
VERIFY MODE
2.4.3 SERIAL PROGRAM/VERIFY
OPERATION
The ICSPCLK pin is used for clock input and the
ICSPDAT pin is used for data input/output during serial
operation. To input a command, the clock pin is cycled
six times. Each command bit is latched on the falling
edge of the clock with the LSb of the command being
input first. The data must adhere to the setup (T
SET1)
and hold (T
HLD1) times with respect to the falling edge
of the clock (see Table 5-1).
Commands that do not have data associated with them
are required to wait a minimum of T
DLY2 measured
from the falling edge of the last command clock to the
rising edge of the next command clock (see Table 5-1).
Commands that do have data associated with them
(Read and Load) are also required to wait TDLY2
between the command and the data segment
measured from the falling edge of the last command
clock to the rising edge of the first data clock. The data
segment, consisting of 16 clock cycles, can begin after
this delay.
The first and last clock pulses during the data segment
correspond to the Start and Stop bits, respectively.
Input data is a “don't care” during the Start and Stop
cycles. The 14 clock pulses between the Start and Stop
cycles clock the 14 bits of input/output data. Data is
transferred LSb first.
During Read commands, in which the data is output
from the PIC16F57, the ICSPDAT pin transitions from
the high-impedance state to the low-impedance output
state at the rising edge of the second data clock (first
clock edge after the Start cycle). The ICSPDAT pin
returns to the high-impedance state at the rising edge
of the 16th data clock (first edge of the Stop cycle). See
Figure 2-4.
The commands that are available are described in
Table 2-1.
TABLE 2-1: COMMAND MAPPING FOR PIC16F57
VPP
THLD0
ICSPDAT
ICSPCLK
VDD
TPPDP
Note: After every End Programming command,
a time of T
DIS must be delayed.
Command Mapping (MSb … LSb) Data
Load Data for Program Memory xx00100, data (14), 0
Read Data from Program Memory xx01000, data (14), 0
Increment Address xx0110
Begin Programming xx1000Externally Timed
End Programming xx1110
Bulk Erase Program Memory xx1001Internally Timed