Shop OBEX P1 Docs P2 Docs Learn Events
SOLVED: PASM strange djnz behavior — Parallax Forums

SOLVED: PASM strange djnz behavior

WurlitzerWurlitzer Posts: 237
edited 2011-01-20 08:34 in Propeller 1
SOLVED: A routine which I did not think would get hit until a temp variable was set in self modifying code did in fact execute and modified code rather than the intended array.

In the attached code (hopefully), the PASM variable ScanCnt works fine at the desired starting value of 61.

I could leave this code as is as it seems to work properly(as best as I can tell via Gear) but while testing I wanted to see the timing between outputs P8 and P9 so I changed the value of ScanCnt from 61 to 5 and the program stopped working. My intent was to see the P8/P9 timing closer on the Gear Logic Probe rather than 61 counts apart.Analog_KeyboardScan.spin

Trying different values for ScanCnt resulted in the program hanging (via Gear) or ScanCnt counting down to zero via the djnz ScanCnt, #MainLoop statement then jumping to a much higher value. It should have been reset to the starting value in the StartNewScan routine.

I see the Attach xxxx Attach in the edit window but I see nothing in Preview so maybe the spin file is not attached. If not I'll repost
Sign In or Register to comment.