I'm designing a project that requires far more I/O than a typical microcontroller offers. No problem, right, just use shift registers and stuff. Wait nope, why am I having problems?

I'm planning on driving 24 outputs with one serial data line, a clock, and a chip select. 16 of the outputs are connected to LEDs and the remaining 8 are connected to a HD44780 LCD display. So what I thought of doing for the 16 LEDs was to connect them up to two 8 bit counters that feed the serial data bit through to the specific LED and then change to the next consecutive output when clocked -- like a demultiplexer, but serial. For the LCD, I need to actually hold onto the data and send it all out at once, so I need an 8-bit serial-parallel register and wait until 8 clocks pass to enable it.

Finding an IC which does the latter is easy -- 74HC595 seems to do it -- but for the LEDs, I can't seem to find a 7400 series chip that does what I want. All the ones I can find hold onto previous values and just shift them over, and the decoders I've found 1) don't have a data line - they're always true when selected and 2) require a binary word, not a clock. If it's not already clear, I want something that does what's on the left:

I swear I've used a chip that does what I'm thinking of before when driving an LED matrix, but I can't remember its number. Any help would be appreciated.


I am not understanding why you cant use the 74HC595 for the LEDs.

Shift in your data, then blip the clock for the storage register to hold that 8-bit value. As long as you aren't pulsing the storage register clock, you are free to shift bits all day long without effecting the final output bits.

You can use the same serial data line for all your outputs and just selectively 'gate' which shift register will latch up.

Please leave a comment if I have misunderstood what you are doing. I will elaborate my answer further.

  • \$\begingroup\$ I'd like to maintain a direct connection to the LED. If I hook it up to a shift register then I have to clock numerous times and reset the chip over and over for each subsequent output. If I have a direct connection then whatever I want the LED to show is just whatever I put through serial data - and I just clock it to do whatever I want on the next one. \$\endgroup\$ – BB ON Sep 5 '12 at 22:07

The item on the left isn't a shift register at all; it's known as an "addressable latch". 74xx259 is one example.

However, I'm not aware of any off-the-shelf components that have an internal counter; they all expect you to supply the 3-bit binary address for the latch that is to be updated.

It would be easy to create such a device using a PAL or CPLD.

Also, if you have a SPI or I2C bus on your controller (or are willing to bit-bang one on GPIO), there are many kinds of I/O expander chips available for these buses. One example that I've used is the Microchip MCP23S17 (SPI) / MCP23017 (I2C). Each chip gives you 16 more lines of GPIO.


I do not understand why you can't use the 74HC595. Here are all the choices I see.

74HC299, 8-bit universal shift register; 3-state, if you can tri-state your outputs while you shift.

74HC594 serial-in shift register with output registers

74HC595 serial-in shift register with output latches

74HC596 serial-in shift register with output registers and open collector outputs

74673 16-bit serial-in serial-out shift register with output storage registers, three-state outputs, if you need 16 bits.

  • \$\begingroup\$ It took two people to say it but I finally realized there really is no reason why I just can't do use the 595, since I'm clocking fast enough that a direct connection doesn't really matter anyways. \$\endgroup\$ – BB ON Sep 5 '12 at 22:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.