English
Language : 

PIC16LF1904 Datasheet, PDF (93/288 Pages) Microchip Technology – 28/40/44-Pin Flash-Based, 8-Bit CMOS Microcontrollers with LCD Driver and nanoWatt XLP Technology
PIC16LF1904/6/7
FIGURE 10-6:
FLASH PROGRAM MEMORY WRITE FLOWCHART
Start
Write Operation
Determine number of words
to be written into Program or
Configuration Memory.
The number of words cannot
exceed the number of words
per row.
(word_cnt)
Enable Write/Erase
Operation (WREN = 1)
Load the value to write
(PMDATH:PMDATL)
Disable Interrupts
(GIE = 0)
Select
Program or Config. Memory
(CFGS)
Select Row Address
(PMADRH:PMADRL)
Select Write Operation
(FREE = 0)
Load Write Latches Only
(LWLO = 1)
Update the word counter
(word_cnt--)
Last word to Yes
write ?
No
Unlock Sequence
F(Figiguurere1x0-x3)
No delay when writing to
Program Memory Latches
Increment Address
(PMADRH:PMADRL++)
Write Latches to Flash
(LWLO = 0)
Unlock Sequence
F(Figiguurere1x0-x3)
CPU stalls while Write
operation completes
(2 ms typical)
Disable
Write/Erase Operation
(WREN = 0)
Re-enable Interrupts
(GIE = 1)
End
Write Operation
 2011 Microchip Technology Inc.
Preliminary
DS41569A-page 93