Shop OBEX P1 Docs P2 Docs Learn Events
BS2 resetting — Parallax Forums

BS2 resetting

edited 2009-04-14 19:30 in BASIC Stamp
Hello,

·I'm using a BS2 "Board of Education" for my project. When I send a HIGH command to P14 the LED lights but flashes or resets about every two seconds. Why doesn't the LED just stay on?

Thanks,
John

Comments

  • Craig EidCraig Eid Posts: 106
    edited 2009-04-14 16:22
    John,

    Please post your schematic and a listing of your code using the Attachment Manager.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com
  • Mike2545Mike2545 Posts: 433
    edited 2009-04-14 16:40
    Double check your battery/power supply

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Mike2545

    This message sent to you on 100% recycled electrons.
  • edited 2009-04-14 17:33
    Hey Craig,

    The BS2 outputs 13 & 14 drive the LED's thru a 470 Ohm resistor. In the future I'll use the BS2 output to drive a TIP which will drive the relays.
    Here's the code:
    'What's a Microcontroller - LedOnOff.bs2
    'Turn LED/Relays on with timed delay then hold them in on state till power is switched off.

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

    DEBUG "Delayed turn on of two relays!"



    DEBUG "Wait 1/2 second to turn on R1"
    PAUSE 500
    DEBUG "Turn on R1"
    HIGH 14
    DEBUG "R1 is on"
    DEBUG "Wait 5 Seconds to turn on R2"
    PAUSE 5000
    DEBUG "Turn on R2"
    HIGH 13

    END


    Thanks for your help,
    John
  • edited 2009-04-14 18:01
    Mike2545,

    I tried switching from a 9V to a 5V power supply. I'm using the "brick" type of power supply. No help...


    Thanks,
    John
  • Craig EidCraig Eid Posts: 106
    edited 2009-04-14 18:17
    John,

    Does the second LED, attached to I/O pin 13, also flash? The 2 LED's should draw approximately 5mA each with·a 470 ohm resistor so you shouldn't be exceeding the BOE current limit. I suspect that you are not supplying sufficient current to the LED's. Try adding a second 470 resistor in parallel to the 470 resistor·attached·to I/O pin 14 and post your results.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    ························ Craig Eid


    ··········· Triad Research and Development
    Electical Engineering Design and Consulting Services

    ··················· www.TriadRD.com
  • edited 2009-04-14 18:37
    Craig,

    Yes, the LED from I/O pin 13 also flashes. No help with the 470 ohm in parallel. Both LED's flash about every 2 seconds but not until the program runs out. The program appears to be running correctly. If I disconnect the LED from pin 13 the pin 14 LED still flashes about every 2 seconds. Could this be the WDT timing out or resetting.

    Thanks,
    John
  • FranklinFranklin Posts: 4,747
    edited 2009-04-14 18:57
    The end is your problem. When a program ends the stamp goes to sleep and wakes up every ~2 sec to see if there is something to do. Check the manual to see if stop will fix this or just create a loop that does not end as the last of your program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • edited 2009-04-14 19:30
    Franklin,

    You are correct, the STOP command did the trick.

    Thanks everyone for you help!

    John
Sign In or Register to comment.