PIC countdown timer
PIC 16F84A elapsed time counter
on 4, 7 segment LED's
Fashing LED program for
16f877
Driving multiple bicolor LEDs in a matrix from and
embedded controller
Using lookup tables
to convert numbers to seven segment LED display patterns
Driving 8 or 9 7 segment displays with 8 or 9 io pins
(and no extra circuitry)
Driving a bar graph display (up
to 30 LEDs)
Area lighting with LED lightbulbs
General LED interfaceing
From the CHEAPIC tutorial:
-
bincnt.asm - Count
in binary on 4 LEDs
-
swcnt.asm - Count switch
closures.
-
eggtimer.asm - Countdown
timer, displays minutes and 10's of seconds on LEDs
-
binclock.asm - A
clock which displays hours and minutes in BCD on LEDs at keypress
See also:
Also:
PICList post "How to matrix bicolor
LEDs?"
Comments:
-
I'm trying to use one I/O for both input and
output (RA1 on a 16C84). Software - Every [so often] the pin is changed to
an output and set high to drive an LED for about [a while]....then turned
off and changed back to an input. Between the LED blinks I poll the input
to check whether it's HI. To debounce, the input must be HI once and again
20msec later. I've got the weak pull-ups disabled.
Hardware - The pin has a 470 ohm resistor and (Smurf-) blue LED to ground.
Also a pushbutton switch and 10k resistor to V+.
What should happen:
-
If pushbutton not pressed - LED should just blink. If pushbutton is pressed
- start other routine.
What does happen:
-
Other routine starts by itself. Even if 10k resistor is pulled out of the
circuit and circuit left open (so pushbutton is not malfunctioning). Also,
never noticed the problem occurring during the night - always during the
day. I can trigger it with a flashlight!
Why:
-
The [input pin] is floating - worse, the LED [is] generating a (very very
tiny) current from light. Try putting a pull down resistor (100K) from the
pin to ground, or across the LED.
I use the inverse (LED to vcc, push button low) of your circuit (with the
extra resistor) on my graphic LCD checker:-
http://ourworld.compuserve.com/homepages/steve_lawther/t6963tst.gif
with no problems.