The TBLPTR register is used in reads of the Program Flash Memory. Writes using the TBLPTR register go into to a buffer RAM from which the data can eventually be transferred to Program Flash Memory using the NVMADR register and NVM commands.
When a TBLRD instruction is
executed, all 22 bits of the TBLPTR determine which byte is read from program memory
directly into the TABLAT register.
When a TBLWT instruction is
executed the byte in the TABLAT register is written, not to Flash memory but to a buffer
register in preparation for a program memory write. All the buffer registers together form
a write block of size 128 words/256 bytes. The LSbs of the TBLPTR register determine to
which specific address within the buffer register block the write affects. The size of the
write block determines the number of LSbs that are affected. The MSbs of the TBLPTR
register have no effect during TBLWT
operations.
When a program memory page write is executed the entire buffer register block is written to the Flash memory at the address determined by the MSbs of the NVMADR register. The LSbs are ignored during Flash memory writes. For more detail, see the “Writing to Program Flash Memory” section.
The following figure illustrates the relevant boundaries of the TBLPTR register based on NVM operations.