MKR NB 1500 Sercom not working

Wiring works on arduino uno using software serial used AT command "AT" to get OK back however when using same code only with sercom not working on MRK NB 1500 board any help appreciated.

#include "wiring_private.h"

Uart mySerial(&sercom3, 1, 0, SERCOM_RX_PAD_1, UART_TX_PAD_0); // Create the new UART instance assigning it to pin 1 and 0

// the setup routine runs once when you press reset:
void setup() {
// initialize serial communication at 9600 bits per second:
Serial.begin(9600);
mySerial.begin(9600);

pinPeripheral(0, PIO_SERCOM);
pinPeripheral(1, PIO_SERCOM); //Assign RX function to pin 1
//Assign TX function to pin 0
delay(2000);
}

// the loop routine runs over and over again forever:
void loop() {
if (mySerial.available())
Serial.write(mySerial.read());
if (Serial.available())
mySerial.write(Serial.read()); // delay in between reads for stability
delay(2000);
}

// Attach the interrupt handler to the SERCOM
void SERCOM3_Handler()
{
mySerial.IrqHandler();
}

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