English
Language : 

SLAS191A Datasheet, PDF (57/86 Pages) Texas Instruments – Starter Kit Evaluation Kit Manual
3 Monitor Restrictions
3.1 Register R4
The Monitor Program uses the R4 register internally to return data from the user application to the
Hyperterminal. Modifications to the value stored in R4 will result in unexpected behavior of the Monitor
Program. The Monitor command r, to change the register contents, is not supported for R4. The register R4
can be modified by the user application code. Consequently, the user should exercise caution when using
this register.
It is possible to interrupt the user application by pressing the ESC key on the keyboard. This works only if
the GIE bit has not been cleared. One exception is possible in spite of a cleared GIE flag. If the user
application runs on a breakpoint, program execution will branch to the Monitor as the program runs.
Problems may occur if the user application uses most of its time in interrupt routines. While the application
is servicing an interrupt, a new interrupt can only occur if the GIE bit has been set. The GIE bit is set only
if the first interrupt routine explicitly sets it within the routine itself, thereby allowing for nested interrupts.
Starting the user application with the Monitor causes the Monitor Program to set the GIE bit. If the GIE-bit
was reset before in the user application, it will remain set. This ensures the availability of the RS232
communication but influences the user’s software application. The particular interrupts can be enabled with
their associated interrupt flags.
3.2 The Instruction CALL R4
In the user application, it is possible to return to the Monitor with the instruction CALL R4. The monitor should
be started prior to this so that the contents in R4 are valid and to initialize the Monitor.
A single step should not be executed over the CALL R4 instruction because this will cause unpredictable
behavior of the Monitor. The following code is an example that uses the instruction CALL R4.
NOTE:
Execute the single step command only if the program counter points to an instruction in
the RAM.
WDTCTL
WDTHold
WDT_wrkey
.equ
.equ
.equ
0120h
80h
05a00h
RESET:
WAIT:
.text
MOV
MOV
MOV
INC
CALL
0240h
#03DEh,SP
# (WDTHold+WDT_wrkey),&WDTCTL
#0h,R7
R7
R4
; stop Watchdog
; Timer
.sect
.word
.end
“Int_Vect” ,03FEh
RESET
Figure 3–1. CALL R4 Instruction Code
3–1