5

I'm trying out computer to computer serial communication using 2 Arduino Unos (both connected to different computers). Right now, I use the Software Serial library, which redirects data from the SoftwareSerial ports to the hardware Serial (over USB to the PC).

Is there any way to bypass the 328p chip, and only use the 16U2, which works as a USB to Serial converter? Will the circuit in the diagram work? By connecting the GND to RST on both the Unos, the 328p gets disabled, which in theory should all me to directly tap into the serial line of the 16U2.

Circuit

Carl
  • 89
  • 3
  • Have you tried it? – Majenko Mar 28 '17 at 08:48
  • Just tried it, it works fine. Tried 1 mega-baud, but there were a few errors – Carl Mar 28 '17 at 09:02
  • That's to be expected. – Majenko Mar 28 '17 at 09:06
  • I'd probably add some resistors in between, in case the ground potential of both PC is a bit off. Not sure if this adequate, or if this is even a problem to begin with. – Gerben Mar 28 '17 at 09:29
  • i don't think you want a resistor on the ground, if that's what you're getting at... – dandavis Mar 28 '17 at 11:42
  • You may want a smallish (220ohm should be fine) resistor on each TX line in case the other device is accidentally configured as an output, but this is less of an issue on "known good" devices such as two Arduino Unos. – Ignacio Vazquez-Abrams Mar 28 '17 at 12:14
  • If your Arduino board has the Atmega328p in DIP format (not SMD), the best way is to extract it and you will have a pretty USB-UART so your schematic must work. – caligari Apr 06 '17 at 02:41

2 Answers2

1

As per your diagram, ground the reset pin on both Arduinos and connect TX to RX on the one to RX to TX on the other. Alternatively, if your Unos have a socketed 328P, you can remove it.

(This answer summarized from the comments above in order to take it off the "unanswered" list.)

cjs
  • 594
  • 2
  • 15
0

The circuit you have drawn will work for PC to PC coms. Essentially your connection diagram looks like this:

PC1 -(USB)- Arduino1 -(TTL serial)- Arduino2 -(USB)- PC2

To answer your second question, you can bypass the 328p chip by removing them both as they are not needed. The 16U2 converts the USB to TTL serial which it provides to the Arduino on pins 0 and 1. Since the ATmega328p microcontrollers aren't being used (ie in reset state) then you may as well remove them and use them on another project.

sa_leinad
  • 3,118
  • 1
  • 20
  • 49