Shop OBEX P1 Docs P2 Docs Learn Events
Output pin high toggeling — Parallax Forums

Output pin high toggeling

Hi,

I was testing out a very basic circuit before I starting going to deep into building the rest of the circuit so I wrote a program to turn pin 15 on high and then used a 1 k ohm resistor to a LED. I noticed the LED blinking every once in a while. I used a voltmeter to check the pin out and noticed the voltage dropping randomly. I then tried it on pin 14 and the same thing happened. Am I missing something? Shouldn't the output voltage from the pin be 5V steady?

Comments

  • That could be an intermittent connection- perhaps at the breadboard.

    Can you share a photo of your circuit arrangement?

  • From Page 286 of "27218-Web-BASICStampManual-v2.2"

    If you plan to use END, NAP, POLLWAIT or SLEEP in your programs, make sure that your loads can tolerate these power outages. The simplest solution is often to connect resistors high or low (to +5V or ground) as appropriate to ensure a continuing supply of current during the reset glitch.

  • chris08831,

    How are you powering your BS2 and are you using it in a Parallax board or on a breadboard?

    The voltage on pin Vdd of the BS2 should be 5V.

    Post a picture of your setup and the program you are using.

  • Are you using END, NAP, POLLWAIT or SLEEP? If so, read carefully about them (it) in the big yellow book.

  • Run a program to set all pins low, then check it. You may have a blown pin, my stamp module has a couple dead pins, but I still use it for programming.

  • Try this program, will set all pins low

  • Or change Low thePin to High thePin and all pins will turn on.

  • chris08831chris08831 Posts: 4
    edited 2021-05-05 02:43

    Hi Everyone,

    Thank you for all of your replies. Please see the attached image of the circuit and the program. I have tried several pins and the same thing happens. The LED slightly dims/blinks randomly every 3 or 4 seconds because the voltage is slightly dropping out, it doesn't go fully off. I would need to hook up and O-Scope to it to see what the voltage is actually dropping to the DVM only show about a 0.5V drop. I then just wrote a program to toggle the pin on and off every 10 seconds in a loop, then I noticed that it wasn't occurring any more. I then made it toggle hi then low for 20 seconds each. Then I took out the delay and left the pin high in a loop. Does the pin high need to be in a loop?

    Thanks again for all of your help!

    222 x 144 - 2K
    3024 x 4032 - 3M
    149 x 171 - 3K
  • On your BS2 module what's with capacitor lifting up did it get damaged

  • Put a DO: LOOP after the HIGH 15 and see if the problem persists. (It won't.)

    -Phil

  • ercoerco Posts: 20,244

    PhiPi beat me to it. Every 2.5 seconds after a program just ends, the Stamp winks when it looks for more input. So don't let it end, keep it in a loop.

  • There is nothing wrong; everything is working exactly as defined.

    There is an implied END after your program. Read about END in the big yellow book, then read about SLEEP.

  • GenetixGenetix Posts: 1,740
    edited 2021-05-05 18:31

    chris08831,

    What is the voltage of your 9V battery?

    Also make sure the LED and resistor are fully inserted into the breadboard.

    Try the program on Page 39 of "What's a Microcontroller?" which will blink the LED on P14 once a second.
    https://www.parallax.com/package/whats-a-microcontroller-and-linked-downloads/

  • Thank you everyone for your replies! It looks like Phil, Erco and Tom were correct. I did not know that the stamp will go into a sleep mode indefinitely. I guess that is why I did not see this occur when I put it into a loop. It is great to have such good support in this community!

Sign In or Register to comment.