Extract Secured MCU PIC18F4685 Flash Memory

We can Extract Secured MCU PIC18F4685 Flash Memory, please view the MCU PIC18F4685 features for your reference:

The sequence of events for programming an internal program memory location should be:

Read 8 bytes into RAM.

Update data values in RAM as necessary.

Load Table Pointer register with address being erased.

Execute the row erase procedure.

Load Table Pointer register with address of first byte being written when Extract Secured MCU PIC18F4685 Flash Memory.

Write the 8 bytes into the holding registers with auto-increment.

Set the EECON1 register for the write operation:

set EEPGD bit to point to program memory;clear the CFGS bit to access program memory;
set WREN to enable byte writes.

Disable interrupts.

Write 55h to EECON2.

Write 0AAh to EECON2.

Set the WR bit. This will begin the write cycle.

The CPU will stall for duration of the write (about 2 ms using internal timer).

Re-enable interrupts after Extract Secured MCU PIC18F4685 Flash Memory.

Verify the memory (table read).

This procedure will require about 6 ms to update one row of 8 bytes of memory. An example of the required code is given in Example 6-3. Before setting the WR bit, the Table Pointer address needs to be within the intended address range of the 8 bytes in the holding register.

Depending on the application, good programming practice may dictate that the value written to the memory should be verified against the original value. This should be used in applications where excessive writes can stress bits near the specification limit if EXTRACT IC.