Debugger reporting Sleeping
Ugha
Posts: 543
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.
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
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)
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 Lowe
When all else fails.....procrastinate!
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.