Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Accessing extra serial ports on the Grand Central
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Accessing extra serial ports on the Grand Central

by gradybooch on Sat Apr 11, 2020 11:30 pm

It took me a bit of time to sort out how to access additional serial ports on the Grand Central. Here's what works for me, which I'm sharing here to save you all time.

Code: Select all | TOGGLE FULL SIZE
#include <Arduino.h>
#include "wiring_private.h"

const int serial2TX = 14;
const int serial2RX = 15;
const int serial3TX = 16;
const int serial3RX = 17;
const int serial4TX = 18;
const int serial4RX = 19;

Uart Serial2(&sercom5, serial2TX, serial2RX, SERCOM_RX_PAD_1, UART_TX_PAD_0);
Uart Serial3(&sercom1, serial3TX, serial3RX, SERCOM_RX_PAD_1, UART_TX_PAD_0);
Uart Serial4(&sercom4, serial4TX, serial4RX, SERCOM_RX_PAD_1, UART_TX_PAD_0);

void SERCOM5_0_Handler() {
  Serial2.IrqHandler();
}
void SERCOM5_1_Handler() {
  Serial2.IrqHandler();
}
void SERCOM5_2_Handler() {
  Serial2.IrqHandler();
}
void SERCOM5_3_Handler() {
  Serial2.IrqHandler();
}
 
void SERCOM1_0_Handler() {
  Serial3.IrqHandler();
}
void SERCOM1_1_Handler() {
  Serial3.IrqHandler();
}
void SERCOM1_2_Handler() {
  Serial3.IrqHandler();
}
void SERCOM1_3_Handler() {
  Serial3.IrqHandler();
}
 
void SERCOM4_0_Handler() {
  Serial4.IrqHandler();
}
void SERCOM4_1_Handler() {
  Serial4.IrqHandler();
}
void SERCOM4_2_Handler() {
  Serial4.IrqHandler();
}
void SERCOM4_3_Handler() {
  Serial4.IrqHandler();
}

gradybooch
 
Posts: 13
Joined: Sun Sep 16, 2018 9:04 pm

Please be positive and constructive with your questions and comments.