Back to Index

Memory Browser

MicroSim has a tab in its program dedicated to viewing the PIC memory, both register memory and program memory. This tab is called the "Memory Browser" tab, the second tab at the top of MicroSim.


Memory Browser Tab

Opcode Viewer

Once a program has been loaded into the simulator (see file loading) we can view the program opcodes in the memory browser tab under the opcode viewer component. The current instruction is highlighted. When executing a program in single-step mode (see program execution) the highlighted line changes with each instruction step. The opcode viewer shows the memory address where the instruction is located, the 'hex' representation and the disassembled (ASM) representation of the code.

Memory Viewer

Also located under the "Memory Browser" tab is a memory viewer (bottom half of tab). This graphical component allows users to view/modify the value of memory. Users can view register memory (RAM), program memory or EEPROM memory of the PIC16F84A by selecting the appropriate radio button on the bottom of the page. In this version of MicroSim only RAM can be read/modified. This is done as follows:
  • Left-click on the memory location you wish to modify. The row at the top represents the low nibble (4-bits) of the memory address and the column on the left hand side of the table represents the high nibble (4-bits) of the address.
  • Once you have clicked on the memory location in the table, the corresponding heading for the row and column is made bold so that stand out. At the bottom right hand corner of the screen you will see a text box which has the address (in square brackets) beside it and the value of the memory location in the actual text box. To modify this value, simple write the new value in 'hex' format in the text box and press 'Enter'.
  • The memory location in the table will be updated to the new value
You will also note on the right hand side of the table there is a column dedicated to the ASCII value of all 16 bytes of memory in a particular row (i.e. 0000->000F is row 1).

Whilst viewing the RAM (registers) by having the RAM radio button selected, you can view the symbolic names of some of the special function and general purpose registers. This is done by selecting the 'View Names' checkbox at the bottom of the screen. You will see the memory table change from having memory values to the symbolic names of each register. For instance, register address 01 in RAM in the PIC16F94A is the TMR0 (timer) register. Also, if a symbolic COD file has been loaded into the simulator, any symbolic names used in the ASM code will be shown here. For instance, a program might declare a variable 'count' at general purpose register address 0C in RAM. When 'View Names' is selected you will see 'count' in the address location 0C. To go back to the orginal view of memory values, simply deselected the 'View Names' checkbox.

Also located in the memory viewer at the bottom left are important registers to do with program execution such as the 'Status' register, W register and Program Counter (PC). These can also be modified by inputting new values in the corresponding text box and pressing 'Enter'.

Memory locations can have breakpoints added to them. To see how breakpoint can be added go to the program execution page.

Watch Viewer

Another feature of MicroSim that aids in viewing what really happens during execution of a PIC application is the Watch Viewer. MicroSim allows the user to right click on a memory location (in the memory viewer tab) and from the menu that pops up, select to add a 'watch' to a memory location. For instance, if you want to view an general purpose register that your program uses as an important variable you can add a 'watch' to it. Rather than trying to decipher the value of a memory location from the memory viewer, by adding a watch you can see various information and representations of the memory location
Once a watch is added, its information is displayed in the 'Watch Viewer' graphical component. The information that is displayed with each 'watched' memory location are:
  • Breakpoint status (BP?) - No, Read, Write, Both (see program execution help page for more info on breakpoints
  • Type - type of memory (RAM, EEPROM, etc)
  • Name - symbolic name of memory location (i.e. TMR0, PORTA, user defined variable name)
  • Address - memory address in 'hex' format
  • Dec - memory value in decimal format
  • Hex - memory value in hexadecimal format
  • ASCII - memory value in ASCII format (if applicable)
  • Bin - memory value in 8-bit binary format
To remove a 'watch' from a memory location, simple double click the 'watch' that you want removed from the watch viewer.