Nano USB vs Pins Serial Connection

Hello all, quick question. I have a nano running an accelerometer and printing out a compass heading over 115000 baud serial. I can plug the usb cable in the computer and then to the micro usb on the nano and everything is working.

My question is on the nano end, can i use the serial pins as opposed to the micro-usb slot without changing anything in the code?

Computer -> usb -> nano serial pins

If your question is "can I read the same content as I do on USB by connecting another USB-to-serial converter to the serial pins?", the answer is yes. Given you use a Nano (not one of the more modern variants who's name also start with "Nano" but has some extension).

1 Like

No. Either USB uses Tx/Rx, or Your application. Know that Serial monitor, via USB, is handy for debugging.

I read your question much the same as Pylon, so YES, BUT.

Rx-Tx and the USB port share the uart. It is quite OK to use them together but note

  1. If you intend to retain the monitor note that you cannot send from it. I understand this is not your intention anyway.

  2. You will most probably have to disconnect any device from Rx-Tx while uploading your programme. If you are man-enough to do that you will enjoy

*. Simpler, more efficient and more compact code.

*. Easier debugging

*. The speed and reliability of hardware serial.

All with code you have already proven kosher, i.e. the 115200 baud you are using.

Thank you gents, appreciate the help.

I was mobile when i innitially made the post, so forgive the shortness of the post!

To add more details, i have a turret that can rotate 360 degrees, with an appropriate 20+ pin rotating collar.

I wanted to have the arduino send the angle through the rotating collar and into a Pi that controls the entire cadence.

I made my life easier by cutting the USB cable in half, soldering pins onto the spliced cables, and connecting the newly cut usb halves into the rotating collar. One side goes to the arduino nano micro usb, then it goes through the collar, and the other half of the usb cable plugs into the USB0 slot of the Pi.

Problem solved and no need to use the serial pins or any TTL UART converter.

I'm sure my initial question will be asked again, so thanks for the replies as they would have been the answer i was looking for.

-JB

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.