So what exactly are you expecting this to do?I'd like to control 8 individual LED's using 3 or 4 input pins to a component.
For example, MM74HC164 can supply 25 mA per pin. Should do.
There's a BCD to decimal decoder chip that has 10 outputs representing 0 - 9 one at time.
So what exactly are you expecting this to do?
Funny what Google can find in 0.2 seconds.
SN74141N, MC14028B, CD74HC42M etc. or generically 74141, 4028 & 7442
This is probably what you've been looking for but if you don't have a counting BCD circuit output from the uC then you'd want to use simple shift register as metioned above, it will advance one position for each button push.
Hi gte,Hi, thanks for the reply.
I'm going to try and figure out how this whole serial thing works and how it correlates to the truth table on the data sheet. From it I cannot tell if I can illuminate the LED's individually based on the state of the 3 pins or not, but that is because this is my first time working with this, so I'll keep reading about it tonight and hope a light bulb goes off!
Sounds like you now have enough input from everyone that's posted to get something working - have fun!Thanks!
When you say "don't have a counting BCD circuit output from the uC" . Do you mean if I do not have it coded into the microcontroller to count the button presses? I do have a case statement that right now is counting each button press and advancing by one each time, and it is working but it also is using 8 microcontroller pins, 1 for each LED output and of course with this I'm trying to condense that.
This chip is exactly what you are looking for: the 4017 decade counter. basically has ten outputs which go HIGH in sequence when a source of pulses is connected to the CLOCK input.Based on an input button to my microcontroller, I'd like it to illuminate 1 LED at a time, depending on how many times it is pushed. Basically like a cycle, it will cycle through to the next LED each time the button is pressed.
Hi gte,
The answer to this is that yes, you can illuminate any combination of LEDs you want to.
The one I linked to is not the best one for the job. That one doesn't have latching, and it has 2 inputs, which you don't need.
Here's a good one: MM74HC595. The data sheet has a better block diagram and a nice timing diagram. (However, there are some typos / error on the timing diagram -- the second "OA" should be "OB" and it should go low when RCK goes high.
You'll want to connect the microcontroller output pins to RCK, SCK, and SER. It is easiest if they are on the same port so you can write them all with one write instruction. You'll want to tie off the "_G_" to Gnd "_SCLR_" to the supply voltage, to keep the outputs enabled and not clearing them.
The you write the microcontroller code for this:
Set CLK low, while setting the data for the first bit on SER. Then set clock high while keeping the data the same on SER. Then repeat this 8 times for each new bit. That sends the 8 bits into the 8 latches.
Then set RCK high, and all the bits should then appear at the outputs of the shift register chip. Simple as that!
That can all occur very fast, each step being about 1 microsecond, so the total thing takes around 20 microseconds to change all 8 bits.
Sage
by Jake Hertz
by Jake Hertz
by Jake Hertz
by Aaron Carman