Embedded Memory

Most PIC® microcontrollers have several different memory types and memory regions that need to be displayed while debugging. All of these memory views are accessed from a common location under the Window menu.

 Where have all my views gone?

 Step-by-Step

In MPLAB® X, all embedded memory types are accessed from the main menu by selecting Window ▸ PIC Memory Views ▸ view, where view is one of the following:


Program Memory

Display from the main menu: Window ▸ PIC Memory Views ▸ Program Memory

This view shows you the contents of program memory (Flash) in one of several possible formats.

The format of the display may be changed by choosing a different selection from the Format combo box at the bottom. Choices include: Hex, Symbol, and others specific to the device architecture such as PSV Data for 16-bit PIC® microcontrollers. Examples of both symbolic and hex displays are shown at left.

Under some circumstances, a program memory location's contents may be changed by double clicking on the value, typing in a new value and hitting the Enter key.

The display may be quickly changed to another type by choosing a new selection from the Memory combo box at the bottom left.

ProgramMemory.png
Click image to enlarge.

File Registers

Display from the main menu: Window ▸ PIC Memory Views ▸ File Registers

This view shows you the contents of data memory (RAM) in one of several possible formats.

The format of the display may be changed by choosing a different selection from the Format combo box at the bottom. Choices include: Hex, Symbol, and others specific to the device architecture such as XY Data for 16-bit PIC® microcontrollers. Examples of both symbolic and hex displays are shown at left.

While in an active debug session with your program halted, you can change a file register's contents by double clicking on its current value. Just type in a new value and hit the Enter key. The new value will take effect as soon as you start running the program again.

The display may be quickly changed to another type by choosing a new selection from the Memory combo box at the bottom left.

FileRegisters.png
Click image to enlarge.

SFRs (Special Function Registers)

Display from the main menu: Window ▸ PIC Memory Views ▸ SFRs

This view shows you the contents of the Special Function Registers (SFR), which are part of data memory space but have specific uses with respect to controlling and interacting with the microcontroller's hardware and on-chip peripherals.

While in an active debug session with your program halted, you can change a special function register's contents by double clicking on its current value. Just type in a new value and hit the Enter key. The new value will take effect as soon as you start running the program again.

The display may be quickly changed to another type by choosing a new selection from the Memory combo box at the bottom left.

SFRs.png
Click image to enlarge.

Configuration Bits

Display from the main menu: Window ▸ PIC Memory Views ▸ Configuration Bits

This view shows the current settings of the devices Configuration Bits, which are special EEPROM registers mapped into program space beyond the range of the program counter. These settings are typically picked up from your code's configuration directives. However, this window may be used to setup the configuration bits and generate a file with the code that explicitly initializes each and every configuration bit.

ConfigurationBits.png
Click image to enlarge.

The nice thing about setting configuration bits from this window is that you can configure everything via point and click. Simply click on a line in the Setting column and it will become a combo box listing all of the possible options for that configuration setting. Using this in conjunction with the Generate Source Code To Output button to specify your configuration settings has several benefits:

  1. The more intuitive configuration bits window helps to eliminate errors due to the somewhat cryptic configuration directives in code.
  2. The code generator explicitly initializes each configuration setting, so there is no doubt as to what the defaults might be.
  3. It eliminates the need to lookup the symbol names and syntax required for writing the configuration code yourself.

See View and Set your Configuration Bits for additional details.

ConfigBitsSetting.png
Click image to enlarge.

EEPROM Data Memory

Display from the main menu: Window ▸ PIC Memory Views ▸ EEPROM Data Memory

This view displays the contents of EEPROM data memory on devices that support this feature. If the menu entry is inactive, then the target device of your project doesn't have EEPROM data memory.

EEData.PNG
Click image to enlarge.

Other Memory

Display from the main menu: Window ▸ PIC Memory Views ▸ Other Memory

On most devices, this view will simply open another embedded memory window that may be configured any way you like. It can be useful for opening two views of the same type so that you can look at two different locations in the same memory space simultaneously.

FileRegisters.png
Click image to enlarge.

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.