problem with WATCH command SX/B
duffling
Posts: 73
Ive been having some problems getting the watch command to work reliably
ive found if i have the watch command in a loop without any other commands inside the loop aside from INC counter1 it works
see my short program below
my watch in the debugger does not show the Counter1 variable increasing at all ..
what am·I doing wrong?
'
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ········· ·· 50000000
'
LED VAR RC.7
button········· var···· rb.0
counter1······· var···· BYTE
'
PROGRAM start
start:
COUNTER1=0
lOOP:
HIGH LED
PAUSE 1000
INC COUNTER1
WATCH COUNTER1,8,UDEC
LOW LED
PAUSE 1000
GOTO LOOP
·
ive found if i have the watch command in a loop without any other commands inside the loop aside from INC counter1 it works
see my short program below
my watch in the debugger does not show the Counter1 variable increasing at all ..
what am·I doing wrong?
'
DEVICE········· SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ········· ·· 50000000
'
LED VAR RC.7
button········· var···· rb.0
counter1······· var···· BYTE
'
PROGRAM start
start:
COUNTER1=0
lOOP:
HIGH LED
PAUSE 1000
INC COUNTER1
WATCH COUNTER1,8,UDEC
LOW LED
PAUSE 1000
GOTO LOOP
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas, TX· USA
'
DEVICE SX28, OSC4MHZ, TURBO, STACKX, OPTIONX
FREQ 4_000_000
'
' VARs DECLARATIONS
counter1 var BYTE
WATCH COUNTER1,8,UDEC
'
PROGRAM start
start:
COUNTER1=0
lOOP:
INC COUNTER1
GOTO LOOP
When I run in debug mode the code and register windows show stepping through the loop but Counter1 in the Watch window remains at zero.
How to get Watch to show contents of a variable while stepping or walking in Debug mode?
Thanks.
You do realize that SXB clears all the memory first and you must step through all that code ?
To make life easier use "PROGRAM start NOSTARTUP" to eliminate the startup code.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Wise men know when they're right. The wisest also·know when they're wrong."
·
'Program Start NOSTARTUP' works like a charm. Thanks.