Shop OBEX P1 Docs P2 Docs Learn Events
Debugger for Basic Stamp? — Parallax Forums

Debugger for Basic Stamp?

richard_hrichard_h Posts: 11
edited 2005-03-01 07:43 in BASIC Stamp
Is there any kind of source level debugger for the Basic Stamp? Something similar to what the Javelin has.

Thanks,
Richard
·

Comments

  • allanlane5allanlane5 Posts: 3,815
    edited 2005-02-27 20:50
    Nope.

    I think debugging was intended through SEROUT statements, like:

    DEBUG [noparse][[/noparse]"Hi", CR]

    or SEROUT 16, 16384, [noparse][[/noparse]"Hi",CR]· ' Same thing.

    So, you can 'sprinkle' debug statements in your code.
    To create a pause, you can use:

    SERIN 16, 16384, [noparse][[/noparse]Val]· ' This will wait until you input a CR at the 'Debug' window.
    ·
  • richard_hrichard_h Posts: 11
    edited 2005-02-27 22:02
    But is that the ONLY way to debug a Basic Stamp program? Are there no "source level" debuggers (either from Parallax or a 3rd party) that provide functionality such as single stepping, breakpoints, watch variables, etc?

    Richard
    ·
  • dandreaedandreae Posts: 1,375
    edited 2005-02-27 23:05
    How do I debug my PBASIC programs?
    You may use two features of the BASIC Stamp editor to debug your PBASIC program: 1) Syntax checking, and 2) the DEBUG command. Syntax checking alerts you to any syntactical errors and is automatically performed on your code the moment you try to download to the BASIC Stamp microcontroller. Any syntax errors will cause the download process to abort and the editor will display an error message with a highlight cursor pointing to the source of the error in your code. Logical errors are sometimes more difficult to find but may be more easily discovered by using the DEBUG command. Debug operates similar to the PRINT command in the BASIC language and can be used to print the current status of specific variables within your PBASIC program as it is executed within the BASIC stamp microcontroller. If your PBASIC code includes a DEBUG command, the editor opens up a special window at the end of the download process to display the results for you. In the Windows editor, the Debug window (called the Debug Terminal) can be left open, while you edit your code.
    Dave

    This information is from our "Knowledge Base" at this link:
    http://www.parallax.com/html_pages/tech/faqs/prgm_info.asp#How_do_I_debug_my_PBASIC_programs

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    www.parallax.com

    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-02-28 03:49
    Since the BS2 only supports 2K bytes of code, it should be fairly straightforward to debug using DEBUG statements. I must admit, it was one of my early dissapointments that there was no single-step debugger for the BS2.

    And as far as I know (after two years experience with the module) there is no after-market simulator for the BS2.
  • richard_hrichard_h Posts: 11
    edited 2005-02-28 04:10
    Thanks, Allan.

    And I suppose Parallax has no plans to make any kind of debugger/simulator?

    Richard

    ·
  • Ken GraceyKen Gracey Posts: 7,387
    edited 2005-02-28 04:44
    Richard,

    No, there are no product plan for a more detailed debugger. There's a simulator available from LabCenter (Proteus) in the U.K., but I find it easier to use the actual hardware.

    Sincerely,

    Ken Gracey
    Parallax, Inc.
  • richard_hrichard_h Posts: 11
    edited 2005-03-01 03:36
    I'm curious, Ken.

    Can you tell me why no debugger is planned? Is it impossible, impractical, or perhaps there's just not enough interest in such a tool. I've used debuggers in the past and they have been a life saver; more times than not.

    Regards,
    Richard
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-03-01 03:55
    It is an impracticality thing. To have a live debugger requires extra code inside the BASIC Stamp, and there is just no room. The whole point of the DEBUG instruction (a derivative of SEROUT, so requires not internal code space) is to allow you to send information to the outside world. With conditional compilation you can easily switch DEBUG statements on and off.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas, TX· USA
  • richard_hrichard_h Posts: 11
    edited 2005-03-01 07:43
    Thanks Ken and Jon.

    Richard
Sign In or Register to comment.