Skip to content

Instantly share code, notes, and snippets.

@ciniml
Last active August 16, 2022 18:55
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ciniml/bd2bb4dea22a55c067ca6790ad0c3eae to your computer and use it in GitHub Desktop.
Save ciniml/bd2bb4dea22a55c067ca6790ad0c3eae to your computer and use it in GitHub Desktop.
Wio Terminal Grove UART
#include <wiring_private.h>
static Uart Serial3(&sercom3, PIN_WIRE_SCL, PIN_WIRE_SDA, SERCOM_RX_PAD_1, UART_TX_PAD_0);
void setup() {
Serial.begin(115200);
while(!Serial);
Serial3.begin(115200);
pinPeripheral(PIN_WIRE_SCL, PIO_SERCOM_ALT);
pinPeripheral(PIN_WIRE_SDA, PIO_SERCOM_ALT);
}
void loop() {
Serial3.println("test");
delay(1000);
}
void SERCOM3_0_Handler()
{
Serial3.IrqHandler();
}
void SERCOM3_1_Handler()
{
Serial3.IrqHandler();
}
void SERCOM3_2_Handler()
{
Serial3.IrqHandler();
}
void SERCOM3_3_Handler()
{
Serial3.IrqHandler();
}
#include <wiring_private.h>
// GROVE right port
// This disables internal I2C port, which is connected to internal 3-axis accelerometer
static Uart Serial3(&sercom4, D1, D0, SERCOM_RX_PAD_1, UART_TX_PAD_0);
void setup() {
Serial.begin(115200);
while(!Serial);
Serial3.begin(115200);
pinPeripheral(D0, PIO_SERCOM_ALT);
pinPeripheral(D1, PIO_SERCOM_ALT);
}
void loop() {
Serial3.println("test");
delay(1000);
}
void SERCOM4_0_Handler()
{
Serial3.IrqHandler();
}
void SERCOM4_1_Handler()
{
Serial3.IrqHandler();
}
void SERCOM4_2_Handler()
{
Serial3.IrqHandler();
}
void SERCOM4_3_Handler()
{
Serial3.IrqHandler();
}
@ZerMax68
Copy link

Hi, I've tested your GREAT job on wio terminal to drive the rs485 grove modules (https://wiki.seeedstudio.com/Grove-RS485/)

The LEFT port works fine while I can't get the RIGHT port working.

I don't know if this is due to the port definition (static Uart Serial3(&sercom4, D1, D0, SERCOM_RX_PAD_1, UART_TX_PAD_0)) or some other trick, but something is going wrong...

Could you help me to address the problem on the right port ?

Thanks !

@lucadentella
Copy link

Hi

try swapping the RX and TX signals (I changed the white and yellow cables in the connector)... I'm still investigating the reason (I've an idea about it but asked for confirmation to Seeed support) but it worked for me

@ZerMax68
Copy link

Hi Luca, I'll give it a try for sure !

Thanks for your interest, I didn't know you're "frequenting" wio terminal too !!!
I've followed your (SUPERB) work on RPi about green pass reading, really well done, thank you also for that !

(btw, I'm italian too)

@lucadentella
Copy link

;) grazie! I received a test unit from Seeed and I found your same issue. BTW I received a first message from the support and they seem to confirm my idea (pins swapped)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment