Arduino Nano EVERY access to 4 Serial

So according to the datasheet ( the arduino Nano EVERY processor should have 4 USART (i.e. Serial).

From the documentation it seems that only Serial (via USB) and Serial1 (Pin TX1 RX0) are supported, but the other serial pins are connected to the jumpers (PA0 and PA1 are in D2 and D7, PF4 PF5 are in D6 D3).

Is there some documentation on how to enable the other 2 serials on the digital pins? Do we have to work on registers?

You can enable the serial ports by modifying the #define statements for HWSERIAL2 and HWSERIAL3 in the pins_arduino.h file, the code for the additional ports is already present. Played around with it a bit, seems to work OK when sending/receiving to external devices, was having some problems when sending between ports on the same nano every board, if I recall correctly I could not get all four ports sending/receiving simultaneously under those conditions, not sure of the exact problem but was speculating the simultaneous interrupts on multiple ports may have been the cause.

Had to do a bit of searching to find where I had worked on it before, part of it got lost with an update in the IDE boards manager.

In the .arduino15/packages/arduino/hardware/megaavr/1.8.5/variants/nona4809/pins_arduino.h file I changed the lines:


to the following:

// Serial2 USART available on Arduino header pins
// USART0 on mega4809 (standard pins)
// Mapped to HWSERIAL2 in Serial library
#define HWSERIAL2 (&USART0)

// Serial3 USART available on Arduino header pins
// USART2 on mega4809 (alternate pins)
// Mapped to HWSERIAL3 in Serial library
#define HWSERIAL3 (&USART2)

Also altered the code at the end of the same file:

#define SERIAL_PORT_MONITOR       Serial
#define SERIAL_PORT_HARDWARE      Serial1

to this - not sure if it is correct, was using the code for a mega board as an example.

#define SERIAL_PORT_MONITOR       Serial
#define SERIAL_PORT_HARDWARE      Serial1
#define SERIAL_PORT_HARDWARE1     Serial2
#define SERIAL_PORT_HARDWARE2     Serial3

After those changes the ports will be usable as:

Rx on D7
Tx on D2

Rx on D3
Tx on D6

Almost posted this in the past to ask if anyone would be interested in doing some testing to see if it would work properly, but never got around to it.

That't great, thanks.

Hello. Noob here. How do I know which pins_arduino.h my sketch is using? I selected Nano Every board and native register namings. Also where I can find arduino15/packages/arduino/hardware/megaavr/1.8.5/variants/nona4809/pins_arduino.h? I don't see the folder arduino15.

NVM. I've found it. So I assumed if I made the changes per post #2, then Serial2 and Serial3 will work even when transferring data between ports?


I have been looking but still cannot find this file, have they changed the directory structure?
Really could use another hardware UART on the EVERY

I cannot find the NONA4809 file?

Also can they start naming the Nanos like play station with numbers. Every is the worst searchable.

@potatofarmer You need to install megaAVR in the boards manager (On a mac anyway)

Much easier now to use MCUdude's MegaCoreX, that supports the serial ports without having to modify any files.