Shop OBEX P1 Docs P2 Docs Learn Events
Debugger reporting Sleeping — Parallax Forums

Debugger reporting Sleeping

UghaUgha Posts: 543
edited 2009-02-24 11:20 in General Discussion
I'm attempting to debug a program using several WATCH commands but something strange keeps happening.

Debug keeps saying that the SX is sleeping even when I don't have a sleep or end·command in the code.

I know·only three reasons for this (I've searched through the info I have with no other result)...

1: The chip is actually asleep
2: Attempting to run the debugger while having an external clock plugged in.
3: The chip is held in reset (brownout or other reason)

I've tested the program and it runs fine (besides the problem I'm trying to debug) with an external clock
or using the SX-key's internal clock. The only time this happens is in the actual debugger.

Can anyone suggest another reason why the debugger would report the chip is asleep?

The reason why I'm nervous is my SX tech toolkit was a refurbished one so I'm worried that it has some kind
of flaw in the SX-key or something.

Comments

  • JonnyMacJonnyMac Posts: 9,214
    edited 2009-02-20 18:20
    My partner found that if you have 10K resistor across the OSC pins (we do on one of our boards) this can create an issue with the USB SX-Key in debugging mode. When we removed that from the circuit we could debug just fine. That said, the new Key seems to prefer 20MHz.
  • pjvpjv Posts: 1,903
    edited 2009-02-20 18:22
    Ugha;

    1 Does the seep condition remain when the RESET button on the debugger is activated?

    2 Does the seep condition remain when the RESET line (MCLR) on the chip is pulled low? (I presume you have a pullup resistor on that)

    3 I your watchdog timer set to 006?

    Cheers,

    Peter (pjv)
  • UghaUgha Posts: 543
    edited 2009-02-20 18:59
    JonnyMac: It's the SX tech board, so I haven't added any additional resistors (Although that's good to know since I intend to build my own project board in the future, thanks!).
    I'll also try adjusting the clock to 20mhz and see if that makes a difference.

    Pjv:
    1: The sleep condition clears to Idle when I hit the reset button on the debugger and then goes to Sleeping again about 95% of the time once I hit run.
    2: I have it on the SX tech board so I'm pretty sure there's no pullup resistor on it. I'll try out hitting the reset button later this afternoon when I get a chance to work on it again.
    3: I don't have the watchdog timer enabled.

    Thanks for the help guys... its very frustrating to not be able to use debug.
  • Shawn LoweShawn Lowe Posts: 635
    edited 2009-02-20 19:01
    Are you using the USB SX programmer? I have heard some people having this problem with them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Shawn Lowe


    When all else fails.....procrastinate!
  • UghaUgha Posts: 543
    edited 2009-02-20 19:04
    No, I'm using the serial SX-key.
  • RS_JimRS_Jim Posts: 1,771
    edited 2009-02-24 05:11
    Hi,

    I just spent a frustating day· with my SX28 going to sleep.· I was using a serial SX-Key for debuging.· When I connected the ground of the sx board to the ground of the Motor drive board, the unit would go to sleep.· I put a voltmeter between the grounds of the two power supplies and found a three to four volt difference between them.· I tried using a common supply with a second regulator to down regulate the motor drive voltage to the 9 volts wanted by the tech board.· Still would go to sleep when I connected the PWM output to the MOSFET driver.· My solution is going to be an OPTO isolator to drive the MOSFET so that I can electrically Isolate the motor from the logic. Will pick up an infared driver/receiver pair at radioshack tomorrow and make that an optoisolator.
  • UghaUgha Posts: 543
    edited 2009-02-24 11:20
    I had something like that myself... I had a BOE connected to my SX tech board. Perhaps it has something to do with two power supplies being shared?
Sign In or Register to comment.