0

I’d like to connect two Arduinos over serial port so that they can communicate with each other. Initially, I put all necessary code onto one device and now connected another via serial port. As soon as I connected the second one I lost the ability to upload new code onto the first one. I’m certain they are conflicting over serial pins. I tried to hold reset on the second Arduino, but it didn’t help. The only way to flash it back again with avrdude is to disconnect the second one.

Is there a way to get this setup working with serial bootloader without disconnecting pins? Thanks for your ideas.

I do not use the Arduino IDE. I believe that if someone has a solution for Arduino it will work for me. I use Atmel Studio 7 with avr gcc. The boards are Chinese clones with ATMega328P on them flashed with the optiboot bootloader. Pins connected are TxD and RxD to opposites on the second board. They are powered from the same power supply. This question is not how to communicate with another Arduino. This question is how to still be able to flash one Arduino while something else is connected to its serial port. I know that the USB to serial bridge IC is connected, but this is a standard setup on all Arduinos that have no embedded USB controller.

Board is Arduino Nano v3 clone with CH340 USB<->UART chip. Both boards work OK by themselves, once connected together they stop responding to avrdude. The connection is as following. Length of connection is only 15cm.

Nano v3 (1)        |          Nano v3 (2)
    |              |              |
RX0 o-----+------~ ~ ~------+-----o TX1
    |     |        |        |     |
TX1 o---+-|------~ ~ ~------|-+---o RX0
    |   | |        |        | |   |
      --o-o--      |      --o-o--
       CH340       |       CH340
         ^         |         ^
         |         |         |
        USB        |        USB
  • Which Arduino boards do you use, and which pins did you connect? Do you want to upload a sketch while the two Arduino boards are connected? Did you also connect the grounds? Please update your question with the extra information. The Atmega328p has only one serial port, and that is used to upload a sketch and for the serial monitor. How much data do you want to transfer between the Arduino boards? – Jot Dec 2 '17 at 0:34
  • Could you give a link to that clone board please. Do you have a schematic of that clone board? Is it a Arduino Pro Mini clone? Holding reset on the second board should help, so it must be something else in the circuit or wiring or perhaps a cable that is too long (the bootloader has its own baudrate). – Jot Dec 2 '17 at 15:23
  • Truly holding reset should work, but beware that the traditional UART header on the end of the board doesn't have true reset input, but just a path through a capacitor to momentarily blip reset via a serial control signal. It's also possibly you have TX/RX backwards for the board you are targeting, or that you've failed to accomplish a timely reset of the target. – Chris Stratton Dec 2 '17 at 17:19
  • Now we know that it is a Arduino Nano board. That board has a usb-serial chip on the board. Those are also connected to rx and tx. One signal line has rx of one CH340G connected and the tx of the other CH340G chip and the other line has also a rx and a tx of a CH340G. I think that the tx of the unused CH340G is the problem. The Arduino (Pro) Micro has a spare serial port, so do the Arduino Zero and Due and the Arduino Mega 2560. I2C is possible. You could perhaps use 4 wires and create your own asynchroon communication with handshake. Why do you need two Arduino boards in the first place? – Jot Dec 2 '17 at 19:37
  • @Jot I think you're right. I have no issues with just rx pin connected from second board. Once I connect 'tx' pin it fails. tx pin of the second board has some potential, which I think confuses first CH340G. I reset both boards, but keep holding reset on the second board, and I was able to upload HEX file onto the first one. – zmechanic Dec 4 '17 at 16:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.