Shop OBEX P1 Docs P2 Docs Learn Events
Basic question on LED flicker — Parallax Forums

Basic question on LED flicker

ArchiverArchiver Posts: 46,084
edited 2004-01-14 19:09 in General Discussion
Eric-

Your program is probably entering the low-power mode due to an
implicit/explicit END statement. Try using STOP as the last
executable statement. Or, here: GOTO here.

Regards,

Steve

On 14 Jan 04 at 18:16, Eric Berg wrote:

> I have an LED attached to one of the I/O pins of a BS2 Stamp in line
> with a 470 ohm resistor. When I take the pin high (HIGH 8) the LED
> turns on but flickers every couple of seconds...

Comments

  • ArchiverArchiver Posts: 46,084
    edited 2004-01-14 18:16
    I have an LED attached to one of the I/O pins of a BS2 Stamp in line
    with a 470 ohm resistor. When I take the pin high (HIGH 8) the LED
    turns on but flickers every couple of seconds. When I check the
    voltage coming out of the pin, I notice it dipping every couple of
    seconds with or without the LED attached. I tried a BS2sx stamp and
    the result was the same. I thought I remembered reading something
    about this but for the life of me, I can't remember where. Can anyone
    give me a reason for this and a possible way to get rid of the
    flicker?

    Eric
  • ArchiverArchiver Posts: 46,084
    edited 2004-01-14 18:42
    In a message dated 1/14/2004 1:36:27 PM Eastern Standard Time,
    khufumen@y... writes:


    > I have an LED attached to one of the I/O pins of a BS2 Stamp in line
    > with a 470 ohm resistor. When I take the pin high (HIGH 8) the LED
    > turns on but flickers every couple of seconds. When I check the
    > voltage coming out of the pin, I notice it dipping every couple of
    > seconds with or without the LED attached. I tried a BS2sx stamp and
    > the result was the same. I thought I remembered reading something
    > about this but for the life of me, I can't remember where. Can anyone
    > give me a reason for this and a possible way to get rid of the
    > flicker?
    >

    How are you ending your program?

    Have you tried running the LED with a long for/next loop to see if it
    flickers?

    Sid Weaver
    W4EKQ
    Port Richey, FL


    [noparse][[/noparse]Non-text portions of this message have been removed]
  • ArchiverArchiver Posts: 46,084
    edited 2004-01-14 18:47
    i use this trick, I know its not needed in your program but try placing
    this command at the top of your program It helps my stamp with the same flicker

    Debug CLS

    For some reason it tricks the stamp to stop the flicker.... I cant explain
    it.. but it works for me... Give it a try



    At 06:16 PM 1/14/2004 +0000, you wrote:
    >I have an LED attached to one of the I/O pins of a BS2 Stamp in line
    >with a 470 ohm resistor. When I take the pin high (HIGH 8) the LED
    >turns on but flickers every couple of seconds. When I check the
    >voltage coming out of the pin, I notice it dipping every couple of
    >seconds with or without the LED attached. I tried a BS2sx stamp and
    >the result was the same. I thought I remembered reading something
    >about this but for the life of me, I can't remember where. Can anyone
    >give me a reason for this and a possible way to get rid of the
    >flicker?
    >
    >Eric
    >
    >
    >To UNSUBSCRIBE, just send mail to:
    > basicstamps-unsubscribe@yahoogroups.com
    >from the same email address that you subscribed. Text in the Subject and
    >Body of the message will be ignored.
    >
    >
    >Yahoo! Groups Links
    >
    >To visit your group on the web, go to:
    > http://groups.yahoo.com/group/basicstamps/
    >
    >To unsubscribe from this group, send an email to:
    > basicstamps-unsubscribe@yahoogroups.com
    >
    >Your use of Yahoo! Groups is subject to:
    > http://docs.yahoo.com/info/terms/



    "Why am i fighting to live, if im just living to fight"
    "Why am i trying to see, when there aint nothing in sight"
    "Why am i trying to give when no one gives me a try"
    "Why am i dying to live if im just living to die"
  • ArchiverArchiver Posts: 46,084
    edited 2004-01-14 18:57
    Thank you very much for your inputs (pardon the pun). I shall try it
    out tonight.

    Kind Regards,
    Eric


    --- In basicstamps@yahoogroups.com, Gary Denison <gdii@c...> wrote:
    >
    > i use this trick, I know its not needed in your program but try
    placing
    > this command at the top of your program It helps my stamp with the
    same flicker
    >
    > Debug CLS
    >
    > For some reason it tricks the stamp to stop the flicker.... I cant
    explain
    > it.. but it works for me... Give it a try
    >
    >
    >
    > At 06:16 PM 1/14/2004 +0000, you wrote:
    > >I have an LED attached to one of the I/O pins of a BS2 Stamp in
    line
    > >with a 470 ohm resistor. When I take the pin high (HIGH 8) the LED
    > >turns on but flickers every couple of seconds. When I check the
    > >voltage coming out of the pin, I notice it dipping every couple of
    > >seconds with or without the LED attached. I tried a BS2sx stamp and
    > >the result was the same. I thought I remembered reading something
    > >about this but for the life of me, I can't remember where. Can
    anyone
    > >give me a reason for this and a possible way to get rid of the
    > >flicker?
    > >
    > >Eric
    > >
    > >
    > >To UNSUBSCRIBE, just send mail to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > >from the same email address that you subscribed. Text in the
    Subject and
    > >Body of the message will be ignored.
    > >
    > >
    > >Yahoo! Groups Links
    > >
    > >To visit your group on the web, go to:
    > > http://groups.yahoo.com/group/basicstamps/
    > >
    > >To unsubscribe from this group, send an email to:
    > > basicstamps-unsubscribe@yahoogroups.com
    > >
    > >Your use of Yahoo! Groups is subject to:
    > > http://docs.yahoo.com/info/terms/
    >
    >
    >
    > "Why am i fighting to live, if im just living to fight"
    > "Why am i trying to see, when there aint nothing in sight"
    > "Why am i trying to give when no one gives me a try"
    > "Why am i dying to live if im just living to die"
  • ArchiverArchiver Posts: 46,084
    edited 2004-01-14 19:09
    Let's say your program looks like this:

    Main:
    HIGH 8

    The token after the HIGH instruction will be $00 which is the same as
    END. When a PBASIC program hits END it goes into low power mode. The
    watchdog timer wakes the chip about every two seconds and will cause the
    IOs to float for about 18 ms -- this is causing the flickering you're
    seeing (for full details read the section on END in the manual or online
    Help).

    There are several ways to "fix" it:

    Main:
    HIGH 8
    STOP ' end program without low power mode

    or...

    Main:
    HIGH 8
    GOTO Main ' continuous loop

    or...

    Main:
    HIGH 8
    DO : LOOP ' continuous loop


    -- Jon Williams
    -- Applications Engineer, Parallax
    -- Dallas Office


    Original Message
    From: Eric Berg [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=UGx2bZDtBOTAW1PKPwDSXuO-3PJDXkVcC1hwp-lXe9Qusq37OZ_-HoSw3KcM7fqQKepHdydH_nFIQ0Q]khufumen@y...[/url
    Sent: Wednesday, January 14, 2004 12:17 PM
    To: basicstamps@yahoogroups.com
    Subject: [noparse][[/noparse]basicstamps] Basic question on LED flicker


    I have an LED attached to one of the I/O pins of a BS2 Stamp in line
    with a 470 ohm resistor. When I take the pin high (HIGH 8) the LED
    turns on but flickers every couple of seconds. When I check the
    voltage coming out of the pin, I notice it dipping every couple of
    seconds with or without the LED attached. I tried a BS2sx stamp and
    the result was the same. I thought I remembered reading something
    about this but for the life of me, I can't remember where. Can anyone
    give me a reason for this and a possible way to get rid of the
    flicker?

    Eric
Sign In or Register to comment.