Buffer/driver IC: One Tx to Multiple Rx

Hello,
I have a fairly simple project that I'm trying to expand while also keeping as simple as possible. Basically I have a Nano that I've programmed to animate some LEDs but I send the animation info to an ATTiny1616 via serial. The Tiny1616 receives the serial data and does the actual flashing of the LEDs. The distance from the Nano to the Tiny 16 is about 5 ft.

I'd love to duplicate and daisy chain the ATTiny1616 setup so I can spread many of them over a large area but am unsure how to best do this. The communication is only in one direction i.e., I only need the Nano's transmit pin but I want that to feed many, many receive pins of the ATTinys.

My question is if there is a serial buffer IC (or some other kind of IC) that could "drive" all of the Rx pins? Ideally I'd like to be able to have 100 of these chained together but I can settle for less. This is not a timing critical application as it is mostly just a visual art project so it doesn't have to have blazing fast Tx speeds.

Any help would be greatly appreciated as I have very little experience in this area. Thank you!

-Kevin

This will probably sound weird but using CAN drivers you can accomplish this and have it work well over 1000 feet. These drives on a PCB can be gotten from china suppliers for maybe a buck or so. Follow all the rules on termination (120 Ohm resistor on each physical end) and none in the middle. Wire the one on the Nano to always be in transmit and all the ATTinys always in receive mode. You will be using a digital signal to transmit and you will receive one. You may have to do an inversion I do not know for sure. Let us know how you make out.

If the distance between the many nodes is not too high then daisy chaining is the most simple solution. Each stage replicates the signal and consequently the bus length is almost unlimited. Each TX can serve a moderate number (5?) of RX if required, extending the linear bus on demand into an area covering tree.

For larger distances the direct TX/RX connection can be improved by line drivers like RS-485 without any change to the code. This allows to upgrade selected (long) lines of the entire installation at any time.

Thanks for the suggestion! In my research I have seen the CAN Bus show up as a solution to similar problems but didn't fully understand how to implement it. I was also weary of adding more hardware I might need to troubleshoot and thought it might be overkill for my situation but I will do some more research into it. Sounds like a viable solution if I can figure out the hardware end of it.

Thanks DrDiettric! The distance between them will be approximately 5 feet so they are fairly close together.

That is the simplest solution for sure. For some reason I had it in my mind that I would have to add another wire to make this work and wrote it off. Obviously chaining Tx to Rx uses just one wire. Doh! Sounds like the first thing I should try. Thanks for your suggestion!

Here is one I found on our china supplier.

It is less then a buck. They also come in 5V versions. It shows power 3V3 & Gnd. Bus CANH and CANL CTX is transmit and CRX is receive. Not sure what you do with the unused one, tie it high or low or ignore it as there are resistors on it. R2 may have to be removed, it only needs to be connected at the physical ends of the bus.

How does it handle full duplex communication?

Can is a simplex by-directional bus. You only enable one transmitter and leave the others in receive mode. Since it is a dominance/recessive bus you can leave the transmitter so it is in the recessive mode. CAN must monitor its own transmissions so it can receive an ACK in the middle of a message. If you want to go bidirectional the CAN module MPC2515 for about twice the price of the transceiver. If you do this use Cory Fowler's CAN library it works great. It can go to 1 meg and it automatically determines when to transmit and receive on the bus. Hopefully this helps.

Thanks gilshultz! I didn't realize that a CAN module was basically just an IC. I mistakenly thought there was more too it than that and I needed a whole board worth of parts. That is definitely worth looking into! It sounds like there is a bit of a learning curve though, haha :smile: That does open up a lot of possibilities and solves my problem. It looks like there is a lot to it so I'll have to do some research. Hopefully I can find some beginner friendly tutorials. Thanks again!

