PIC18LF13K22 Microchip Technology, PIC18LF13K22 Datasheet - Page 15

no-image

PIC18LF13K22

Manufacturer Part Number
PIC18LF13K22
Description
(PIC18F1xK22) Flash Microcontrollers
Manufacturer
Microchip Technology
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC18LF13K22-I/ML
Manufacturer:
CAVIUM
Quantity:
155
Part Number:
PIC18LF13K22-I/SS
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
www.DataSheet4U.com
4.2
Programming code memory is accomplished by first
loading data into the write buffer and then initiating a
programming sequence. The write and erase buffer
sizes shown in Table 4-4 can be mapped to any loca-
tion of the same size beginning at 000000h. The actual
memory write sequence takes the contents of this buf-
fer and programs the proper amount of code memory
that contains the Table Pointer.
The programming duration is externally timed and is
controlled by PGC. After a Start Programming
command is issued (4-bit command, ‘1111’), a NOP is
issued, where the 4th PGC is held high for the duration
of the programming time, P9.
TABLE 4-4:
TABLE 4-5:
© 2008 Microchip Technology Inc.
PIC18F14K22
PIC18F13K22
Step 1: Direct access to code memory.
Step 2: Point to row to write.
Step 3: Load write buffer. Repeat for all but the last two bytes.
Step 4: Load write buffer for last two bytes and start programming.
To continue writing data, repeat steps 2 through 4, where the Address Pointer is incremented by 2 at each iteration of
the loop.
Command
0000
0000
0000
0000
0000
0000
0000
0000
0000
1101
1111
0000
4-bit
Code Memory Programming
WRITE AND ERASE BUFFER SIZES
WRITE CODE MEMORY CODE SEQUENCE
0E <Addr[21:16]>
0E <Addr[15:8]>
0E <Addr[7:0]>
<MSB><LSB>
<MSB><LSB>
Data Payload
9C A6
8E A6
6E F8
6E F7
6E F6
84 A6
00 00
Devices
BSF
BCF
BSF
MOVLW <Addr[21:16]>
MOVWF TBLPTRU
MOVLW <Addr[15:8]>
MOVWF TBLPTRH
MOVLW <Addr[7:0]>
MOVWF TBLPTRL
Write 2 bytes and post-increment address by 2.
Write 2 bytes and start programming.
NOP - hold PGC high for time P9 and low for time P10.
Advance Information
EECON1, EEPGD
EECON1, CFGS
EECON1, WREN
PIC18F1XK22/LF1XK22
After PGC is brought low, the programming sequence
is terminated. PGC must be held low for the time
specified by parameter P10 to allow high-voltage
discharge of the memory array.
The code sequence to program a PIC18F1XK22/
LF1XK22 device is shown in Table 4-5. The flowchart
shown in Figure 4-4 depicts the logic necessary to
completely write a PIC18F1XK22/LF1XK22 device.
The timing diagram that details the Start Programming
command and parameters P9 and P10 is shown in
Figure 4-5.
Note:
Core Instruction
Write Buffer Size
The TBLPTR register must point to the
same region when initiating the program-
ming sequence as it did when the write
buffers were loaded.
(bytes)
16
8
Erase Size (bytes)
DS41357A-page 15
64
64

Related parts for PIC18LF13K22