1

I broke the USB connector on an Arduino Nano and I am trying to use my Uno board as a USB/serial adapter to be able to upload sketches. The broken Nano came with a customized bootloader (avrdude -c arduino compatible), which I do not have a copy of. The content in the HEX files I have is encrypted, it has to go through the bootloader for the plain code to be flashed. This rules out ISP.

I came up with this:

Uno board to broken Nano

Please note that the ATMega on the Uno board is removed. As I am proxying the Nano through the Uno board, I am wiring RX to RX and TX to TX.

The problem I face is that it seems the Nano board is not receiving data from the PC. Everything else works:

  • pressing the reset button on either board resets the Nano
  • TX from the Nano goes back to the PC (the current sketch on the Nano prints some stuff on boot), TX leds blink accordingly on Nano and Uno boards
  • RX led on the Uno board blinks when PC sends something, but RX led on the Nano board does not blink in that case
  • connecting the RX/TX Nano pins to a USB/serial cable lets me send and receive data to/from the sketch

I tried with another, non-broken, Nano (standard bootloader) and I have the same issue, so I think the broken Nano is fine. If I upload a sketch that continuously writes to the serial port, the PC receives it. If I upload an "echo" sketch, I do not get anything back (the "echo" works well over direct USB connection).

I am a software guy, my apologies if I am doing something obviously wrong. I read several pages on the topic, I couldn't spot a fix. The boards are not official Arduino products, but I am not sure this is relevant. I wonder if part of the answer is related to the fact that the USB/serial conversion is handled by a Mega16U2 chip rather than something like a CH340, now useless on the broken Nano.

Some links that I checked:

7
  • You probably need to remove the USB interface chip from the broken board, or else cut its connection to the target processor, so that the external interface can drive it instead. Sometimes there is a 1K or so resistor to permit something else to take over, but your source Arduino is even more likely to have that resistor, so the wrestling match may end in a draw. If there is such a resistor on the target board, removing it is probably the best solution. Commented Feb 9, 2017 at 16:19
  • I am measuring 1kOhm between the CH340G TX/RX pins (2 & 3) and the Nano RX/TX pins (0 & 1). If I understand correctly, I have 1kOhm on the Uno board with the real stuff I want going through it, and the CH340G still working despite the missing the USB port and generating some noise which also goes through a 1K resistor. I have three questions: why would TX work but not RX? Is cutting the power from the CH340G enough? Can I get the RX on the Uno board before the 1k resistor and feed this instead to the Nano? Thanks for the quick reply.
    – slv
    Commented Feb 9, 2017 at 16:45
  • 1
    The target's disused USB serial chip is not generating noise, but arguing about the proper signal level, only on the side where it would be transmitting - you can have both serial interfaces receive from the target ATmega without conflict. Cutting power to disused chips is generally not a sound solution - they may draw power from I/Os instead, both stressing the chip and loading those I/Os to the point where the signal levels are invalid. You really should remove the resistor on the target, but if you can get the signal upstream of the resistor on the source that might work temporarily. Commented Feb 9, 2017 at 16:51
  • I found a metallic hole (test point?) by following the track connected to pin 9 of the Mega16U2, before a component that nicely showed 1kOhm on my multimeter. I wired everything as shown on my picture, except for the RX wire, now going from the hole to the Nano. As expected, it worked. Thanks again, for your quick reply and for teaching me something!
    – slv
    Commented Feb 9, 2017 at 17:08
  • You may want to connect +5v to +5v not to VIN.
    – Majenko
    Commented Feb 9, 2017 at 17:42

1 Answer 1

1

As explained in comments by Chris Stratton, both the Mega16U2 on the Uno and the USB/serial chip on the Nano are competing for the signal level. Removing the resistors on the RX/TX lines between the USB/serial chip and the ATMega on the Nano board will prevent it from interfering with the signals exchanged with the Uno.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.