@gilshultz
I am a little confused by what I am reading about CAN-BUS examples and your suggestion to use the above breakout board. Everything I am seeing shows that I need a CAN transceiver like you recommend and a CAN controller (i.e, MCP2515 controller with a MCP2551 transceiver). Is there actually a way to just use the transceiver directly tied to the UART of my microcontrollers? I think I'm missing something... :thinking:

Is this what you were suggesting? It would be great if something like this would work.


(P.S. I know I'm missing the termination resistors and the signal ground in this diagram and please disregard the error on the power connections on the last 3 ATTiny1616.)

if you consider to add a module to each node, why not a good old RS485 Bus?

About 100 receivers and they are 1.5 meters from the Nano ? Maybe the TX is enough.

If you power the Nano board via the USB cable, then it runs at 4.5V.
Suppose you have the Nano running at 5V, then the TX pin changes between 0V and 5V and can drive (more than) 40mA. That is a lot.

A driver chip might even be weaker than the Nano output pin :scream:

You could add a protection resistor of 150Ω in the TX line, depending on the cable and the circuit that you use. With that resistor, you have to lower the baudrate. That should be no problem, the default of 9600 is already very slow :snail:

This would be my first option, my second option would be daisy-chaining. With a daisy-chain, it is possible that each of the 100 receivers can send a message back. My third option would be RS-485.

Can you make a solid protocol with a checksum ?

@noiasca I don't know! :laughing: I wasn't initially trying to add more hardware and was hoping to do it just using built-in UART but I went down the CAN-BUS route to see if would be cheap and easy. I guess I should look into RS485 chips as well? Thanks for your advice.

@Koepel Only the first receiver is 1.5m from the nano. The rest are 1.5m from each other so it could be a very large distance if I lay them all out in straight line.

Wow! I didn't think of that.

Sounds like I need to experiment with the daisy chain setup first while also doing some research into RS-485, as it might be the best backup plan. I'd like to keep it as simple as I can so if daisy chaining will do the job then that works for me. If it's cheap and easy I'd be willing to add some additional hardware to have it be faster, more reliable, or more flexible in the future. Thanks Koepel!

I just looked into the MAX485 and they are like $4-6 bucks each on Digikey and Mouser! That would add some significant cost to my project :scream:

It could be up to 150 meters ? Then RS-485 is a good option. There are cheap modules of 1 euro/dollar each on AliExpress. I don't know about their resistors and if they still work with 100 nodes.

For daisy chaining, you need a RX and a TX signal from each ATtiny. If a wire breaks, then the rest of the chain does no longer work.

I think that you should consider the time to solder/connect everything together. If you can cut the hours in half by spending twice as much money, it might be worth it.

Those are good points. Daisy chaining has some serious drawbacks and it is a lot of extra effort. I will keep looking for some cheaper genuine RS-485 ICs. I have had bad luck with cheap modules not working or being counterfeit so if I can make it work with some genuine hardware that would be my preference. It's obviously a lot of time and money troubleshooting/replacing 100 modules that don't work because they are fake or don't meet spec.

I'm also going to keep looking into the CAN-BUS transceivers to see if that is a viable option because they are a lot cheaper than the 1/4 or 1/8-unit-load RS-485 transceivers. So many options to explore, haha. Thanks for your help Koepel :smile:

The opposite is true. See my #3 reply.

The extra effort is a single extra line in your code:

received = Serial.read(); //read input as usual
Serial.write(received); //and also propagate to next node

You got it! You will need to check the can modules, I believe loading is 32 nodes but there some 1/2 load and 1/4 load by Max and probably others. If you need a repeater it is easy, just connect a receiver to a transmitter and you good to go. The new buss will also have to be terminated. You can get away with a lot since your messages etc do not have to be acknowledged by the hardware in one bit time. Try it with a few and see how you like it. You could use a 4 conductor cable and power it with 24VDC and use a small buck (I would prefer SEPIC) for each node.

A quick look on ebay (UK) and I can get 10x MAX485 modules for just under 9 GBP which is probably around $10. You can probably get them even cheaper on aliexpress.