View or Change Device Memory

MPLAB X IDE has flexible, abstracted memory windows that provide a more customized view of the different types of device memory during debug. You must Pause from debugging to be able to see updated values in this window.

View Device Memory

  1. 1.Click a window in a pane to make the pane active. The memory window will open in this pane.
  2. 2.Select a memory view from Window>Target Memory Views. The available choices are shown in the following tables. Not all memory types are available for all devices.
    Table 1. Memory Views – 8- and 16-Bit Devices
    Type Description
    Program Memory all program memory (ROM) on the device
    File Registers all file register (RAM) memory on the device
    SFRs all Special Function Registers (SFRs)
    Peripherals all SFRs by Peripheral
    Configuration Bits all Configuration registers
    EE Data Memory all EE Data memory on the device
    User OTP Memory User OTP memory
    User ID Memory User ID memory
    Table 2. Memory Views – 32-Bit Devices
    Type Description
    Execution Memory all Flash memory on the device
    Data Memory all RAM memory on the device
    Peripherals all Special Function Registers (SFRs)
    Configuration Bits all Configuration registers
    CPU Memory all CPU memory
    User ID Memory User ID memory
  3. 3.When a Memory window is open, you may change your view by selecting a different memory in the Memory drop-down box. Or, you can change the format of the current memory display in the Format drop-down box. The format choices depend on the type of memory chosen and the device.
    Figure 1. Memory and Memory Format Selection
  4. 4.After Debug and then Pause, the window will populate with the memory chosen.
  5. 5.Close the window by clicking the “x” on that window’s tab.
    Figure 2. Memory Window Content

Change Device Memory

You must Debug your code to change memory values. You cannot change memory when code is running.

Note: The data will change only during Debug. Your application code is not changed.

Use the following information to change memory values:

Set Memory Window Options with the Context Menu

Right clicking in the Memory window will pop up a context menu with various options such as display options, fill memory, table import/export and output to file. The content of the menu depends on the window. See MPLAB X IDE Windows and Dialogs.

Refresh Selected Memory Windows

For Memory windows showing program, EEPROM, user ID, or configuration bits memory, you can refresh the view by doing the following:

  1. 1.If you are debugging, halt your program unless your tool and device support Debug Reads (see below).
  2. 2.Click on the icon named “Read Device Memory” .

Debug Reads

For most devices, you must halt your program (Finish Debugger Session) before you can read device memory. For some devices, you can read while in debug mode (Debug Read). You will know that this is available as the “Read Device Memory” icon will not be grayed out when you are debugging.

Currently, only MPLAB REAL ICE in-circuit emulator and MPLAB ICD 3 support Debug Reads.

Debug Reads are done at target oscillator speeds so if the target is running very slow, a read may take a long time. You can force a fast ICSP read by finishing the debug session and then doing a read since ICSP reads will always be done when not in a debug session.