User`s guide

Simulator Overview
© 2006 Microchip Technology Inc. DS51519B-page 215
16.3.5.2 16-BIT CORE (PIC18) CPU
Reset Conditions
All Reset conditions are supported by the MPLAB SIM simulator.
The Time out (TO) and Power-Down (PD) bits in the RCON register reflect appropriate
Reset condition. This feature is useful for simulating various power-up and time-out
forks in the user code.
You cannot Reset by toggling MCLR
using stimulus control. You must use Debugger>
Reset>MCLR Reset.
Sleep
When executing a Sleep instruction, MPLAB SIM will appear “asleep” until a wake-up
from sleep condition occurs. For example, if the Watchdog Timer has been enabled, it
will wake the processor up from sleep when it times out (depending upon the
pre/postscaler setting).
An example of a wake-up-from-sleep condition would be an input change on Port B. If
the interrupt is enabled (RBIE) and the priority bit (RBIP) is selected, the processor will
wake up and will resume executing from the instruction following the Sleep command.
Watchdog Timer
The Watchdog Timer is fully simulated in the MPLAB SIM simulator.
The period of the WDT is determined by the pre/postscaler Configuration bits
WDTPS0:2. The minimum period (with pre/postscaler at 1:1) may be set on the Break
Options tab of the Settings dialog (Debugger>Settings
).
Setting the Configuration bit WDTEN to ‘0’ will disable the WDT, unless it is enabled by
the SWDTEN bit of the WDTCON register. Setting the Configuration bit WDTEN to ‘1
will enable the WDT regardless of the value of the SWDTEN bit.
In the Configuration Bits dialog (Configuration>Configuration Bits
) you enable/disable
the WDT and set the pre/postscaler.
A WDT time-out is simulated when WDT is enabled, proper pre/postscaler is set and
WDT actually overflows. On WDT time-out, the simulator will halt or Reset, depending
on the selection in the Break Options tab of the Settings dialog.
16.3.5.3 16-BIT CORE (PIC18) PROCESSOR MODES
The following processor modes are supported by MPLAB SIM for devices which allow
them:
Microcontroller (Default)
Extended Microcontroller
Microprocessor
Microprocessor with Boot Block
For information on external memory, see Section 17.6 “Using External Memory”.