Shop OBEX P1 Docs P2 Docs Learn Events
No Debug step, walk and run buttons are disabled — Parallax Forums

No Debug step, walk and run buttons are disabled

warnerwarner Posts: 17
edited 2007-04-08 07:19 in General Discussion
I can’t seem to get the debug program to work the step, walk and run buttons are disabled. Also I received a key ring with my SX Tech Tool Kit Plus, I seem to remember a paper that came with it that I can not locate, explaining something about the programmable clock could you provide me with that paper? Dose the key ring require its own power in addition to the power that is attached to the SX Tech Board? Do I need to use the key ring to get the Debug to work? Where can I find an up-to-date example of using the debug?

Comments

  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-03-26 00:01
    warner,

    You don’t need to use the Key Ring at all to program unless the device you’re programming runs at less than 5V. If that is the case and you do use it then yes, you do need a power supply connected to the Key Ring. Do you have a Crystal or Resonator installed in the circuit you’re trying to DEBUG? The DEBUG operation won’t work if you do. I hope this helps. Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • warnerwarner Posts: 17
    edited 2007-03-26 00:30
    O.K so what would cause the step, walk and run buttons to be disabled
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-03-26 00:32
    Debug won't work with the resonator in place
  • warnerwarner Posts: 17
    edited 2007-03-26 00:41
    Resonator is not inserted step, walk and run buttons are still disabled
  • warnerwarner Posts: 17
    edited 2007-03-26 00:43
    downloaded debug demo step, walk and run buttons are still disabled

    ;REVISIONS:
    ; 06/09/98 Original release.
    ; 09/17/04 Updated to support SASM.
    ;
    ;CONNECTIONS:
    ; None.
    ;
    ;DETAILS:
    ; Program the SX chip using the Run -> Debug (or CTRL+D) option. Then
    ; click the Step button to step through each instruction (taking note
    ; of the changes on screen) or use the Poll button to run full speed
    ; with updates to the display every loop iteration. The Watch window
    ; shows the values of registers IncReg, DecReg and NotReg in decimal.
    ; NOTE: You must disconnect any crystal or resonator from the SX chip
    ; in order to properly debug since the SX-Key will need to provide the
    ; clock signal.
    ;=======================================================================

    ;
    DEVICE DIRECTIVES

    DEVICE SX28,OSCHS2,TURBO

    IFDEF __SASM ;SASM Directives
    DEVICE STACKX,OPTIONX
    IRC_CAL IRC_SLOW

    ELSE ;Parallax Assember Directives
    DEVICE STACKX_OPTIONX
    ENDIF

    RESET Main

    ;
    VARIABLES

    IncReg EQU 8 ;The register to increment
    DecReg EQU 9 ;The register to decrement
    NotReg EQU 10 ;The register to invert

    ;
    DEBUG SETTINGS

    FREQ 50_000_000

    ;Create watch window to display values of registers in unsigned decimal.
    WATCH IncReg,8,UDEC
    WATCH DecReg,8,UDEC
    WATCH NotReg,8,UDEC

    ;
    MAIN PROGRAM

    Main
    ;Increment IncReg, decrement DecReg and invert NotReg in a loop.

    inc IncReg ;Increment IncReg
    dec DecReg ;Decrement DecReg
    not NotReg ;Invert NotReg
    break ;Break to update display
    jmp Main ;loop
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2007-03-26 01:21
    I looked at your program.· Is that all of it?

    Isn't a PROGRAM Directive required?

    PROGRAM Label {NOSTARTUP}

    The PROGRAM directive sets the execution start point (at a label) for the SX/B program. Note that the PROGRAM directive must appear after the (optional) INTERRUPT hander, and in the first code page ($000 - $199).

    When the NOSTARTUP option is used the SX/B compiler will not insert the normal start-up code that pre-initializes all RAM addresses to zero; in this case the programmer is responsible for appropriate initialization, except the FSR which is cleared (see BANK, below).
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-26 01:47
    The PROGRAM directive only applies to SX/B -- the program listed above is Assembly and runs fine on my desk (using SX-Key IDE v3.2.3) in Debug mode.

    Note to Warner: RAM addresses are not cleared automatically so the values of your registers will be random when you start the program. And you might want to change your WATCH type for notReg to UBIN so that you can see the bits flip.
  • warnerwarner Posts: 17
    edited 2007-03-26 02:46
    the step, walk and run buttons are still disabled thay are not working ! What could cause this?
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-03-26 03:40
    Sorry if these are redundant suggestions, but you might want to check...

    ... that you are using the SX-Key and not the SX-Blitz
    ... that you don't have any clock source connected to the SX
    ... that have the latest IDE (v3.2.3) and have restarted it

    I simply copied your program from the post and pasted it into the editor, save it, then ran it in Debug mode -- worked fine.
  • warnerwarner Posts: 17
    edited 2007-03-26 05:36
    My SX-Key must be bad I tried it on anouther computer and still no good>
  • Capt. QuirkCapt. Quirk Posts: 872
    edited 2007-03-26 05:46
    your code worked for me
  • PJMontyPJMonty Posts: 983
    edited 2007-03-28 00:37
    Warner,

    What steps are you taking to get into debug mode? Are you using the "program" option followed by "Debug again", or using the "Debug" option. The first won't work, and the second will. Folks are sometimes confused about the whole "program" versus" debug" versus "debug again" thing.

    Thanks,
    PeterM
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2007-03-28 10:37
    I had the same thing happen to me last night to my SX52 protoboard. I think I did something wrong with the power (I had the power going to Vdd not Vin on my PDB - when I notices a slight smell and the SX52 got hot. I connect correct power to the PDB and tested and all worked on that but the SX52 protoboard did not. On the SX52 protoboard in Debug mode, the Step, Walk and Run buttons are ghosted out or disabled and it says SLEEPING. As Capt. Quirk stated - I saw this issue in the past in that by using a resonator with DEBUG turned on, it can kill your SXKEY (DEBUG circuits only). However, in this case, I tested my SX-Key on another SX28 on my PDB and it worked fine but just not on my SX52 protoboard with any program. It appears to program ok - but I don't think the programs run and DEBUG did not either. Luckily the SX52 protoboard is only a $10 replacement (which I bought an extra one) - now just all the unsoldering of RA, RB, RC, RD and RE this weekend to my other SX52 protoboard (as I have a 16x16 LED matrix connected to RB,RC,RD and RE and control on RA).

    What you should do is connect the SXKEY to another SX chip and see if it can first program the chip and then also go into DEBUG mode.
  • xtricityxtricity Posts: 25
    edited 2007-04-03 00:17
    I had the problem with the ghosted out Walk, Run, Step for a few days. I solved it yesterday, but I'm not sure how. In my case, I adjusted the oscillator to OSCHS3 and the frequency to 50Mhz. For some reason, this got it working again. I did notice that I one of the power supply filter capacitors had come out on my breadboard. So, maybe the power was fluctuating? I have no idea. I had some problems before with the SX key when I didn't have the power stable at 5VDC. This is probably not helpful except for the fact that I'm sympathetic since I just had this problem. I can use the debug now.

    BTW, I'm new to this whole SX-Key thing. I can't figure out to to store and run a program after I disconnect the power from the SX-Key and chip. I'm learning about this whole process from the fine book, "Beginning Assembly for the SX Microcontroller." I can go through the examples just fine. However, I have to load and run the program from the program every time to run it. I can also ground the reset pin and that will restart the program. However, when I disconnect the power and then reconnect it, the program doesn't run again automatically on power on. Is there something I need to do? I don't have an external clock. I'm using the clock on the SX-Key.
  • Sparks-R-FunSparks-R-Fun Posts: 388
    edited 2007-04-03 16:29
    xtricity,

    If the SX is already programmed when you re-enter the SX IDE, try clicking on the clock icon (or Run | Clock from the menu) and setting the desired clock frequency. If you previously programmed the SX for DEBUG, click the black spider under a red circular arrow icon (Run | Debug (reenter) from the menu).

    I hope this helps.

    - Sparks
  • xtricityxtricity Posts: 25
    edited 2007-04-05 01:02
    Sparks, thanks for the info.

    I think my basic problem was not specifying the internal oscillator and not having an external oscillator up. It doesn't seem like the oscillator in the SX-Key is providing cycles automatically on power reset. Though, I could be wrong.

    For everyone else, I'm using the device directive OSC4MHZ and then IRC_CAL IRC_4MHZ to run off the internal clock.

    I read through the FAQ and found this. If you're using a breadboard like me and not the SX Tech board, then it's easy to move some wires around, especially with the physical attachment and detachment of the SX Key. So, maybe you plugged the MCLR pin back in wronge on the OSC1 or OSC2. I'm thinking of buying the tech board or the PDB specifically to avoid the wiring coming out. Since I'm a novice, it's easy for me to suspect the code or the physical hardware itself. So far it has turned out to be my user error in every case.

    The Debugger starts in running mode

    Q: On my SX 28, when I choose Debug, the debug window comes up RUNNING and the options for Poll-
    ing, Run, Stop etc. are gray and I cannot single-step through my program.

    A: One reason might be that you have previously programmed the SX selecting “Run – Program” and
    then selected “Run – Debug (reenter)”.

    The reason is that there is a difference between “Program” and “Debug”. When you choose “Program”, the
    only code sent to the SX is the code you wrote. When you select “Debug” instead, not only is your code
    sent, but a little piece of special code is also appended. This additional code is required to enable the SX-
    Key to properly control and communicate with the chip while debugging.

    The option “Run – Debug (reenter)” is meant to continue a previous debugging session, assuming that no
    changes have been made to the code in the meantime. Therefore, the code is not sent into the SX device
    again, saving the time required to do this. The IDE expects that the required debugging code is available
    in the chip, though. When this is not the case (because the chip was not programmed for debugging), the
    debugger can’t communicate with, or control the chip. Therefore, it indicates “RUNNING” only, and does
    not allow any other options.

    Another reason for the debugger starting in running mode is that a resonator, crystal, or an external clock
    source is connected to the OSC1 and OSC2 pins in parallel to the SX-Key. Although the chip can usually
    be programmed in this configuration, debugging is not possible. Remove or disconnect the external
    clocking device to allow for debugging.

    Another cause for the debugger to display the “RUNNING” status is when the MCLR* pin is pulled low by
    some reason. In this case, the SX is definitely not running but held in reset state. It seems as if the De-
    bugger reports “RUNNING” whenever it cannot communicate with the SX.
  • xtricityxtricity Posts: 25
    edited 2007-04-08 05:38
    After further investigation, I think the source of the problem for the ghosted step, walk, ran was a loose connection on the filtering capacity on pins 2 and 4. I should buy a pack of 0.1 uF and a pack of 1.0 uF capacitors and stick them in a parts bin. Actually, what I should really do is bite the bullet and buy the PDB. The debug seems to be a little more sensitive to power issues than simply loading and running the program. Maybe the physical connection of the power supply or the SX-Key pins are loose on your board? For some reason, the 7805 voltage regulator I'm using seems to need more than 6VDC input.

    Anyway, my main point is that you may want to check your power.
  • JonnyMacJonnyMac Posts: 9,214
    edited 2007-04-08 07:19
    The 7805 is not an LDO regulator and will need more than 6.0v -- use the LM2930-5.0 instead, that's what Parallax puts on its products.
Sign In or Register to comment.