Hi
After the delivery of the SAMD21 mini breakout from Sparkfun,now i am able to configure different Serial ports under different sercoms.
Now,my criteria is to use different pins under same sercom alternatively.For say,the Serial1 is using Sercom0 pins(pin D0 Rx,D1 Tx).Now,i want to use D8 & D9 to communicate with another UART device(I have total 8 diffrent UART devices to read data from/send data to).But D8/D9 is also under same Sercom i.e Sercom0.
Is it possible to configure D8/D9 alternatively(Disabling D0/D1)??
My test code for using different UART ports is as follows:
#include "wiring_private.h"
Uart Serial2 (&sercom2, 3, 2, SERCOM_RX_PAD_1, UART_TX_PAD_2);
Uart Serial3 (&sercom5, 7, 6, SERCOM_RX_PAD_3, UART_TX_PAD_2);
void SERCOM2_Handler()
{
Serial2.IrqHandler();
}
void SERCOM5_Handler()
{
Serial3.IrqHandler();
}
void setup() {
// put your setup code here, to run once:
SerialUSB.begin(9600);
Serial1.begin(9600);
Serial2.begin(9600);
Serial3.begin(9600);
//Serial2
pinPeripheral(3, PIO_SERCOM_ALT);
pinPeripheral(2, PIO_SERCOM);
//Serial3
pinPeripheral(6, PIO_SERCOM);
pinPeripheral(7, PIO_SERCOM);
}
void loop() {
// put your main code here, to run repeatedly:
Serial1.println("Serial1 Test Success");
Serial2.println("Serial2 Test Success");
Serial3.println("Serial3 Test Success");
delay(1000);
}