Shop OBEX P1 Docs P2 Docs Learn Events
does DEBUG stop the program if no PC? — Parallax Forums

does DEBUG stop the program if no PC?

charlieknoxcharlieknox Posts: 27
edited 2006-11-06 02:22 in BASIC Stamp
I have a simple program on a BS2, just on a breadboard with a home made serial cable (with no caps), a switch, and an LED, powered by a 9 volt battery with a 7805 regulator, also with no capacitors.··The program has·some DEBUG lines (it's at work, otherwise I'd attach it), and the program runs fine if the Stamp is hooked to the PC, and displaying data.· If the Stamp is not hooked to the PC, the program will not run (or stops when it gets to the first DEBUG.· If I attach the serial cable to the PC, the program will start fine.· If the PC is off, it won't work.· If I get the program going, hooked to the PC and running fine, if I unplug the serial cable, the program continues to run until the next DEBUG is encountered.· Apparently the BS2 editor does not need to be running, just the PC needs to be on and hooked up.· When the serial cable gets unhooked, the program ends at the next DEBUG.· When the Stamp is rehooked to the running PC, the program starts over from the beginning.

I guess I assumed that the program would continue to run regardless of whether the PC is hooked up, or on, or not.

Is this the way it is supposed to work?· I looked up the DEBUG command in the Help menu and the Stamp Manual, but didn't see anything about this (I may have missed it).

Thanks!

Charlie

Comments

  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-11-04 23:17
    It sounds like the RES line on the BS2 is causing issues. When connected to the PC, the DTR line is used to reset the stamp for progrmaming, and its state is controlling it. On typical BASIC Stamp boards there are capacitors with that line. It may need to be pulled high through a resistor to keep it from resetting continually.

    See the BS2 schematics at:
    http://www.parallax.com/dl/docs/prod/schem/bs2.pdf

    Though, in those even, I don't see a pull-up, so scratching my head a little, but sounds like the most likely problem.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-11-05 01:28
    Charlie (and Martin),
    ·
    ··· The RESET (/RES) line is pulled HIGH internally by a 10K resistor.· You do not need to add an external pull-up resistor.· Is anything connected to the /RES line?· How about the ATN line (besides the serial cable)?· Does this happen if you disconnect the home-made cable from the breadboard?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • charlieknoxcharlieknox Posts: 27
    edited 2006-11-05 03:34
    Thank you Martin and Chris for your replies. The /RES line is not hooked to anything. I get 5.01 volts from /RES to ground, the same as the Vdd pin. When all is disconnected, I get no continuity to any other pins. The ATN line is also not connected to anything else, other than pin 4 (DTR) of the serial cable. There is no continuity from this pin (#3) on the Stamp, or from the wire from pin 4 on the cable, to any other Stamp pins, however, when I remove this wire from the breadboard, the program works fine with the Stamp on it's own, not hooked to the PC.

    Do I need to install the two 0.1 uF capacitors on this line, as shown in the diagram Martin referred to in his message? I don't see a reference to the capacitors in the Basic Stamp Programming Manual 2.0C, on page 27, but will put them in if that will fix my problem.

    Thanks again, Guys !!

    Charlie
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-11-05 05:25
    Charlie,
    ·
    ·· It sounds as if your cable me be unshielded and when there’s data on the SOUT line it cause the DTR line to be affected when the cable is not connected.· Adding the capacitors may help, but without knowing the specifics of the cable this is just a guess.· A correct connection diagram for the BASIC Stamps is listed in the BASIC Stamp Manual which is available as a free PDF download from our website.· Take care.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • charlieknoxcharlieknox Posts: 27
    edited 2006-11-06 00:54
    Martin - your suggestion of the two capacitors on the DTR line per the BS2 schematic referenced above worked. The program runs fine with the DTR line of the serial cable going to ATN on the Stamp through the 0.1 uF capacitor, with another 0.1 uF capacitor from ATN to Vss. I can also communicate with the DEBUG window on a PC, while hooked to it. I did not try to download a program, as I don't have it here, and am sending this Stamp out tomorrow to a friend that wants to put engine monitoring LEDs, etc, on his sailboat. Thanks again for your help, guys.

    Charlie
  • Martin HebelMartin Hebel Posts: 1,239
    edited 2006-11-06 02:22
    Hi Charlie,
    Glad to hear we could be of help.

    -Martin

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Martin Hebel
    StampPlot - Graphical Data Acquisition and Control
    AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
Sign In or Register to comment.