PIC12F1516 MICROCHIP [Microchip Technology], PIC12F1516 Datasheet - Page 101

no-image

PIC12F1516

Manufacturer Part Number
PIC12F1516
Description
28/40/44-Pin Flash Microcontrollers with nanoWatt XLP Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet
11.2.3
While executing code, program memory can only be
erased by rows. To erase a row:
1.
2.
3.
4.
5.
See
After the “BSF PMCON1,WR” instruction, the processor
requires two cycles to set up the erase operation. The
user must place two NOP instructions after the WR bit is
set. The processor will halt internal operations for the
typical 2 ms erase time. This is not Sleep mode as the
clocks and peripherals will continue to run. After the
erase cycle, the processor will resume operation with
the third instruction after the PMCON1 write instruction.
 2011 Microchip Technology Inc.
Load the PMADRH:PMADRL register pair with
any address within the row to be erased.
Clear the CFGS bit of the PMCON1 register.
Set the FREE and WREN bits of the PMCON1
register.
Write 55h, then AAh, to PMCON2 (Flash
programming unlock sequence).
Set control bit WR of the PMCON1 register to
begin the erase operation.
Example
ERASING FLASH PROGRAM
MEMORY
11-2.
Preliminary
FIGURE 11-4:
PIC16(L)F1516/7/8/9
Program or Configuration Memory
Disable Write/Erase Operation
Enable Write/Erase Operation
ERASE operation completes
Select ERASE Operation
(PMADRH:PMADRL)
Select Row Address
Re-enable Interrupts
ERASE Operation
ERASE Operation
Disable Interrupts
Unlock Sequence
CPU stalls while
(FIGURE x-x)
(2ms typical)
(WREN = 1)
(WREN = 0)
(FREE = 1)
FLASH PROGRAM
MEMORY ERASE
FLOWCHART
Figure 11-3
(GIE = 0)
(GIE = 1)
(CFGS)
Select
Start
End
DS41452B-page 101

Related parts for PIC12F1516