Shop OBEX P1 Docs P2 Docs Learn Events
BS2 really screwed up — Parallax Forums

BS2 really screwed up

ShadowDragonShadowDragon Posts: 51
edited 2005-10-13 16:48 in BASIC Stamp
Hi, i have a bs2 and when ever i load a program onto the stamp, what ever i want to control is (such as turning on an LED) only works for a verrry short time. I change the lengths of pauses, and such within the program, but doesn't make a difference. When i press reset, it is like htere was never any program ever loaded. Thanks.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
I watch how the moon sits in the sky on a dark night,
shining with the light from the sun,
The sun doesn't give light to the moon,
Assuming the moons gonna owe it one,

Comments

  • Jayguy5000Jayguy5000 Posts: 139
    edited 2005-10-13 01:11
    you could try changing your power source, adding fress AA batteries or converting to a 9v. Make sure you refer back to your basic stamp manual before making a jump in voltage according to your specific needs, ex, BOE or homeword board etc.. You can also try checking all the connections and wiring of EVERYTHING. make sure your LED is connected to the correct I/O pin with the Anode (shorter or the two leads) and the cathode (longer) is connected to Vss (ground)
    not to insult your intelligence but if you would like to send in the code you are writing to the stamp to controll the LED I dont think anyone would mind giving it a quick glance.
    ~Jeremy
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-10-13 01:21
    I've got 6 fully charged AA NiMH Batteries which have always worked well before now. the led, turns on but verrry quickly. Way less than what i am intending for it to do (about 10 ms). My code is very basic:

    ' {$STAMP BS2}
    OUTPUT 0

    main:
    OUT0 = 0
    PAUSE 10000
    GOTO main

    btw, none taken.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-10-13 01:31
    btw, in the code, in order to actually even get the led to blink, i have to use "OUT0 = 1" note the "1". that is what turns it ON. same with HIGH/LOW, HIGH makes it blink, LOW doesn't do anything. somthing is wicked wrong here.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • BeanBean Posts: 8,129
    edited 2005-10-13 02:00
    If "OUT0=1" turns it on, I see nothing in your code that would turn the LED on ???
    Maybe you missed a line when posting the code ?
    You could try TOGGLE OUT0
    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "SX-Video·Module" Now available from Parallax for only $28.95

    http://www.parallax.com/detail.asp?product_id=30012
    Product web site: www.sxvm.com
    Available now... SX-Video OSD module $59.95 www.sxvm.com

    "Save your money. Pay with cash."
    ·
  • Jayguy5000Jayguy5000 Posts: 139
    edited 2005-10-13 02:02
    you can try this code and see what happends, make sure your LED is connected properly to I/O pin 0 (zero)

    ' {$STAMP BS2}
    ' {$PBASIC 2.5}

    DEBUG "The LED should be Blinking"

    DO
    HIGH 0
    PAUSE 500
    LOW 0
    PAUSE 500
    LOOP


    have you ever had complete success with your stamp cooperating or has it been having this problem all along?
    ~Jeremy
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-13 02:07
    And make sure that you LED circuit includes a proper current limiting resistor. Something like this:

    Stamp
    470 ohm
    |>|
    Vss

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-10-13 02:17
    yes, thats what i have set up.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-10-13 02:41
    it has worked very well before. The code i posted isn't missing any lines either.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • ForrestForrest Posts: 1,341
    edited 2005-10-13 03:21
    There's a bug in your program. There's nothing in your program that turns the LED on.

    This program will blink the LED on and off once per second

    '{$STAMP BS2}
    '{$PBASIC 2.5]
    DO
    HIGH 0
    PAUSE 500
    LOW 0
    PAUSE 500
    LOOP

    I took this program from the What's a Micontroller book, which you can download at www.parallax.com/detail.asp?product_id=28123
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-10-13 14:23
    what i am saying is that "HIGH 0" and "OUT0 = 1" turn it ON very briefly. i know that "LOW 0" and "OUT0 = 0" is supposed to turn it on, but the fact that it doesn't is another part of the problem!

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-13 14:27
    If your circuit is set up such that a HIGH 0 is supposed to turn the LED on then LOW 0 would not turn it on.· Perhaps that was a typo...twice now, but you have indicated that you expect a low or 0 to turn the LED on as well.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-10-13 14:40
    nope. no typos, and i have thoroughly read through my posts. i expect a low or 0 to turn it on, but it doesn't. This is what i am trying to say, this is my problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-10-13 14:46
    ShadowDragon -

    This is just a general troubleshooting hint, and NOT necessarily the answer to your present quandry. Often, when all goes well up until the time a load is placed on a Stamp pin port or ports, and then things start to go South, check to make sure that the load or loads being placed on the voltage regulator and/or the Stamp pin port(s) isn't excessive. If it is, it may cause an undue current demand, and a brown-out condition can result. Once that happens, the Stamp is automatically RESET, and the program will start over.

    The simplist way to detect this is to put the following short line of code at the very beginning of your program, where it can only be executed once:

    DEBUG "Starting"

    If "Starting" appears more then once in any program cycle, you KNOW that a RESET is occurring, and the Stamp is starting the program all over again.

    Regards,

    Bruce Bates
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-10-13 14:48
    Well, maybe no typos, but you are contradicting yourself...Jon Williams posted a schematic for the connection we all assume you're using by the way you're referring to what you expect.· You said it is exactly what you have.· That doesn't make any sense, since that circuit would require a HIGH or 1 to turn it on, and once again you're back at needing a LOW, even though you said it comes on briefly with a 1 or HIGH.· Have you read through the "What's A Microcontroller?" text we have available?· It's a free download in PDF from our website, and I really think it would help you to understand how to turn LEDs on/off from the BASIC Stamp.

    http://www.parallax.com/detail.asp?product_id=28123

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
    csavage@parallax.com
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-13 14:58
    Dragon,

    If 0 is supposed to activate the LED, then you should have it connected like this:

    Stamp ---- 470 ----|<|---- Vdd

    Earlier you indicated that you have an active-high setup, and what you really want is active-low.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-10-13 15:04
    well, i just tried it agaiin, and the problem with it blinking very quickly is gone, but the active-high issue is still present. i can do just fine with that, but i am still not sure what is worng with it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-13 16:07
    I think it's time for you to rip everything off your board and rebuild. Yes, yes, yes, I know you think your circuit is perfect, but every *expert* in this forum (including me) has run around in circles over a simple circuit error that we insisted was not present. Also, use a supply other than batteries so there is no doubt you have enough juice.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-10-13 16:28
    i am not sure if this has anything to do with it, but i am using a BOE rev. A . im not sure if that is a problem, and i rebuilt the circuit exactly as you said, but the high low problem is still present.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-13 16:32
    Do you have a meter? Have you checked Vdd to make sure you've got a good 5v level? Have you tried a different pin on the Stamp? -- you may have killed the one you're using now.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • ShadowDragonShadowDragon Posts: 51
    edited 2005-10-13 16:48
    ya, tested the regulator and it came out as 5.5 volts. i think i gight replace it with a new one thought. And i have pretty much tried all the pins.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    I watch how the moon sits in the sky on a dark night,
    shining with the light from the sun,
    The sun doesn't give light to the moon,
    Assuming the moons gonna owe it one,
Sign In or Register to comment.