🛠 Deux ports série : Serial (USB) et Serial1 (broches 0/1)
Objectives
Take advantage of one of the major benefits of the Nano Every over the classic Nano: two hardware UARTs accessible on the connector. Serial goes through the USB bridge module (PC monitor), while Serial1 corresponds to the ATmega4809's USART on pins 0 (RX) and 1 (TX) in TTL. We build a pass-through: everything arriving from one side is output on the other.
Hardware
- 1 × Arduino Nano Every
- 1 × TTL module: GPS, HC-05/HC-06 (via a 5 V→3.3 V adapter if necessary), secondary USB-TTL converter
- Connecting wires, micro-USB cable
Complete code
// Passe-plat USB <-> UART broches 0(RX)/1(TX)
// Garde le moniteur USB libre pour le debogage pendant qu'un
// module (GPS, BLE...) parle sur Serial1.
void setup {
Serial.begin(115200); // USB (module pont embarque)
Serial1.begin(9600); // USART materielle sur broches 0/1
Serial.println(F("Passe-plat pret: PC <-> module"));
}
void loop {
if (Serial.available) Serial1.write(Serial.read); // PC -> module
if (Serial1.available) Serial.write(Serial1.read); // module -> PC
}
Expected verification
Connect the module to 0/1 (module RX → pin 1, module TX → pin 0, powered at 5 V or 3.3 V depending on the module). Open the serial monitor at 115200: you see the module's frames scrolling by; what you type from the PC is sent to the module. The USB port remains usable for debugging in parallel — impossible on the classic Nano, which has only one UART.
Common errors
- Crossing the pins: the board's TX (pin 1) goes to the module's RX, and the board's RX (pin 0) goes to the module's TX; connecting straight-through means nothing passes.
- Forgetting the common ground between board and module: random characters.
- 5 V level on a 3.3 V module: the 4809 uses 5 V logic on these pins; a 3.3 V module may require a voltage divider on the line going to it.
- Two different baud rates:
Serialat 115200 andSerial1at 9600, eachbeginwith its own baud rate. - Uploading goes through the USB bridge, not through 0/1, but a chatty module connected to 0/1 can saturate your serial code: disconnect it if in doubt.
- The USB bridge module is not a second programmable MCU: do not attempt to reprogram it, as you risk breaking the USB path.
Other tutorials for this board
Code examples for this board
multi-serie.inoArduinoadc-filtre.inoArduinointerrupt-bouton.inoArduinonvm-consignes.inoArduinosommeil-every.inoArduinowatchdog-secours.inoArduino