Specifications
mikroElektronika | Free Online Book | PIC Microcontrollers | Appendix A: Programming a Microcontroller
SIMULATOR
Asimulator is a part of MPLAB environment which provides better insight into the operation of the microcontroller.
Generally speaking, a simulation is an attempt to model a real-life or hypothetical situation so that it can be studied to
see how the system works. By means of the simulator, it is also possible to monitor current values of variables, registers
and port pins states as well. To be honest, a simulator is not of the same importance for all programs. If a program is
simpler (as in our example), the simulation is not of great importance because setting port B pins to logic one (1) is not
complicated at all. However, in more complex programs containing timers, different conditions and requests (especially
mathematical operations), the simulator may be of great use. As the name itself indicates, a simulation means to simulate
the operation of microcontroller. Like the microcontroller, a simulator executes instructions one after another (line by
line) and constantly updates the state of all registers. In this way, the user simply monitors program execution. At the end
of program writing, the user should first test it in the simulator prior to executing it in a real environment. Unfortunately,
this is one of many good things being overlooked by the programmer because of its character as such and the lack of high-
quality simulators as well.
http://www.mikroe.com/en/books/picmcubook/appa/ (19 of 21)5/3/2009 11:35:35 AM