Debugging Delima
Hello,
I just got my professional SX Tool kit and I've been reading the "Programming the SX Microcontrolller: A Complete Guide". And it was going great, that is, until I got to this string of code:
LIST Q = 37
DEVICE SX28L, TURBO, STACKX, OSCHS2
IRC_CAL IRC_FAST
FREQ 50_000_000
Reset 0
mov !rb, #%11111110
Loop
decsz $08
jmp Loop
decsz $09
jmp Loop
clrb rb.0
Loop1
decsz $08
jmp Loop
decsz $09
jmp Loop
setb rb.0
jmp Loop
This is suppose to make the LED blink on and off at a visible rate, but when I run the program the light turns on and then turns off and stays that way. I ran through the program with the walk button in the dubugging window and I found that sometimes the PC counter suddenly jumps to a seemingly random unused part in the program memory. I'm using the FTDI US232B USB to Serial Adapter because my labtop doesn't have a serial port. Can anyone help me?
Triston
I just got my professional SX Tool kit and I've been reading the "Programming the SX Microcontrolller: A Complete Guide". And it was going great, that is, until I got to this string of code:
LIST Q = 37
DEVICE SX28L, TURBO, STACKX, OSCHS2
IRC_CAL IRC_FAST
FREQ 50_000_000
Reset 0
mov !rb, #%11111110
Loop
decsz $08
jmp Loop
decsz $09
jmp Loop
clrb rb.0
Loop1
decsz $08
jmp Loop
decsz $09
jmp Loop
setb rb.0
jmp Loop
This is suppose to make the LED blink on and off at a visible rate, but when I run the program the light turns on and then turns off and stays that way. I ran through the program with the walk button in the dubugging window and I found that sometimes the PC counter suddenly jumps to a seemingly random unused part in the program memory. I'm using the FTDI US232B USB to Serial Adapter because my labtop doesn't have a serial port. Can anyone help me?
Triston
Comments