5
\$\begingroup\$

I am designing a project that has around 50 or so outputs and around 20 or so inputs. I have designed a chainable breakout board for a standard '595 shift register for the outputs, and was planning on using a '165 or similar for the inputs. Because of board costs, I would love it if I could use the same breakout for both input and output. I could just set up one chain to be input and another chain to be output, but I would only need to have one type of board made. '595 and '165 do not seem to be compatible with that goal.

Is there any shift register that can operate as either PISO or SIPO depending on how you drive it. I would prefer something that I could read and write with SPI at a high speed at 3.3V logic and supply.

\$\endgroup\$
5
\$\begingroup\$

I think a universal shift register like the sn74als299 may be what you are looking for.
This has tristate outputs and can be used in a few different modes.

Here is a good link that goes into a fair amount of detail on how to use the above.

\$\endgroup\$
  • \$\begingroup\$ That looks pretty good for what I need. I only have one issue with it after reading the datasheet... there doesn't appear to be a way to shift out with these without causing a flicker as it shifts. I could disable the outputs, but that will make them all flash off. the 595 does not have this problem because of the second level of latches. \$\endgroup\$ – captncraig Nov 28 '11 at 6:29
  • \$\begingroup\$ That isn't a dealbreaker, but its a bit annoying. Not worth adding an additional latch over. Hopefully i can shift out fast enough that it won't be noticable. \$\endgroup\$ – captncraig Nov 28 '11 at 6:31
3
\$\begingroup\$

My normal approach would be to use 595's for outputs and 165's for inputs, on the same chain. While there are a few chips which can both read and write data over the same parallel pins (the universal shift register used in the Apple II floppy controller--probably the 74LS299 mentioned in another answer--probably being the most common) I don't know that I'd particularly recommend using such a thing for lights and switches. One might be able to have each chip control eight lights and eight switches, but I would expect that--if one wants to avoid having the buttons cause the lights to glow slightly when they shouldn't--the circuit would require one or two extra resistors per I/O pin, compared with simply using separate chips. That may not be a disqualifying factor, but replacing a chip with eight resistors isn't a huge win, especially given that if one uses separate '165 and '595 chips one can have the lights remain 'on' with their old state during shifting.

\$\endgroup\$
  • \$\begingroup\$ My intention was to use one chain for lights and another for switches. Any given 299 would only be controlling inputs or outputs not both. The advantage to that is that I only need one type of board that works for in or out. \$\endgroup\$ – captncraig Nov 28 '11 at 17:48
  • \$\begingroup\$ You could perhaps build a board using the '299 which could be used with either buttons or LEDs, if you don't mind having extra resistors in parallel with the LEDs. If your goal is to reduce the number of different PCB patterns rather than the number of finished assemblies, you could also lay out a board which includes both a '595 and a '165 and overlaps the footprints. In many cases, being able to shift without disturbing the LED's is a nice feature to have, though being able to PWM all the LED's in a go using /OE is also nice. \$\endgroup\$ – supercat Nov 28 '11 at 18:36
3
\$\begingroup\$

Microchip makes some 8-bit and 16-bit peripheral extenders that can be programmed as input or output. Check for instance http://www.microchip.com/wwwproducts/Devices.aspx?dDocName=en023500

\$\endgroup\$
  • \$\begingroup\$ Good find. Why didn't I find this a couple of years ago when I was looking for this function with a SPI interface?? For some reason I only found similar parts with I2C interfaces. Oh well. I ended up adding the functionlity I needed to a CPLD which was already necessary in my design, but this part may come in handy later... would be even better if the register settings were non-volatile. \$\endgroup\$ – B Pete Nov 29 '11 at 2:25
  • \$\begingroup\$ Maybe you looked for 'shift regsiter', not 'port expander'.. There are I2C versions of these chips too (which I prefer, less wires and I don't need the speed of SPI_), maybe those came first. Note that the SPI chips use a 'funny' type of SPI: instead of separate select lines up to 8 can share a select and be selecteed by 3 bits in the command byte. Sort of I2C-over-SPI. \$\endgroup\$ – Wouter van Ooijen Nov 29 '11 at 9:37
0
\$\begingroup\$

Another idea I had would be to make a single board that takes a '595 on one side and a '165 on the other. I would only ever put one chip on the board, not both. Both would be wired to the same headers.

Would that cause problems with extra, unused traces on the board?

\$\endgroup\$

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.