Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom pin mapping for ATSAMD21G18A #195

Open
dotnetmaster opened this issue Dec 12, 2022 · 1 comment
Open

Custom pin mapping for ATSAMD21G18A #195

dotnetmaster opened this issue Dec 12, 2022 · 1 comment

Comments

@dotnetmaster
Copy link

dotnetmaster commented Dec 12, 2022

Hi everyone,
I'm working with a custom breakout board for ATSAMD21G18A chip. Unfortunately, the board pin mapping is not based on other products, and some of the pins on IC have been assigned different names from boards on the market.
For example, PA11 is assigned to D0, which is typical of other boards, too, but PA20 is mapped to D1 instead of PA10.
After a few days of trying and error and researching, I have not found any documentation regarding the UF2 bootloader, and it pin mapping system. I can see the board_config.h is used for the SAMD51 based board to define this configuration, but I have not been able to replicate that for ATSAMD21G18A-A board_config.h file as it won't compile.
I have also tried adding the following, hoping it may work, which did not,
#define LED_PIN PIN_PA17 #define PIN_D0 PIN_PA11 --Me trying to add config #define PIN_D1 PIN_PA20 --Me trying to add config #define LED_TX_PIN PIN_PA27 #define LED_RX_PIN PIN_PB03
Based on my understanding from my research Arduino has a variant.h file that this configuration can be defined, but I have not found something similar on the repository yet.
Any help or even showing the right direction would be highly appreciated.
Thanks.
Alex

@dotnetmaster dotnetmaster changed the title Custom pin mapping for ATSAMD21G18A-A Custom pin mapping for ATSAMD21G18A Dec 12, 2022
@DefProc
Copy link

DefProc commented Dec 14, 2022

I think you might be conflating the Arduino pin names (D0, D1), with the chip level pin/port numbers used by the UF2 bootloader.

The LED_PIN, LED_TX_PIN and LED_RX_PIN are options for the bootloader, in the board_config.h file.

The pin mapping that you use in the Arduino sketch (0, 1, A0, A1, LED_BUILTIN, etc.) are in the board variant file in Arduino. The UF2 bootloader and your Arduino code are completely separate, and don't communicate between each other.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants