-
-
Save ciniml/bd2bb4dea22a55c067ca6790ad0c3eae to your computer and use it in GitHub Desktop.
#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(); | |
} |
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
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)
;) 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)
I am desperately trying to find a way to create _serial
and also set the IRQ handlers inside a class.
Something like this:
SERCOM4_0_Handler = &(_serial.IrqHandler);
I should absolutely be able to set a function pointer to pointer if the handler is a function pointer. But this doesn't work.
So now I'm stuck implementing a global event handler just to deal with these IRQs inside a class. It's wildly inefficient.
I just came across your comments here and thought I would ask if anyone knows a way.
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 !