Parallel digital output on the Arduino

Hi everyone! I am as new to Arduino as one can be. And this is my first post as well. Let me apologize for the rambling complexity of this post. This project is moderately complex and I thought it was a golden opportunity to learn the Arduino platform and incorporate it into my current project. I have always admired the Arduino for its robust IDE, unending flexibility, and seasoned user community so I thought that I would have a go at learning the Arduino. I am starting out with an UNO to learn.

I am a seasoned maker with lots of hardware experience and a fair bit of programming experience as well. I have done some C work in the past but it is not my strong suit. Most of my programming experience is in machine language. IDEs for embedded controllers are tedious to use and I am looking for something more programmer friendly. Hence my Arduino interest.

I am retired now and find myself with a lot of free time on my hands which I spend building various electronic devices (mostly audio equipment) from scratch.

I have a design that I am currently working on where I need to control 64 small signal relays. I have designed some simple TTL hardware to control each relay with. This consists of some TTL logic using a set-reset flip flop and a 74LS07 open collector driver to control each of the 64 small signal relays.

To control the state of the flip flops (and thus the relays) I decided to use some 74LS238 decoder/demux chips. This is a 1 of 8 decoder with active high output. You feed it a parallel 3 bit binary word, flash the select pin at the same time and that forces one of the the 8 outputs to go high.

There are 4 channels of audio to be controlled. Each channel uses 2 decoder/demux chips for flip flop state control (controlling 8 relays). This means the there are a total of 8 decoder/demux chips to be controlled or selected. For this purpose I am using another 74LS238 decoder/demux as a controller to select one of the 8 decoder/demux(s) mentioned above.

So what I have here is a “Data Bus” of sorts, that selects one of 8 outputs on the selected demux and an “Address Buss” that selects which one of the 8 demux(s) gets selected and causes the 3 bit binary word on the “Data Bus” to be latched into the selected demux and force a high on one of its 8 outputs.

OK, now we can cut to the chase... What I need is a 3 bit binary word and a separate 4 bit binary word that I can feed to my TTL hardware simultaneously. I need to flash a preset 7 bit binary word in parallel from the digital outputs of an Arduino onto my hardware. It MUST occur at the same instant to correctly steer the TTL logic.

How many digital outputs in total can I control in this manner on an Arduino Uno?

I have spent several hours running various query's in the forums and hunting through the online documentation and have not found an example that clearly demonstrates what I am looking for. The closest I have come is the PORTD command (it looks like it might be a solution). But the documentation advises not to use it because of its complexity and difficulty to understand.

I have no problem with complexity, please let me know what you think about the PORTD command for this use-case.

I realize that this a complex first project (and post). But I do have a lot of experience making things like this, I am a quick study and willing to invest the time to learn a new platform. I just have zero experience with the Arduino. I am having a hard time finding an Arduino idea for this use-case. A place where I can dig in and start experimenting (the fun part of making!).

If you think this post is nuts I apologize. Just hit your back button and move on, otherwise do you have any advice?

With respect and kindness: Many thanks for your time reading and responding!

Hi old man (person).

You just might be one of the youngest in the group here :smiley:


Google

Arduino Port Manipulation


Here is one hit:

https://www.arduino.cc/en/Reference/PortManipulation


LSTTL, old technology :o

It's always best to show a schematic of what you are proposing.


"I need to control 64 small signal relays"

Why not use eight 8 bit shift registers, send data with SPI?

Something like TPIC6B595.

https://www.arduino.cc/en/reference/SPI

Have a look at TPIC shift register chips (daisy-chain).
They can directly switch eight small relays, and the only part needed is a 100n ceramic cap on the supply.
Eight of them can control 64 relays, and that takes only three Arduino pins, total.
I have used the TPIC6C596 (SMD) for 12volt relays, but the TPIC6B595 is more common (DIL or SMD).
Forget about LS. That's last century's technology.
Leo.. (another greybeard)

larryd beat me to it.

My favorite also is the TPIC solution, shift registers with sufficient drive capabilities.

Next comes, if you like, an Arduino Mega with enough output pins and e.g. ULN200x drivers

As an experiment I'd give a multiplexed 8x8 matrix a try. The coil induced current may be sufficient to bridge the gap between the scans of a relay.

DrDiettrich:
As an experiment I'd give a multiplexed 8x8 matrix a try. The coil induced current may be sufficient to bridge the gap between the scans of a relay.

That works for LEDs, because of the human POV.
But I doubt it would work for relays.
Leo..

What I need is a 3 bit binary word and a separate 4 bit binary word that I can feed to my TTL hardware simultaneously . I need to flash a preset 7 bit binary word in parallel from the digital outputs of an Arduino onto my hardware. It MUST occur at the same instant to correctly steer the TTL logic.

How many digital outputs in total can I control in this manner on an Arduino Uno?

The Uno has PORTB, PORTC, and PORTD.

The only one that has at least 7 bits is PORTD, and two of those bits are normally reserved for serial communications (including sketch upload.)

So you need to redesign your circuit to NOT required simultaneous output or (as others have suggested) add additional circuitry "in between" to improve the simultanaity.

(You CAN set things up so that you write to two of those ports within less than a microsecond, which is probably much faster than any relay can move its armature...)

Huh. That's a moderately interesting question. If you energize the coils of N relays "simultaneously", how simultaneously do the contacts actually connect (and stop bouncing)?

Wawa:
That works for LEDs, because of the human POV.
But I doubt it would work for relays.

How can we know if nobody ever tried it?

Hi,
Welcome to the forum.

Please read the post at the start of any forum , entitled "How to use this Forum".
OR
http://forum.arduino.cc/index.php/topic,148850.0.html.

Some of us are ancient.... I have a boarding pass for the Ark. :o

Tom... :slight_smile: