Serial communication nano33Iot and SERCOM_Handler()

Hello everyone, I need that a Sparkfun pro micro (master) send a message via serial with a nano 33 iot (slave).
I thought to use the SoftwareSerial library but on the nano 33 iot it's not possible, searching on the web I read that you have to use "wiring_private.h" with SERCOM0_Handler().

I connected the tx pin of the pro micro to the 5 of the nano, the rx of the pro micro to the 6 of the nano and the two gnd

this is the code I loaded on the nano 33 iot

Ho collegato il pin tx dello sparkfun pro micro al pin 5 del nano 33 iot e l'rx del pro micro al pin 6 del 33 iot

#include <Arduino.h>
#include "wiring_private.h"

Uart mySerial (&sercom0, 5, 6, SERCOM_RX_PAD_1, UART_TX_PAD_0);

// Attach the interrupt handler to the SERCOM
void SERCOM0_Handler()

void setup() {
  // Reassign pins 5 and 6 to SERCOM alt
  pinPeripheral(5, PIO_SERCOM_ALT);
  pinPeripheral(6, PIO_SERCOM_ALT);

  // Start my new hardware serial

void loop() {
    if (mySerial.available()){
    //ricevo un carattere dalla seriale software
    //lo scrivo sulla seriale vera, collegata al pc

But unfortunately I don't read anything on the serial!
I have the doubt that I should use the void SERCOM0_Handler(), but how?

I thought to use the SoftwareSerial library but on the nano 33 iot it's not possible

Why would you need to as the Nano 33 IOT has 2 Serial ports


Serial ports on the Arduino NANO 33 IoT

The USB connector of the board is directly connected to the USB host pins of the SAMD21. This routing enables you to use the Arduino NANO 33 IoT as a client USB peripheral (acting as a mouse or a keyboard connected to the computer) or as a USB host device so that devices like a mouse, keyboard, or an Android phone can be connected to the Arduino NANO 33 IoT. This port can also be used as a virtual serial port using the Serial object in the Arduino programming language. The RX0 and TX1 pins are a second serial port available as Serial1.

Thanks a lot!! :slight_smile:

I tried and it worked well!!

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