Black Lives Matter - Action and Equality. ... Adafruit is open and shipping.

Adafruit Feather M4 Express SERCOM
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit Feather M4 Express SERCOM

by jeffLunar on Wed Jul 31, 2019 5:38 pm


I am trying to create a new UART using the SERCOM functionality provided in the documentation. We are trying to create the new UART on pins A4 and A5. Here is the diagram that I am using to determine the SERCOM:PAD for the two pins.

Image of Adafruit Feater M4 Express
Capture.PNG (285.08 KiB) Viewed 274 times

According to the pin layout, A4 and A5 uses SERCOM0 on PADS 0 and 2 respectively. Following your guide here, I created the following code:

Code: Select all | TOGGLE FULL SIZE
#include <Arduino.h>   // required before wiring_private.h
#include "wiring_private.h" // pinPeripheral() function
Uart new_serial (&sercom0, 18, 19, SERCOM_RX_PAD_0, UART_TX_PAD_2);
void SERCOM0_Handler()
void setup() {
  pinPeripheral(18, PIO_SERCOM);
  pinPeripheral(19, PIO_SERCOM);
uint8_t i=0;
void loop() {
  if (new_serial.available()) {
    Serial.print(" -> 0x"); Serial.print(, HEX);

Running the code on the m4 express, we are receiving nothing from the new serial port that we are creating. We are at a brick wall trying to determine why this isn't working. Anyone have any suggestions?

I was able to change the new_serial to Serial1 with the same baud rate and was able to read the hex values correctly.

Posts: 1
Joined: Wed Jul 31, 2019 5:26 pm

Re: Adafruit Feather M4 Express SERCOM

by adafruit_support_mike on Fri Aug 02, 2019 1:14 am

The SAMD51's SERCOMs are slightly different from the SAMD21's, covered in the tutorial you linked.

If you search the forum for 'SAMD51 SERCOM', you'll find threads discussing the issue, many of which have sample code:


Posts: 61197
Joined: Thu Feb 11, 2010 2:51 pm

Please be positive and constructive with your questions and comments.