Hey guys,
In my latest project, I'm using the following chips:
CD74HCT4051 multiplexer:
TPIC6B595 power shift register:
But I'm also interested in adding sound to my project, so I was thinking about using this dac:
MCP4921 DAC:
Here's my question.
These three chips seem to use completely different methods of communicating with the Arduino. Yet all three seem to need only three pins to communicate with them, and all three seem to have a forth pin which can be used to enable or disable the chip.
The multiplexer has E which is active low. Pulling it low enables the inputs/outputs.
The shift register has G which is also active low. I believe this equates to OE or Output Enable in the http://www.arduino.cc/en/Tutorial/ShiftOut example. The data sheet indicates that pulling G low enables the chip, while pulling it high erases the input buffer and disables the outputs.
Lastly, the DAC has CS or Chip Select, which is again active low. Pulling it down enables the serial clock and data functions.
Regarding the inputs...
On the multiplexer, the three inputs are basicaly used as a binary number to select the output which is active. There is a fourth line which is needed to read the output, but for the purpouses of this discussion, I don't think that's important.
On the shift register, you've got the data pin, the clock pin, and the latch pin.
And on the DAC, you've got the same thing, a data pin, a clock pin, and a latch pin. Okay my bad, there aren't three different setups here, I saw SPI mentioned in the DAC docs but apparently the clock is merely "SPI compatible", and there's no return data line as in an SPI setup.
With that out of the way, my question is this:
Could I theoretically hook all three of these chips up to the Arduino with just seven pins?
Three to select which chip I want to enable, another three which would be used either to select the multiplexer input, or to send data to the shift register or dac, and one more to read data from the multiplexer?
I know the dac would require some high speed data output, but the multiplexer would only need to be read once on bootup as that's used to read some dip switches. And the the shift register is used to run a few leds and won't need to be updated more than 30-60 times a second.
And even if the dac does need its own dedicated lines, could I still do this with the multiplexer and the shift register? If I have both chips seperate, then I'd be using 7 pins, but I could save a pin if I tied their data lines together and used the chip select stuff. Not much, but a pin is a pin.
What do you think?