I have some issue getting SERCOM Serial to work ...
SerialUSB is working fine ...
I2C is working fine ...
I made a board with "almost" similar pinout as Arduino Zero ...
UART0 is PA11/PA10 ( Rx/Tx )
UART1 is PB09/PB08 ( Rx/Tx )
I want to access the Serial1 or Serial2 but both I read both the Sparkfun & Adafruit documentation link below, still could NOT get it working...
Looking at the codes, I hv setup the Sercom4 with pad1 & pad0
I also hv setup the pinPeripheral
pinPeripheral(15, PIO_SERCOM_ALT);
pinPeripheral(16, PIO_SERCOM_ALT);
No compilation or upload errors , just no output ...
I have open up both variant.cpp and variant.h and SERCOM.h files at the SAMD cores
I connect both the Serial1 and Serial2 Tx pins to a FTDI USB Serial port to check the output ....
https://learn.sparkfun.com/tutorials/adding-more-sercom-ports-for-samd-boards#helpful-charts
#define PIN_SERIAL2_RX (16ul)
#define PIN_SERIAL2_TX (15ul)
#define PAD_SERIAL2_TX (0x1ul)
#define PAD_SERIAL2_RX (0x0ul)
// PB09 , PB08, SERCOM4 , Pad1, Pad0
Uart Serial2(&sercom4,16ul, 15ul, SERCOM_RX_PAD_1,UART_TX_PAD_0);
void SERCOM4_Handler()
{
Serial2.IrqHandler();
void setup() {
Serial.begin(57600);
while (!Serial) {
; // wait for serial port to connect
}
Serial1.begin(57600);
Serial2.begin(57600);
pinPeripheral(15, PIO_SERCOM_ALT);
pinPeripheral(16, PIO_SERCOM_ALT);
pinPeripheral(0, PIO_SERCOM);
pinPeripheral(1, PIO_SERCOM);
delay(500);
Serial.println("SAMD21 Serial");
Serial1.println("SAMD21 Serial1");
Serial2.println("SAMD21 Serial2");
}
}