Software UART Comm

Do the Arduinos, in particular does the Nano Every, have a software comm? That is, can another pin be designated and used as an UART? In addition to using the hardware UART for programming, I'd like to use a pin as another UART, even though the baud rate may not be as high as the hardware UART.

Thanks,
John-

Hi @jpicciri
I believe that in Nano Every you can also use softserial.

RV mineirin

Thanks. My embarrassement; I just noticed the SoftwareSerial Library in the Arduino language libraries.

John-

Hi
no need to be embarrassed.

RV mineirin

No need to use software serial on the Nano Every. There is
Serial1 on pins D1 and D0 for TXD and RXD and it is separate from the USB Serial.
It is always preferable to use a hardware uart.

Odd, I'm looking at the Nano Every pinout table and I dont' see pins D0 or D1. Where are they hidden?

John-

Sorry. They are called Rx0 and Tx1

The Arduino website pinout link just shows them as Rx and Tx
https://content.arduino.cc/assets/Pinout-NANOevery_latest.png

Yes, I wanted a second hardware UART, besides the USB.

Thanks,
John-

Those two pins are what you want. Unlike the original nano, they are separate from the usb uart, and are accessed with Serial1.

How do I declare Serial1?

In Setup, compiling:
Serial.begin(9600);
Serial1.begin(9600);
gives the error, Serial1 not declared in this scope. Is there an #include statement?

John-

Perhaps the problem is that under the Tools/Boards in the Arduino IDE, there is no choice for Nano Every, just Nano. I have IDE version 1.8.16

John-

You need to use the board manager to download the core for the
Arduino megaAVR Boards (Nano Every and Arduino WiFi Rev2).

Right:

Thanks all. Who woulda thunk it.

John-

The folks at Arduino.cc certainly did.
https://www.arduino.cc/en/Guide/NANOEvery

Glad your on your way. :grinning:

But not very far. Although I checked the pinout several times, I can't get the simplest of programs to set a digital pin high (the serial monitor works). Here's the killer code:

  •         RECYCLINATOR III
    
  •            R/C Control
    
  •        26 September 2021
    

const byte RC_Control_pin = 23;
const byte Mtr_Enable_pin = 24;
const byte RC_Active_pin = 25;

void setup() {
Serial.begin(9600);
pinMode(RC_Control_pin, OUTPUT);
pinMode(Mtr_Enable_pin, OUTPUT);
pinMode(RC_Active_pin, OUTPUT);
digitalWrite(Mtr_Enable_pin, HIGH);
}

void loop() {

}

I've looked at every pin and besides the power pin, the only pins high are reset.

The pin assignments I'm using are:
D5 23 RC_Control_pin
D6 24 Mtr_Enable_pin
D7 25 RC_Active_pin

John-

23, 24, 25?

Isn't a Nano Every D2-D13 and 'D14-D21' though?

I'm trying to use pins D5, D6, and D7, which according to the Nano Every pinout diagram, correspond to chip pins, 23, 24, and 25.

The IDE doesn't use the physical pin. Use the pins numbers noted on the board (i.e. 5, 6, 7).

const byte RC_Control_pin = 5;
const byte Mtr_Enable_pin = 6;
const byte RC_Active_pin = 7;

void setup() 
{
  Serial.begin(9600);
  pinMode(RC_Control_pin, OUTPUT);
  pinMode(Mtr_Enable_pin, OUTPUT);
  pinMode(RC_Active_pin, OUTPUT);
  digitalWrite(Mtr_Enable_pin, HIGH);
}

void loop() 
{
}