PFMRead

Syntax:

    PFMRead (location, store)

Command Availability:

Available on Microchip PIC microcontrollers with PFM (Program Flash Memory) self-write capability, such as the 18FxxQ41 family.

Explanation:

PFMRead reads information from the program memory on chips that support this feature. location is a word variable identifying the word to read, and store can be a byte or word variable to receive the result.

The largest value possible for location depends on the amount of program memory on the Microchip PIC microcontroller.

This is an advanced command intended for developers who need direct control over program-memory self-read operations; most programs should use DATA blocks and ProgramRead instead.

Example:

    #chip 18F56Q43, 64

    Dim WordLocation As Word
    Dim StoredValue As Word

    WordLocation = 0x1000

    PFMRead ( WordLocation, StoredValue )          ' <<< the PFMRead instruction

    HSerPrint StoredValue

Key line: PFMRead ( WordLocation, StoredValue ) — reads the program-memory word at WordLocation back into StoredValue.

See Also:

  • PFMWrite — writing the value this page reads back
  • ProgramRead — the equivalent command on chip families that do not use the PFM naming
  • DATA — defining a program-memory dataset to read with this command