Shop OBEX P1 Docs P2 Docs Learn Events
ISD Mode/Writing Debug Procedures — Parallax Forums

ISD Mode/Writing Debug Procedures

AlexVAlexV Posts: 2
edited 2004-09-08 04:18 in General Discussion
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?

Comments

  • James NewtonJames Newton Posts: 329
    edited 2004-09-06 17:15
    turn.gif·s far as I know rolleyes.gif and I don't know much·blush.gif· the "hidden" breakpoint registers trigger an interrupt and the debugger code that is loaded for SXKey support then pushes all the registers (not just W nono.gif·) into their hidden registers.cool.gif They work by transferring values from (through) W and the debug code MUST preserve W so idea.gif if pushing W triggered debug mode, then it could not be the first instruction since all the other registers could not be saved. See? smilewinkgrin.gif Did that make any sense? shakehead.gifyeah.gif

    I would guess·devil.gif·that the best way to find out how debug mode is triggered would be to decompile·smhair.gif·the debug code. But this would be "reverse engineering" shocked.gif··and can get you arrested by mean people with guns·freaked.gif in black helecopters·skull.gif··Wouldn't that be sad?·cry.gif·

    There are *12* undocumented instructions! redface.gif Four new push instructions that push W onto the W, FSR, STATUS, and PC “shadow registers,” which are actually 2-level stacks; There appears to be a secret FIFO for saving and restoring values and a breakpoint register or two.scool.gif

    Hey!·hop.gif·Who said that?·jumpin.gif·That is·secret information!·confused.gif

    ·wink.gif Of course, you posted this to the right place,·eyes.gif since Parallax makes a commercial product that your device would compete with,mad.gif I'm sure you will get lots of help.·lol.gif· And the pretty birds sing so nicely...·roll.gif

    Wow! I really love these smurfy emoticons.smurf.gif They are sooo professional on a technical forum.·turn.gif I'm sorry I ever objected to them...sad.gif Did I get them all? What is the difference between·tongue.gif ([noparse]:p[/noparse]) and·tongue.gif (tongue)?

    Anyway, good luck with your project.smile.gif·I wish I had more time to help, but·it's time for my lunch.·burger.gif
  • AlexVAlexV Posts: 2
    edited 2004-09-06 18:38
    I've actually got the ISD documentaiton so I'm aware of how it's all supposed to work. However, actually implementing it is a different story and I'd like to know if anyone's written their own ISD debug routines (or at least worked on some at some point).
  • edited 2004-09-06 21:47
    I don't think you got enough emoticons in that message·[noparse]:)[/noparse]

    How does a person get the ISD documentation for the SX processors?
  • James NewtonJames Newton Posts: 329
    edited 2004-09-07 05:09
    Stanley Frederickson said...

    I don't think you got enough emoticons in that message·[noparse]:)[/noparse]

    I used one of each and each one once... I think. I thought they made my post look so much more professional...
  • Jim EwaldJim Ewald Posts: 733
    edited 2004-09-07 17:26
    The emoticon saga will become optional soon. I'm working on it as fast as I can. The code that manages them is peppered throughout the system, so it's taking longer than I expected to filter them out. Thanks for the dramatic demonstation. smile.gif

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jim

    Parallax IT Dept.
  • James NewtonJames Newton Posts: 329
    edited 2004-09-07 19:34
    IT Guy (Parallax) said...
    The emoticon saga will become optional soon. I'm working on it as fast as I can. The code that manages them is peppered throughout the system, so it's taking longer than I expected to filter them out. Thanks for the dramatic demonstation. smile.gif

    Just keeping it interesting... There is an old chinese curse about "living in interesting times..."

    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
  • Ken GraceyKen Gracey Posts: 7,407
    edited 2004-09-08 04:18
    AlexV,

    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
Sign In or Register to comment.