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.
![]() Opcode ViewerOnce 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 ViewerAlso 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:
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 ViewerAnother 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 locationOnce 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:
|