Third Serial on Nano 33 BLE (can be software)

I actually use both the Serial and Serial1, but I would need an other one, it can be software serial (even better since it's an inverted signal). Is it possible ?

I heard of this, but I think it's just changing the pin for Serial1, right ?

UART mySerial(digitalPinToPinName(4), digitalPinToPinName(3), NC, NC);


You may want to review the material presented here

1 Like

Thanks, that's where I took the information, BUT what's not clear is : does it change the pin for Serial1, meaning by creating mySerial with the previous command, does it change the Serial1 pin or those it create a new third serial (so can I have Serial, Serial1 and mySerial all 3 at once)?
(but I will try it and post my result here)

Hello, I've the same question. robinleblond do you have found the way to have the third UART line in Nano 33 BLE?

Did you try the procedure given on the GitHub link.

Try add as a header above setup

UART mySerial(digitalPinToPinName(4), digitalPinToPinName(3), NC, NC);  //4 is tx, 3 is rx
//(change 4 and 3 as you prefer, the processor can mux any functionality on any pin)

Then in setup
mySerial.begin( ); //Add baud rate

You should be able to have Serial, Serial1 and mySerial on the Nano33BLE.

Thanks a lot, Cattledog, now my board seems read something.
Before I followed this example:

that defines RX/TX inverted in comparison your suggestion:
UART mySerial(digitalPinToPinName(4), digitalPinToPinName(3), NC, NC); //4 is tx, 3 is rx that runs fine.
I still have some issue in my code, but I'll update the result

Yes, the signature of the UART constructor used in the Arduino core for the Nano33BLE is unlike everything else Serial related in the Arduino code base.

As you noted, the typical serial/software serial constructor is indeed RX,TX, but for the Nano33 BLE, the order of the pin parameters in the UART constructor is TX, RX.

I noted that with UART mySerial is not possible to set the baudrate at 10400. The Nano 33 sends to the closest 9600 speed. Do you have a software serial to suggest to use as third Uart able to work at 10400 Baud?

See this thread about setting custom baud rates on the Nano33 BLE. Your are going to get into some deep mbed os waters :confused:

Thanks again cattledog. I modified the prescaler register as in your suggested tread:

so now I have three serial communication lines in Nano 33 BLE with one with no standard baud too.

// PINS FOR Nextion display comm
const unsigned int NEXTIONRX_PIN = D3;          // connect to NEXTION RX
const unsigned int NEXTIONTX_PIN = D4;          // connect to NEXTION TX

const unsigned int RX_PIN = D1;                 // connect to ISO9141 OBD transceiver Rx
const unsigned int TX_PIN = D0;                 // connect to ISO9141 OBD transceiver Tx

// Definitions for a no standard baudrate at 10400
#define UARTE0_BASE_ADDR            0x40002000      // As per nRF52840 Product spec - UARTE
#define UART_BAUDRATE_REG_OFFSET    0x524       // As per nRF52840 Product spec - UARTE
#define BAUD10400                    0x2A9930    // Value theoretical but trimmed at 0x2A1E00 for my specific HW  

UART Serial2(NEXTIONTX_PIN, NEXTIONRX_PIN);    // TX, RX set the second UART pins

void setup()

    Serial.begin(115200,SERIAL_8N1);                     // Start serial comm at baud=115200 to USB Serial Monitor
    Serial1.begin(10400,SERIAL_8N1);                     // Start serial comm at no std baud=10400 to OBD interface for example
    Serial2.begin(115200,SERIAL_8N1);                    // Start serial comm at baud=115200 for display Nextion, remember to modify the Nexconfig.h in Nextion library setting "Serial2"                            
    UART0_BAUDRATE_REGISTER = BAUD10400;                 // set the baudrate register of micro to have 10400 baud accurate in Serial 1

void loop()
        Serial.print(" This is the USB monitor: ");  // Text on IDE monitor

        Serial1.write( 0x55);   //data sent at 10400 precise baud

                    Serial2.print("message.txt=\"");  // a message to display Nextion
                    Serial2.print("NEXTION TEXT");

1 Like

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