User`s guide

MPLAB
®
IDE User’s Guide
DS51519B-page 236 © 2006 Microchip Technology Inc.
18.2.5 Register Injection
Registers may be injected with values set up in a file (see Table 18-4). Enter
information for register injection here.
For General Purpose Register injection, more than one byte may be injected (for
arrays). Therefore, care must be taken to not overwrite data.
18.2.5.1 REGULAR DATA FILE EXAMPLE
Below is an example of an injection file.
EXAMPLE 18-3: REGISTER STIMULUS FILE IN HEX
TABLE 18-4: DEFINITIONS OF REGISTER INJECTIONS
Item Definition
Label Name the register injection you are specifying (optional).
Destination Select a destination register for data injection from the list*. Listed registers
include SFRs (top of list) and any GPRs used (bottom of list).
Trigger Select when to trigger injection.
For most registers, this is either on Demand or when the PC equals a spec-
ified 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 trig-
gered on PC. E.g., if the ADON bit is set and the register ADRESL is
accessed, injection into ADRESL will occur.
For USART/UART registers, injection is Message-based. For more on
simulating the USART/UART, see Section 17.7 “Using a USART/UART”.
PC Value If Trigger=PC, enter a PC value for triggering injection. 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 injected.
Data Filename Browse for the injection (data) file. See below for more information.
Rewind Yes – Once all the data from the file has been injected, start again from the
beginning of the file.
No – Once all the data from the file has been injected, the last value will
continue to be used for injection.
Format Select the format of the injection file.
Regular Data File:
Hex – ASCII hexadecimal
Raw – Raw image, interpreted as binary
SCL – SCL format. See spec for definition.
Dec – ASCII decimal
Message-Based Data File:
Pkt – Hex or Raw packet format (used with UART receive register)
Note: When importing STI stimulus files the maximum line length of any line
within the old files must not exceed 260 characters.
Comments Add descriptive information about the register injection.
* Not all registers may be displayed. E.g., selecting the ADRESL register on the PIC18F458
for injection will actually inject stimulus into both the ADRESH and ADRESL registers.
110
02E
A38
541
1A0
0FD