3
\$\begingroup\$

I want to control a simple display with a microcontroller. The display has 8 input pins, the microcontroller only 6.

Is there an IC that I can interpose that

  • lets me set the state of each of its output pins and keeps it that way
  • requires the least amount of input pins necessary

Something with a serial bus maybe?

I know that typically display controllers are used, but are there general purpose devices?

\$\endgroup\$

closed as off-topic by Chris Stratton, Nick Alexeev Sep 3 '18 at 6:04

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

  • 3
    \$\begingroup\$ Try searching for "GPIO expanders" \$\endgroup\$ – immibis Sep 2 '18 at 22:27
  • 1
    \$\begingroup\$ This is exactly what I was searching for, thank you! \$\endgroup\$ – 2080 Sep 2 '18 at 22:32
  • 1
    \$\begingroup\$ Ironically, the small MCUs are typically used exactly for this. They are called "LCD serial interface" \$\endgroup\$ – Maple Sep 3 '18 at 0:00
  • \$\begingroup\$ At the small scale, this is an 'addressable latch', like 74HC259. \$\endgroup\$ – Whit3rd Sep 3 '18 at 7:03
7
\$\begingroup\$

What you are looking for is a GPIO "expander" chip. There are many available, typically using I2C or SPI to connect to the microcontroller. The Microchip MCP23017(I2C)/MCP23S17(SPI) is just one example that I have used in the past. There are many others to choose from.

\$\endgroup\$
  • \$\begingroup\$ PCF8574 is another common chip of this type (I2C in this case), with a lot of resources available online about using them (they're particularly commonly used when interfacing arduinos to LCD modules, which has generated a lot of tutorial content). \$\endgroup\$ – Jules Sep 2 '18 at 23:21
3
\$\begingroup\$

A typical shift register is 74HC595. What you pass is a byte containing 8 bits, thus 8 signals. You only have to store that byte (8 pins) in memory which only cost one byte.

For this you only need 3 pins. Except for GND/VCC you only need 3 pins.

You can even daisy chain 4 of them, controlling 32 pins (which cost 4 bytes to store) and still use only 3 pins (except GND/VCC).

\$\endgroup\$
1
\$\begingroup\$

You most likely want either a "Shift Register" or a "Latch".

Shift registers allow you to load data serially, and are commonly used with MCUs - 74HC595 is a highly common one.

Latches allow you to use a control signal to hold a value. These are used a lot in memory access where you want to latch an address - for example if you want to load a 16-bit address from an 8-bit bus, you can load the upper half, latch it, and then load the lower half.

You could accomplish an 8-bit bus using two 4-bit latches. Each latch could have its own control signal using an additional 2 pins. That gives 6 in total. You could do it also in 5 pins by using an inverter such that one latch is holding its value while the other is transparent.

\$\endgroup\$
  • 1
    \$\begingroup\$ An alternative is PCF8574, an I2C 8-bit bidirectional parallel port. What you use depends if you prefer SPI or I2C. \$\endgroup\$ – henros Sep 2 '18 at 22:30
  • \$\begingroup\$ Latched shift registers sound very useful as well, as they could be much faster. I accepted the IO Expander answer because in my use case I might have information flowing in the other direction as well, which many expanders seem to support. \$\endgroup\$ – 2080 Sep 2 '18 at 22:45

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