User`s manual

106 digi.com Debugging with Dynamic C
Watchdogs
Ten virtual watchdogs are provided, in addition to the hardware watchdog(s) of the processor. Watchdogs,
whether hardware or software, limit the amount of time a system is in an unknown state.
Virtual watchdogs are maintained by the Virtual Driver and described in Section 7.4.2. The sample pro-
gram Samples\VDRIVER\VIRT_WD.C demonstrates the use of a virtual watchdog.
Compiler Options
The Compiler tab of the Project Options dialog contains several options that assist debugging. They are
summarized here and fully documented starting on “Compiler Tab”.
List Files - When enabled, this option generates an assembly list file for each compile. The list file con-
tains the same information and is in the same format as the contents of the Assembly window. List files
can be very large.
Run-Time Checking - Run-time checking of array indices and pointers are enabled by default.
Type Checking - Compile-time checking of type options are enabled by default. There are three type
checking options, labeled as: Prototype, Demotion and Pointer. Checking prototypes means that argu-
ments passed in function calls are checked against the function prototype. Demotion checking means
that the automatic conversion of a type to a smaller or less complex type is noted. Pointer checking
refers to making sure pointers of different types being intermixed are cast properly.
See the section titled, “Type Checking” on page 280 for more information.
Blinking Lights
Debugging software by toggling LEDs on and off might seem like a strange way to approach the problem,
but there are a number of situations that might call for it. Maybe you just want to exercise the board hard-
ware. Or, let us say you need to see if a certain piece of code was executed, but the board is disconnected
from your computer and so you have no way of viewing printf output or using the other debugging tools.
Or, maybe timing is an issue and directly toggling an LED with a call to WrPortE() or
BitWrPortE() gives you the information you need without as much affect on timing.
The sample program \Samples\LP3500\power.c demonstrates how to use LEDs to communicate
information.