English
Language : 

PIC18LF24K Datasheet, PDF (124/594 Pages) –
PIC18(L)F26/45/46K40
11.1 Program Flash Memory
The Program Flash Memory is readable, writable and
erasable during normal operation over the entire VDD
range.
A read from program memory is executed one byte at
a time. A write to program memory or program memory
erase is executed on blocks of n bytes at a time. Refer
to Table 11-3 for write and erase block sizes. A Bulk
Erase operation cannot be issued from user code.
Writing or erasing program memory will cease
instruction fetches until the operation is complete. The
program memory cannot be accessed during the write
or erase, therefore, code cannot execute. An internal
programming timer terminates program memory writes
and erases.
A value written to program memory does not need to be
a valid instruction. Executing a program memory
location that forms an invalid instruction results in a
NOP.
It is important to understand the PFM memory structure
for erase and programming operations. Program
memory word size is 16 bits wide. PFM is arranged in
rows. A row is the minimum size that can be erased by
user software. Refer to Table 11-3 for the row sizes for
the these devices.
After a row has been erased, all or a portion of this row
can be programmed. Data to be written into the
program memory row is written to 6-bit wide data write
latches. These latches are not directly accessible, but
may be loaded via sequential writes to the TABLAT
register.
Note:
To modify only a portion of a previously
programmed row, then the contents of the
entire row must be read and saved in
RAM prior to the erase. Then, the new
data and retained data can be written into
the write latches to reprogram the row of
PFM. However, any unprogrammed
locations can be written without first
erasing the row. In this case, it is not
necessary to save and rewrite the other
previously programmed locations
TABLE 11-2: FLASH MEMORY ORGANIZATION BY DEVICE
Device
Row Erase Size
(Words)
Write Latches
(Bytes)
Program Flash
Memory (Words)
PIC18(L)F45K40
16384
PIC18(L)F26K40
32
64
32768
PIC18(L)F46K40
PIC18(L)F27K40
PIC18(L)F47K40
64
128
65536
Data Memory (Bytes)
256
1024
 2016 Microchip Technology Inc.
Preliminary
DS40001816C-page 124