Decoders, latches, confusion...

Hi there,

So I'm a bit new to working with hardware, but I'm trying to find an elegant way to solve what seems like it'd be a common design problem, but most chips I've found aren't quite it. If it's an obvious one, pardon my ignorance.

I want to use the arduino to control 16 different output lines independently (these will go to FET's to switch on or off valves or solenoids for musical creation).

I'm imagining I'll need a decoder and a latch combination to do this (I want to be able to turn each line on or off independently of the rest.) But most of these decoder / latch combinations (like the MM74HC4514 for instance) let you turn lines on independently, but you can't turn them off without resetting the whole thing.

I know my inputs and outputs would look like the following, but I'm not sure what goes in the middle. What I'd like to do is select the output with the select lines, which would then forward the State line to chosen output, which would then remember that state. Then when I would choose another output and set its state, but the first one would stay where I left it until I selected it again and set it to something else.

Is there a single chip that does this, or an easy combination of a couple?

Any suggestions are greatly appreciated!

-Paul

This is exactly what you want :wink:

Ah, interesting. That's a whole different way to solve it, and it uses fewer i/o pins. Yeah, that's great; thanks!

-Paul

You can get an "addressable latch" that does what you described in your diagram. It's a TTL chip, part number 74LS259 or 74HC259. It's only 8-bit, but you may be able to find a bigger one, or use two of them.

There are also I/O expanders that are interfaced via SPI or I2C that do this job.

-j

See the addressable latch in this project:-
http://www.thebox.myzen.co.uk/Hardware/Transistor_Tester.html

Great suggestions. Thanks. The addressable latch is indeed what I was looking for, and I'll check out the i2c expanders as well. I didn't think about the shift-out register previously, which for me first seemed like a roundabout way to solve the problem, but as I think about it, I suppose it's ideal since it's expandable by cascading and would use fewer pins ultimately. My only worry there is that the serial data rate would degrade responsiveness if it were expanded a lot; maybe the i2c expanders would be more responsive?

-Paul