Any difference between Serial and Serial1?

Hi Folks!

I've been trying to get the following project to run:

It uses an Arduino Nano that's connected to another Arduino via the built-in Serial port. I've tried to get it to work without any luck. I've even tried two other Arduino boards (an ESP32 board and a Seeed SAMD21 board) with no luck. However, when I connect it via Serial1 with the pins on the board, it works fine.

Does the built-in USB port on an Arduino work fundamentally differently than the pins for the secondary ports, or am I just messing something up somewhere else?

Thanks!

Welcome to the forum

The classic Nano has a single Serial port on pins 0 and 1. It is shared between the Serial monitor, upload of code and anything else that you might attach to the pins. The upload process automatically deals with any possible conflict between the Serial monitor and the upload process but connecting anything else can cause problems

Other boards have more serial ports, typically providing Serial1 on pins 0 and 1 although other pins are also used. Using Serial1 for external devices avoids any possible conflict with uploads or the Serial monitor

The original Nano (the one with a 328P) doesn't have a Serial1 port. Are you talking about connecting via Serial1 on the other boards you've tried?

Ah, sorry, I should have been more specific. I was using the "Nano Every" and used pins TX1 and RX0 for Serial1. Is this actually Serial0? I always assumed the physical USB port on the board was Serial0.

Maybe I am confused, does the physical USB connection count as a Serial port ( Serial0 maybe?) and the TX1 RX0 pins are a second Serial port ( Serial1? ) or are the USB and TX1 RX0 connected to the same Serial connection?

That is correct. It is independent from the usb serial port.

Thanks! Yeah, it's weird - I've gotten my arduino to communicate with a second arduino over Serial1 (TX1 and RX0) and it works just fine, but when I try the same code over Serial0 and run it over the USB connection, it doesn't work. It appears to be sending fine ( I see characters in the serial monitor when I plug it into my computer) but it doesn't seem to be receiving. However, Serial1 works just fine.

How are you connecting a second Arduino on the usb port?

The second arduino has a Serial3 port. It's a Speeduino engine control setup, so there are four wires on the shield for Serial3. 5V, GND, TX and RX.

So, when it works, I connect the 5V and GND of the first Arduino to those connections on Serial3 of the second Arduino. I then connect TX1 and RX0 on the first Arduino to the RX and TX of Serial3 on the second Arduino.

When it doesn't work, I connect a USB cable to the USB port on the first Arduino, then wire the four wires as if they are 5V, GND, TX and RX just like I'd wired from the pins in the previous example. The only thing I've changed is to switch the programming from Serial1 to Serial, and the wiring from the pins to the USB port.

It would be better if you could sketch the connections for the two situations.

I know on a 328 nano with only one serial port and 0/1 are shared with the usb converter you must disconnect the 0/1 device to load code, and if they are then connected to a second device TTL serial, you can send to both the monitor and the TTL device, but only receive from the TTL device.

I'm not clear about the situation with the Nano Every, but I know there are several extra hardware Serial ports available on different pins than 0/1 if you need more Serial connections.

Thanks, that makes sense! Here's the two connections I've tried:

When I set the program to communicate on Serial1, and use the following connections, it works well...

When I set the program to communicate on Serial0 and use the following connections, it doesn't work...

So, is it that the Serial0 connection with the bulit-in USB works fundamentally differently than the Serial1 and pins?

Yes.

Take a look at the schematic for the Nano Every.

The usb serial is going through the SAMD11 converter chip then to pins PB04 and PB05 on the 4809 processor. The Tx1 and Rx1 don't go to the converter and connect to PC04 and PC05 on the 4809.

The green and red wires going though the usb connector would need to have D+/D- usb level signals.

1 Like

I am very confused as to what it is you're attempting.

To the best of my knowledge, there are no Rx/Tx pins on the USB connector. There's D+, D-, 5V and ground. It's a USB connection. Not a UART connection.

Also, I can find no reference of any Serial0 object in the Arduino core. Do you mean Serial?

And what are you hooking up to the USB port? If you're hooking it up to another USB port, is that port a host? I can find no mention that the Every is set up be a USB host, so if the other end isn't, that's not going to work. If you're hooking it up to a UART on the other end, that's really not going to work.

1 Like

Yes, USB and UART are both serial connections. But that's really the only thing they have in common. Besides that they are totally different - concerning HW and SW. There is no TX/RX line on an USB connector, The logic and the voltage levels are completely different. You cannot do what you intend to do - connecting USB and RX/TX directly. No way.

Thanks, everybody! I didn't know there was a fundamental difference between the serial connections via the USB port versus the pins. I was hoping to connect a project using a USB cable and not soldered wires.

Thanks for the clarification. I meant Serial, not Serial0. Just trying to differentiate from Serial1.

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