![]() | ![]() | ![]() |
| |||||||
| General Electronics Chat This forum is for general chat about electronics, eg: Dont know what a part does? Dont know how to read a circuit? Want to get an opinion? |
![]() |
| | Tools |
| | #1 |
|
I'm busy fiddeling around with a microcontroller, keypad and lcd and have question about the lcd backlight. everytime I press a key on the keypad I would like the lcd backlight to come on for say 2 seconds. if another key is pressed the light stays on. if no key is pressed within 2 secs the light goes off. the problem is that i've run out of pins on the microcontroller so am looking for another way to do it - otherwise I could have used some coding to do it. When a keypad is pressed a buzzer makes a short beep. Now my question - can I link the buzzer to some kind of timer (555?) to do the switching of the light on and off. Can anyone offer any help - am I on the right track, or is there an easier way? | |
| |
| | #2 |
|
You can use a 555 timer wired as a one-shot (monostable multivibrator). Set your pulse width to 2 seconds and fan the output pin from your controller to both the buzzer and the one-shot. Every time your buzzer goes off, you will get a single pulse 2 seconds long. | |
| |
| | #3 |
|
If I press the keypad within the 2 seconds, will the output be extended by a further 2 secs.
| |
| |
| | #4 | |
| Quote:
can we see what the rest of your io lines are doing? maybe there's a way to optimise one of them, to free up a dedicated line for the backlight ... then you have the ability to control the backlight, without sounding the beeper, like turning the backlight on when it's dark out and stuff | ||
| |
| | #5 | |
| Quote:
It just so happens that you can get dedicated retriggerable monostable multibrator (retriggerable one-shot) chips and they cost less than $1. If you go do Digikey, search for "monostable", click the multivibrators link, and under the features column select one of the "retriggerable" descriptions and then narrow your search. A number of possibilities will pop up. | ||
| |
| | #6 |
|
But basically putting in a 555 when you've got a uController is just heresy. Suggest getting a controller with more pins or try to find a way to save a pin elsewhere.
__________________ I thought what I'd do was I'd pretend I was one of those deaf-mutes. | |
| |
| | #7 |
|
thanks for all the replies. I found a chip on digikey which might do the trick. Will try it out tonight and let you know. At a later stage I might have to look at using another microcontroller more pins - a light that comes on after its dark is a good idea! | |
| |
|
| Tags |
| backlight, lcd, switching |
| Thread Tools | |
| Display Modes | |
| |