0

This can be a silly question but I'm having a trouble with serial communication between arduino nano with other serial device. Please help me to handle it.

I'm currently doing a RF communication project using arduino nano and radio telemetry which is using serial communication. I tried to use SoftwareSerial but unfortunately, every pin is being used on arduino nano to control other extra devices. So I decided to have serial communication via usb port of arduino nano

Firstly, I directly connected rx and tx wire of RF device with D- and D+ of B type mini USB. but it did not work

Secondly, I tried to connect rx and tx wire with arduino nano via UART to USB bridge, cp2102 module. I soldered a female USB - male mini USB wire for this connection. but It did not work. the wiring that I build seems like the picture below. connection reference picture

Did I miss something? It doesn't work theoretically anyway?
Please help
Thank you in advance

  • 1
    Why do this rather than just connect it directly? – SDsolar Sep 13 '17 at 4:59
1

This is not possible - USB is not an ambidextrous protocol, rather there are distinct Host and Device roles, and while a few chips can switch-hit between them, the USB interface chips commonly used on Nano-style boards are strictly device only, and therefore cannot communicate with another USB device such as a USB-serial adapter. There may well even be a duplicate here somewhere of a similar question having been asked before.

What you should probably do is just use the ATmega UART that interfaces to the USB chip, to talk to your external device directly (or through level translation and possibly inversion if it requires that). The transmit side is no problem, however you will need to give some though to the receive side, as only one thing (the USB chip, or your external device) can drive that ATmega pin at a time. Many of the official Arduino designs have a resistor there, which lets an external driver dominate over the on-board USB serial chip, but your board may or may not have that - if not, you may need to modify it.

And of course such a scheme requires that you disconnect the external device when uploading a new sketch via bootloader.

Another option would be instead of a traditional USB-serial converter, to use some sort of embedded USB host and have that convert to serial - the Kinetis KL25Z chip does this well, as does its close cousin on the Teensy-LC. But at that point, you might as well just replace the Arduino Nano with a better chip having more pins, or even the ATmega328PB which has a second hardware UART.

  • Thank you so much Chris. It was really helpful!! after I read your answer, I tried to solder jumper cable from Atmega328 directly but.... I found out that arduino nano's RXI, TXO header pin is sharing the same wire with ft232 FTDI chip... maybe I can use the header pins. – Steve. Kim Sep 13 '17 at 4:15
  • An actual Arduino Nano has 1K resistors RP1B and RP1C between both the RX and TX nets that connect the ATmega pins to the module headers, and the differently named nets that run to the FTDI. So on an actual Nano you should be able to override the FTDI from the header pins. If your board is not an actual Arduino Nano, the situation might be different, however, the particular pack of cheap CH340-based boards I picked up for breadboard projects seem to have 1K resistors there as well. – Chris Stratton Sep 13 '17 at 4:23

Your Answer

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

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