Shop OBEX P1 Docs P2 Docs Learn Events
Debugging Delima — Parallax Forums

Debugging Delima

TristonazTristonaz Posts: 4
edited 2006-05-25 21:44 in General Discussion
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

Comments

  • David BDavid B Posts: 592
    edited 2006-05-25 21:44
    Don't you want the two "jmp Loop" commands in the lower part of the code that follow the descz commands to be "jmp Loop1"?
Sign In or Register to comment.