Shop OBEX P1 Docs P2 Docs Learn Events
Stamp Troubles — Parallax Forums

Stamp Troubles

RackleRackle Posts: 17
edited 2005-01-24 16:35 in BASIC Stamp
I just took my Basic Stamp2 BOE out of the box after having it sit for a couple months.· I made up a quick board with some Leds and switches to refamiliarize myself to the environment.· I made some real real simple code:


'{$STAMP BS2}

input 0

output 15

startmain:

if In0 = 0 then reportlow

if In0 = 1 then reporthigh

reportlow:

out15 = 0

Goto startmain:

reportHigh:

Out15 = 1

Goto startmain:

Using the examples in the book, I saw I made one mistake right off the bat, I had my input switch right to 5v without a 10k inbetween, however on the website it says the stamp can safely handle 5 volts.

If I have the switch to ground closed the led lights and stays lit.· when I turn off the switch it remains lit for about 30 seconds then goes off, instead of immediatly running through the starmain: again and seeing that the switch is off and immediately going off.· If I leave the switch off or never turn it on the led will blink randomly, tho it seems to do the random·blinking less when the serial cable isn't plugged in.· it may come on for 5 seconds off for 30 then blink a few times and go back off.

I don't know if I've somehow partially damaged the chip (usually chips go up in a puff, tho) or if I'm just really not seeing the errors in my code.

A diagnostic program that I could load onto the stamp then watch in debug would be great (if such a thing exists).

[noparse][[/noparse]EDIT: After getting up today and working on it some more with very eradict results I decided to test the pins for shorts.· I'm getting about 2 - 3 MegaOhms between all the pins.· This would account for why pressing a button connected to pin1 would activate something the one on pin2 was supposed to activate.

I have a "board of education", I can just remove the stamp chip and order and insert a new one right?]




can anyone offer some advice?

Thanks.

Post Edited (Mshkor) : 1/23/2005 1:33:33 PM GMT

Comments

  • NateNate Posts: 154
    edited 2005-01-23 16:56
    Your input switch needs to be delivering a high (+5V) or a low (~0V) to the input pin.· The way you describe your circuit, it sound as if when the switch is off, the input is hanging (i.e. not connected to +5V or 0V).· Hanging inputs are a no-no and will give eratic results such as you describe.· Use a pull-up or pull-down resistor on all inputs to make the input see either·+5V or 0V, depending on the switch setting.· I may be reading your post incorrecty, or you may already know this, but this is my read of the problem.

    nate


    Post Edited (Nate) : 1/23/2005 5:01:22 PM GMT
  • RackleRackle Posts: 17
    edited 2005-01-23 19:13
    Nate,

    Has anyone told you you're a wonderful person?

    That was it!!! Thank God, I was so depressed that I'd destroyed the stamp and had to shell out 50 bucks and wait a week to continue my project.

    This is great, thanks so much.
  • JonbJonb Posts: 146
    edited 2005-01-23 22:52
    Just a note about debugging, perhaps it would be a good idea to download the new Basic stamp editor. You can use the debug screen inside the editor to keep track of anything you wish.
  • NateNate Posts: 154
    edited 2005-01-24 16:35
    Glad I could be of help.· I believe we all know how frustrating in can be to have something not work and to not know why.

    nate
Sign In or Register to comment.