English
Language : 

PIC16LF18854 Datasheet, PDF (176/668 Pages) Microchip Technology – C Compiler Optimized RISC Architecture
PIC16(L)F18856/76
FIGURE 10-5: PROGRAM FLASH MEMORY (PFM) WRITE FLOWCHART
Start
Write Operation
Rev. 10-000049C
8/24/2015
Determine number of
words to be written into
PFM. The number of
words cannot exceed the
number of words per row
(word_cnt)
Select access to PFM
locations using
NVMREG<1:0> bits
Select Row Address
TBLPTR
Select Write Operation
(FREE = 0)
Load Write Latches Only
Load the value to write
TABLAT
Update the word counter
(word_cnt--)
Last word to
Yes
write ?
No
Disable Interrupts
(GIE = 0)
Unlock Sequence
(See note 1)
Write Latches to PFM
Disable Interrupts
(GIE = 0)
Unlock Sequence
(See note 1)
CPU stalls while Write
operation completes
(2 ms typical)
Enable Write/Erase
Operation (WREN = 1)
No delay when writing to
PFM Latches
Re-enable Interrupts
(GIE = 1)
Note 1: See Figure 10-2.
Re-enable Interrupts
(GIE = 1)
Increment Address
TBLPTR++
Disable Write/Erase
Operation (WREN = 0)
End
Write Operation
DS40001824A-page 176
Preliminary
 2016 Microchip Technology Inc.