Basic question on LED flicker
Archiver
Posts: 46,084
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...
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
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
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]
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"
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"
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