PDA

View Full Version : Debugger for Basic Stamp?



richard_h
02-27-2005, 05:00 PM
Is there any kind of source level debugger for the Basic Stamp? Something similar to what the Javelin has.

Thanks,
Richard
·

allanlane5
02-28-2005, 04:50 AM
Nope.

I think debugging was intended through SEROUT statements, like:

DEBUG ["Hi", CR]

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

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

SERIN 16, 16384, [Val]· ' This will wait until you input a CR at the 'Debug' window.
·

richard_h
02-28-2005, 06:02 AM
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
·

dandreae
02-28-2005, 07:05 AM
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 (mailto:dandreae@parallax.com)
www.parallax.com (http://www.parallax.com)

·

allanlane5
02-28-2005, 11:49 AM
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_h
02-28-2005, 12:10 PM
Thanks, Allan.

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

Richard

·

Ken Gracey
02-28-2005, 12:44 PM
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_h
03-01-2005, 11:36 AM
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 Williams
03-01-2005, 11:55 AM
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_h
03-01-2005, 03:43 PM
Thanks Ken and Jon.

Richard