ISD Mode/Writing Debug Procedures
I'm not sure if anyone here has any experience with writing debug code or using ISD (In-System Debugging) mode, but I'm writing a debugger and am having some trouble, specifically with the DEBUG instruction.
As I understand it, setting up ISD mode is as simple as putting the
appropriate settings in the W register, then using the DEBUG instruction to
copy W into the DEBUG register. As long as the OSC_EN bit is set low
(meaning disabled), the internal oscillator should stop and the debug clock
signal is expected on OSC1.
I'm writing a test program that blinks a light using the internal oscillator
with no external oscillators connected. The light blinks as expected. I then
add the DEBUG instruction just before the main loop and re-run it. The
program should appear to stop running because the switch to ISD mode stops
the clock. However, it keeps running. It basically seems as if the DEBUG
instruction is not working.
Here's my macro for simulating the DEBUG instruction (since the mnemonic is
not supported by the assembler):
DEBUG ····MACRO
····DW ····%0000_0100_0100
ENDM ····; End DEBUG
I then use the instruction along with setting W like this:
MOV ····W, #$F7
DEBUG
Since OSC_EN is bit 3 in the DEBUG register, $F7 causes all bits to be high
except OSC_EN, thereby turning off the clock and invoking ISD.
I checked the disassembled output and the $44 opcode appears as expected
right after the MOV W, #F7 instruction. And yet, the main light blinking
loop keeps running. I've checked every detail I can think of, but DEBUG
doesn't seem to do anything.
Any ideas on what might be wrong?
As I understand it, setting up ISD mode is as simple as putting the
appropriate settings in the W register, then using the DEBUG instruction to
copy W into the DEBUG register. As long as the OSC_EN bit is set low
(meaning disabled), the internal oscillator should stop and the debug clock
signal is expected on OSC1.
I'm writing a test program that blinks a light using the internal oscillator
with no external oscillators connected. The light blinks as expected. I then
add the DEBUG instruction just before the main loop and re-run it. The
program should appear to stop running because the switch to ISD mode stops
the clock. However, it keeps running. It basically seems as if the DEBUG
instruction is not working.
Here's my macro for simulating the DEBUG instruction (since the mnemonic is
not supported by the assembler):
DEBUG ····MACRO
····DW ····%0000_0100_0100
ENDM ····; End DEBUG
I then use the instruction along with setting W like this:
MOV ····W, #$F7
DEBUG
Since OSC_EN is bit 3 in the DEBUG register, $F7 causes all bits to be high
except OSC_EN, thereby turning off the clock and invoking ISD.
I checked the disassembled output and the $44 opcode appears as expected
right after the MOV W, #F7 instruction. And yet, the main light blinking
loop keeps running. I've checked every detail I can think of, but DEBUG
doesn't seem to do anything.
Any ideas on what might be wrong?
Comments
I would guess·
There are *12* undocumented instructions!
Hey!·
·
Wow! I really love these smurfy emoticons.
Anyway, good luck with your project.
How does a person get the ISD documentation for the SX processors?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jim
Parallax IT Dept.
Err... when you say optional... do you mean that people VIEWING the post have the option of excluding them or that people COMPOSING a post have the option of inserting them? Or, best of all, that the people running the board, you in this case, have to option of disableing them entirely?
'cause it is hard as heck for me to concentrate on typing a message with that little green dude jumping up an down in the flames over there (how CAN you torture him so!?!?) so not seeing them when composing would be great, but also, trying to read a post as they "pop" into existance and move the text all 'round is also contra-concentrational so... well... Really, it would be nice if they would just LIE, LIE, LIE!!!!
Oops! Sorry, I have problems with my "D"s
Ubicom is responsible for deciding who gets the ISP/ISD specification. Parallax has a PDF file that can be provided if you obtain approval from Ubicom first. This would require explaining the need for the ISP/ISD specification, purpose, etc. The protocol would be provided entirely unsupported because I guarantee you'll need help deciphering it and you'll be on your own. Contact me off-line if you want the Ubicom connection.
- Ken Gracey