Shop OBEX P1 Docs P2 Docs Learn Events
Cant debug with SX-Key v3.10 — Parallax Forums

Cant debug with SX-Key v3.10

DavidAHouseDavidAHouse Posts: 6
edited 2006-06-30 09:11 in General Discussion
When I chose the 'Debug' option from the menu, the program compiles and downloads to the SX28 just fine. But when the debug windows come up, it just shows a status of Running, and the Step buttons are all disabled. The code window has the Reset command highlighted in the code, and never moves. The program runs fine when I choose just the 'Run' option. What all can cause this? Could it be the serial port on the PC?

My setup seems to work fine except for the debug part. Any ideas are appreciated.

Comments

  • BeanBean Posts: 8,129
    edited 2006-06-27 13:55
    David,
    Can you post your code ?
    What frequency are you clocking the SX at ?
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "I reject my reality, and substitute yours." NOT Mythbusters
    ·
  • DavidAHouseDavidAHouse Posts: 6
    edited 2006-06-27 14:10
    Here is the code:
    ; Set device to SX28, enable external high speed oscillator
            DEVICE     SX28L, STACKX, OPTIONX, TURBO
            IRC_CAL IRC_FAST
    
            RESET    Start        ; set restart vector to start of code
            FREQ     10_000_000
    
    ; Variable storage
    count1        EQU    $08
    count2        EQU    $09
    
            ORG $000
    Start        
            ; Initialize I/O controller for Pico Edition A->Input, B->Output, C->Output
    
            mov    w, #$1F        ; Set mode register to write direction register
            mov    m,w
    
            mov     RA, #%00000000    ; Set port A output latch to zero
            mov    !RA, #%00000000    ; Set port A direction
    
            mov     RC, #%00000000    ; Set port C output latch to zero
            mov    !RC, #%00000000    ; Set port C direction
    
            mov     !RB, #%11111111 ; Set port B direction 
            mov    w, #$1E        ; Set mode register to write pullup resistor
            mov    m,w
            mov    !RB, #%00000000 ; Set joystick inputs pullups on (0=on, 1=off)
    
    ; /////////////////////////////////////////////////////////////////////////////
    ;  Main Program Loop
    ; /////////////////////////////////////////////////////////////////////////////
    Main        
            mov    W,/RA        ; grab inverse RA
            mov    RA,W        ; and store it back in RA
            
            REPT 10    
            call    delay        ; delay to slow down blinking
            ENDR
    
            jmp    Main        ; goto main                
    
    ; delay function counts 64K counts and returns
    Delay        clr    Count1      ; Initialize Count1, Count2    
            clr    Count2                            
    
    Loop        djnz    Count1,loop    ; Decrement until all are zero        
            djnz    Count2,loop                        
            RET            ; then return                
    
    



    And i'm clocking at 10Mhz. This code just blinks a bank of 4 LEDs. Nothing special.

    Thanks.
  • BamseBamse Posts: 561
    edited 2006-06-27 14:50
    David,

    I had a similar problem earlier with my laptop...
    Have you tried the infamouse FIFO buffers ???

    http://forums.parallax.com/forums/default.aspx?f=7&m=130333

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Living on the planet Earth might be expensive but it includes a free trip around the sun every year...

    Experience level:
    [noparse][[/noparse] ] Let's connect the motor to pin 1, it's a 6V motor so it should be fine.
    [noparse][[/noparse] ] OK, I got my resistors hooked up with the LEDs.
    [noparse][[/noparse]X] I got the Motor hooked up with the H-bridge and the 555 is supplying the PWM.
    [noparse][[/noparse] ] Now, if I can only program the BOE-BOT to interface with he Flux Capacitor.
    [noparse][[/noparse] ] I dream in SX28 assembler...

    /Bamse
  • BeanBean Posts: 8,129
    edited 2006-06-27 15:07
    You don't have a resonator or xtal connected do you ?

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com

    "I reject my reality, and substitute yours." NOT Mythbusters
    ·
  • DavidAHouseDavidAHouse Posts: 6
    edited 2006-06-27 20:00
    Bamse, I did find that thread earlier, but I don't think I read your solution closely enough. I saw the bit about being a laptop and stopped reading. I have a desktop, but it sounds like your solution might work. I'll try that when I get home today.

    Bean, no, just a serial cable to the SXKEY directly.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-06-27 23:09
    David,

    ·· the crystal or resonator wouldn't be plugged in between the computer and the SX-Key, it would be plugged into the OSC pins on the SX.· If you have the SX Tech Board there is a socket for it.· Do you have one installed?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • DavidAHouseDavidAHouse Posts: 6
    edited 2006-06-28 01:40
    I don't have the crystal connected to the SX. Just using the SXKEY to generate the OSC for the chip. Also removing FIFO from the COM port didn't make a difference either.

    BTW: I'm using a kit from Andre Lamothe that includes the SX28, breadboard and the SXKEY.

    And it programs and runs just fine, its just the debug option that doesn't work at all. Also, I'm using Windows XP.

    Any other ideas??
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-06-28 18:57
    It is possible to damage the SX key in a way that causes exactly this problem.

    I have done it twice already. sad.gif

    If you put voltage onto one of the oscillator inputs of the SX key it will break in exactly the way you describe.

    It will program and read but debug just says "running" and can't do anything else.

    If you plug in the SX key so that only 3 of the header pins go into the socket this will happen.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • RsadeikaRsadeika Posts: 3,837
    edited 2006-06-28 20:58
    Back in Nov or Dec of last year Guenther had a post describing how to test the SX-key to see if has been damaged. I cannot remember the name of the post, so you may have to do some searching for the post.

    Have you tried a very simple·program to see if you can get that to step through? I know that I have had some programs that were doing exactly what you have described, my SX-key was still good.
  • DavidAHouseDavidAHouse Posts: 6
    edited 2006-06-28 23:45
    I've come to the conclusion that the problem is probably a fried SXKEY. Not totally fried since it will program the SX28, but fried enough so the debugging doesn't work. Looking at Guenther's thread, this seems to be something pretty common. Its highly possible that I plugged the thing in backwards at some point, or did something else dumb with it. I tried my best to be as carefull as possible, but accidents do happen. For now I'll live without the debugger.

    Thanks for all the suggestions.
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-06-29 09:10
    David,

    more than once, I have attached the SX-Key the wrong way by mistake without frying it. Both OSC pins have resistors in series on the SX-Key, protecting the on-board SX20's port pins to a certain extent. When you plug the SX-Key in reversed orientation, the OSC1 pin goes to GND, the OSC2 pin to Vdd, and the SX-Key`s Vdd and Vss pins are connected to the target device's OSC1 and OSC2 pins. This means that the components on the SX-Key can never "see" a wrong polarity on the power supply lines. So according to my experiences, electrostatic discharges are the most common causes for frying the SX-Key.

    When you can write, read and run with an SX-Key, the SX20 port pins controlling the target's OSC1 and OSC2 pins must be ok as both are needed for these operations. This also confirms that the Vpp generator on the SX-Key works (otherwise you could not program a device), and the variable clock also works, or you could not run the target.

    On the other hand, for debugging, the same two port pins pins are used, so when you can read write the device, the communication between the SX-Key and the target should also work for debugging.

    Maybe, this is a stupid suggestion:

    Did you make sure that you have programmed the target for debugging, i.e. by selecting Run - Debug from the SX-Key IDE? When you have programmed the target using Run - Program, and then start the debugger via Run - Debug (reenter), it won't debug, and also show "Running" instead.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • DavidAHouseDavidAHouse Posts: 6
    edited 2006-06-29 11:08
    Guenther,

    I have only used Run - Debug. I don't think I've tried the Run - Debug (reenter).

    Could it be the version of the SXKEY IDE? The kit I have came with the 3.0 version, but I reformatted the computer that its connected to and just downloaded 3.1 from the Website.
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-06-29 22:58
    David,

    I'm also using the most recent version of the SX-Key IDE here w/o problems, so I don't think that this is the cause for your problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
  • ElectronegativityElectronegativity Posts: 311
    edited 2006-06-29 23:07
    Guenther, the damage does not occur by plugging the SX key in upside-down, it occurs if you plug only 3 prongs of the header into the SX key.

    If you don't believe me then try it yourself.

    It will program, but if you try to debug it says "running" and that's all it does.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I wonder if this wire is hot...
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2006-06-30 09:11
    Electronegativity,

    ok - now I got you, and I believe you w/o trying to fry an SX-Key myself smile.gif .

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    G
Sign In or Register to comment.