Interfacing two mega 328 with single serial

Hello!

Im banging my head on this one... I have a project that uses two arduino nano boards and i need to send commands to both of them at the same time over a single USB or virtual serial...i can`t find a topic regarding this problem so i started a new one...

Anyway it needs to be on the same serial and i tried soldering the rx and the other rx togethet. I also removed the 1k resistor that is mounted between the tx of tge serial to usb chip to the rx of the slave microcontroller... I didn't touch the master nano... And it does not work..

Any advice?

Thank you!

Did you connect only the RX and the GND ? And the Slave RX is freed by removing that resistor ? That should work.
It is no longer possible to upload a sketch to the slave, that might be a problem.

The serial output of the usb-serial chip should be able to connect to many RX of Arduino boards. Just set the right baudrate, and every Arduino boards receives the same.

Can you tell what didn't work. The first board is still receiving the serial data ?

I will have to check the connections tomorrow. I connected the master RX to the slave RX... And i removed only the 1k resistor on the slave... The rx led on the master blinks .. The slave rx led does not blik ( that is normal as the led is connected to the serial chip). I did not test if the master arduino recieves data.. I will have to get back with that info tomorrow.
Atleast i have comfirmation that it could be done and i am on the right path:)

I inserted a switch with 1k resistor in it so i can move the switch and still program the slave arduino;)

Thanks for now!

It sounds like you need a TTL BUFFER

The Tx sender connects to NANO-1 and the TTL buffer input and sends the signal to Nano-2 about 15 nS after receiving it due to TTL Propogation Delay

Does that qualify as "same time" ?

You soldered RX to RX and another TX? That doesn't sound good.

Are you trying to control both of these as if they are connected on their own? Each one doesn't need to know about the existence of the other? AND they don't need to send anything back to the PC? Then just connect both RX lines and don't connect TX.
If one does need to know about the other or you need to send data back to the PC then designate one as the master and program it with a SoftwareSerial so that it can communicate to the slave over a separate channel to the PC communications.

The TTL buffer provides isolation between the two Rx pins. 15 nS difference between the two is essentially the same as "the same time". (buffer means "isolator")

Ok guys i solved it:)
Yes i want to controll two independent nanos over a single serial port...
I was powering both of them with 8V at pin Vin. So they were both using their own 5V regulators.
Just for the fun of it i connected the 5V pins together and it started working :wink:
I am using clone nanos and it seems that they have the RX and TX Leds connected directly to the ports of the mega.
But if you take a look at the schematic, you can see that they should be connected to dedicated pins of the USB-serial chip...
And the leds are connected to 5V.
That was the reason i started looking at that direction:)
Somehow i have a 1V difference between both nanos.
If i measure the current (5v and 5v terminal) i have about 2ma.
Anyway it works;)

I am using clone nanos and it seems that they have the RX and TX Leds connected directly to the ports of the mega.
But if you take a look at the schematic, you can see that they should be connected to dedicated pins of the USB-serial chip...

Not necessarily. They probably did that because the leds are not going to be visible if driven directly by the tx & rx pins because of the duty cycle and transfer rate. The only way to control the duty cycle of the led indicator is to drive from a GPIO pin directly. This really a standard practice.

now i'm getting strange data on the slave device.... it seems that direct connection is not good ... i will have to go with the buffer solution :slight_smile:

I think that a buffer is not needed.