A single 16-bit word is read by setting the NVMADR registers to
the target address and setting the NVMCMD bits to ‘b000
. The word is
then transferred from PFM to the NVMDAT registers by starting the read operation by
setting the GO bit.
The sequence of events for reading a word of PFM is:
‘b000
(Word Read).// Code sequence to read one word from PFM
// PFM target address is specified by WORD_ADDR
// Variable to store the word value from desired location in PFM
uint16_t WordValue;
// Load NVMADR with the desired word address
NVMADR = WORD_ADDR;
NVMCON1bits.CMD = 0x00; // Set the word read command
NVMCON0bits.GO = 1; // Start word read
while (NVMCON0bits.GO); // Wait for the read operation to complete
WordValue = NVMDAT; // Store the read value to a variable