Shop OBEX P1 Docs P2 Docs Learn Events
debug — Parallax Forums

debug

ArchiverArchiver Posts: 46,084
edited 2003-02-20 14:34 in General Discussion
Hi:
Where can I find the debug commands for programming stampplotpro?
I dont find them in the basic stamp manual.
I'm a little confused.
I have the Industrial controls manual and I have to work with what
they have. I would like to write my own programs but need a little
help from someone.
Thanks
Jim

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2000-10-15 03:24
    They are all in Appendix A: of Industrial Controls

    --- In basicstamps@egroups.com, "James Hardy" <jahardy33@h...> wrote:
    > Hi:
    > Where can I find the debug commands for programming stampplotpro?
    > I dont find them in the basic stamp manual.
    > I'm a little confused.
    > I have the Industrial controls manual and I have to work with what
    > they have. I would like to write my own programs but need a little
    > help from someone.
    > Thanks
    > Jim
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-08 19:21
    I am finding the debug function on the BS2 editor to be very confusing. Does
    anyone have a suggestion about better documentation than is in the stamp2
    book?
    Patty
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-08 23:34
    Scott Edwards electronics make a great book called "Counterfeit", its only
    related to the bs1, but it is the best stamp documentation around. Great
    sample code and explanation of each command. Once you look at that for a
    while its easy to relate it to bs2 etc.
    Chris

    Original Message
    From: <gehring.2@w...>
    To: <basicstamps@yahoogroups.com>
    Sent: Monday, April 09, 2001 2:21 AM
    Subject: [noparse][[/noparse]basicstamps] Debug


    > I am finding the debug function on the BS2 editor to be very confusing.
    Does
    > anyone have a suggestion about better documentation than is in the stamp2
    > book?
    > Patty
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-09 00:11
    Hi Chris

    Sounds like a book that I could use too.
    Where can one obtain a copy.

    TIA
    Sean

    > Scott Edwards electronics make a great book called "Counterfeit", its only
    > related to the bs1, but it is the best stamp documentation around. Great
    > sample code and explanation of each command. Once you look at that for a
    > while its easy to relate it to bs2 etc.
    > Chris
  • ArchiverArchiver Posts: 46,084
    edited 2001-04-09 01:57
    There are links at the Parallax website to Scott Edwards electronics, but I
    am in Australia and got it from our distributor.
    Chris
    Original Message
    From: Sean Gibson <seangib@h...>
    To: <basicstamps@yahoogroups.com>
    Sent: Monday, April 09, 2001 7:11 AM
    Subject: Re: [noparse][[/noparse]basicstamps] Debug


    > Hi Chris
    >
    > Sounds like a book that I could use too.
    > Where can one obtain a copy.
    >
    > TIA
    > Sean
    >
    > > Scott Edwards electronics make a great book called "Counterfeit", its
    only
    > > related to the bs1, but it is the best stamp documentation around. Great
    > > sample code and explanation of each command. Once you look at that for a
    > > while its easy to relate it to bs2 etc.
    > > Chris
    >
    >
    >
    >
    >
    > Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
    >
    >
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-20 13:51
    Bob here, I am working some simple LED examples with the BOE kit. Can some
    one point me to a good explanation of how to use the debug commands to help
    trouble shoot programs ??

    I have read what the manual says and its a little fuzzy to me.

    Bob
  • ArchiverArchiver Posts: 46,084
    edited 2003-02-20 14:34
    Hi Bob,

    There are two techniques that are useful when doing this kind of
    debugging. One is to "look inside" your program and the other is to
    "divide and conquer".

    Let's say you write the following program (not a great program, but it
    makes my point):

    X var byte
    Loop:
    X=1
    Gosub process_x
    X=X+1
    If x>10 then exit_loop
    Goto Loop

    Exit_loop:
    Debug ?x

    ######
    Now, just looking at this you may or may not see what is wrong with it.
    So you might want to "look inside" and put "Debug ?x" somewhere inside
    the loop. Then it will become painfully obvious what the problem is.

    Divide and conquer is good when you aren't sure about the flow of your
    program. This like troubleshooting an old radio. Cut it in half and
    decide if the problem is in the first half, or the second half. Repeat.
    Eventually you'll get such a small cut that you know where the problem
    is. Let's say you have this program:

    Main:
    gosub setup_xmit
    x=INA
    gosub send_data
    gosub wait_ack
    pause 5000
    Goto Main

    When you run this, nothing seems to happen. Why? One way to tell might
    be:

    Main:
    debug "Calling setup_xmit..."
    gosub setup_xmit
    debug "Returned",cr
    x=INA
    debug "Sending data..."
    gosub send_data
    debug "Returned",cr
    debug "Waiting..."
    gosub wait_ack
    debug "Returned",cr
    pause 5000
    Goto Main

    Now you can see what is happening:

    Calling setup xmit....Returned
    Sending data...

    Ok, so something is hanging in send_data. Your next step is to modify
    send_data so you can see the steps there until you can find the part
    responsible for hanging the program.

    In the bad old days, it was common to try to reserve 3 or 4 bits of I/O
    for a debugging port. You could output a binary number on a logic
    analyzer or LEDs to see the progress of your program like this. I
    actually did a 6805 system back in the 80s that beeped out diagnostics
    in Morse code on a speaker :-)

    Hope that helps!

    Al Williams
    AWC





    >
    Original Message
    > From: ROBERT PHILLIPS [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=FjjHgFHxMOe9UQGFfKMu9KBRafENMykdPkxOjP7sAOlQmt2uyfmVlSXmCfQW7ulPWqL6KXT0QVc]robertp@v...[/url
    > Sent: Thursday, February 20, 2003 7:52 AM
    > To: basicstamps@yahoogroups.com
    > Subject: RE: [noparse][[/noparse]basicstamps] Debug
    >
    >
    >
    > Bob here, I am working some simple LED examples with the BOE
    > kit. Can some one point me to a good explanation of how to
    > use the debug commands to help trouble shoot programs ??
    >
    > I have read what the manual says and its a little fuzzy to me.
    >
Sign In or Register to comment.