View Full Version : Debugger for Basic Stamp?
02-27-2005, 04:00 PM
Is there any kind of source level debugger for the Basic Stamp? Something similar to what the Javelin has.
02-28-2005, 03:50 AM
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.
02-28-2005, 05: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?
02-28-2005, 06: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.
This information is from our "Knowledge Base" at this link:
02-28-2005, 10: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.
02-28-2005, 11:10 AM
And I suppose Parallax has no plans to make any kind of debugger/simulator?
02-28-2005, 11:44 AM
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.
03-01-2005, 10: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.
03-01-2005, 10: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.
Applications Engineer, Parallax
Dallas, TX· USA
03-01-2005, 02:43 PM
Thanks Ken and Jon.