Lesson 4: Using the Simulator

The simulator allows you to see and modify the internal components of the microcontroller in an interactive way:

On the left of the screen is the Simulation Window which contains a schematic representation of the chip and the simulation control buttons. Below this is the Data Memory Window which shows each location (register) in the data memory array. You can edit the values using the right column and assign labels to particular locations using the middle column. The Constants Window is underneath this and allows you to define symbolic constants that you can use in your code. Note that these are just to make your code more readable and do not represent anything physically on the chip.

On the right of the screen is the Program Memory Window and, like the Data Memory Window, this shows each location in the program memory array. You can enter instructions directly into the last column and assign labels to particular addresses using the first column. These can then be referred to during branch operations, as we will see in Lesson 11.

In the top bar of the Program Memory Window is a button labelled 'Mode'. Pressing this flips the view from showing the actual program memory to a text window into which you can type a complete assembler program. You can also 'Extract' the program you have developed into this window and then copy it to a text file on your own computer. When you want to load it into the simulator again, simply copy it back into the text window and press the 'Upload' button.

Next Lesson >>