User`s guide
MPLAB
®
IDE User’s Guide
DS51519B-page 238 © 2006 Microchip Technology Inc.
EXAMPLE 18-5: REGISTER STIMULUS FILE 2
18.2.6 Register Trace
The value of a specified register may be saved to a file (traced) during a run for certain
conditions (see Table 18-5). Specify register trace information here.
TABLE 18-5: DEFINITIONS OF REGISTER TRACE
Item Definition
Label Name the register trace you are specifying (optional).
Source Select the source register for tracing from the list. Listed registers include
SFRs (top of list) and any GPRs used (bottom of list).
Trigger Select when to trigger the trace, either on Demand or when the PC equals a
specified value (see next column).
If the peripheral is implemented, it can only be triggered on demand. If the
peripheral is not implemented, it must be triggered on PC. E.g., if the ADON
bit is set and the register ADRESL is accessed, tracing will begin.
PC Value If Trigger=PC, enter a PC value for triggering tracing. This can be an
absolute address or a label in the code.
Note: For MPLAB
®
C18/C30 code, labels are not supported and therefore
local variables may not be in scope when expected. Use absolute
addresses or global variables instead.
Width If Trigger=PC, the number of bytes to be traced.
Trace Filename Browse for a location for the trace file.
Format Select the format of the trace file.
Hex – ASCII hexadecimal
Raw – Raw image, interpreted as binary
SCL – SCL format. See spec for definition.
Dec – ASCII decimal
Comments Add descriptive information about the register trace.
wait 0 sec
61 62 63 20 6A 62 61
wait 200 ms
// the following is equivalent to "the quick brown fox"
"the quick brown "
"fox"
// CR-LF in a packet
wait 20 sec
65 66 67 68 13 10
69 70
// 9-bit value in a packet
wait 20 sec
165 166 167 168
wait 30 ms
// the following is "012mix"
32 33 34
"mix"
wait 100 ns
// the following blank line is ignored
64 34 33 24 32 34 21
rand 15 20 sec
89 90 91 92 93 94
rand 0 100 min
11 22 33