Changing a word in PFM requires erasing the word before it is re-written. However, the PFM cannot be erased by less than a page at a time. Changing a single word requires reading the page, erasing the page, then re-writing the page with the modified word. The NVM command set includes page operations to simplify this task.
In this device a PFM page is 128 words (256 bytes). This is the same size as one bank of general purpose RAM (GPR). This area of GPR space is dedicated as a buffer area for NVM page operations. The buffer areas for each device in the family are shown in the following table.
| Device | GPR Bank Number |
|---|---|
| PIC18Fx7Q43 | 37 |
| PIC18Fx6Q43 | 21 |
| PIC18Fx5Q43 | 13 |
‘b010 (Read Page).’b110 (Erase Page).’b101 (Write Page).TBLRD
and TBLWT instructionsNeglecting the bank select bits, the 8 address bits of the GPR buffer space correspond to the 8 LSbs of each PFM page. In other words, there is a one to one correspondence between the NVMADRL register and the FSRxL register, where the x in FSRx is 0, 1, or 2.