One of the main features of this board is now also tested. I used the CH340 UART to USB bridge on the bottom side of the board successfully. The CH340 is connected to PA24 (used as TX of SERCOM1) and PA25 (used as RX of SERCOM1). I wrote some functions, so my main routine looks quite simple:
int main(void)
{
SystemInit();
// SAMD09 TX-PA24-SERCOM1_PAD2
pin_set_peripheral_function(PINMUX_PA24C_SERCOM1_PAD2);
// SAMD09 RX-PA25-SERCOM1_PAD3
pin_set_peripheral_function(PINMUX_PA25C_SERCOM1_PAD3);
UART_sercom_init(SERCOM1);
UART_sercom_simpleWrite(SERCOM1, 'H');
UART_sercom_simpleWrite(SERCOM1, 'e');
UART_sercom_simpleWrite(SERCOM1, 'l');
UART_sercom_simpleWrite(SERCOM1, 'l');
UART_sercom_simpleWrite(SERCOM1, 'o');
UART_sercom_simpleWrite(SERCOM1, '!');
UART_sercom_simpleWrite(SERCOM1, 0xa);
while (1) ;
}
The complete code can be seen here. This is not prefect code but works well for me for testing.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.