arduino / arduino/ArduinoCore-samd

Please add board / proper support for SAMD21 M0-Mini

Open
#470 6 comments 0 reactions 0 assignees View on GitHub
Dominant language
C
Stars
502
Forks
740
PR merge metrics
No merged PRs in 30d

Description

I am using a SAMD21 M0-Mini board ([example of the board](https://robotdyn.com/samd21-m0-mini-not-soldered.html) and [pinout for the board](https://opencircuit.shop/resources/file/0ee249942886233981d19636ef21cca3b46316a7067/Pinout-SAMD21-M0-Mini.jpg)).

This board is available from different manufacturers and labeled either as 'Wemos' or 'Robotdyn'.

I have seen blogs stating that one should select board "Arduino Zero (USB Native Port) for this board. This works but gives problems for SPI.

The problem is that the 'Arduino Zero (USB Native Port)' board definition defines SPI pins as part of the ICSP connector which is on the top of the board but these pins are not available on the side/bottom of the board which is not breadboard-friendly.

Instead I would like to use other pins on the side/bottom of the board for the standard SPI port. This currently appears not to be supported.
Adding a separate board definition for the SAMD21 M0-Mini (where the standard SPI port is defined using pins on the side/bottom) could fix this.

I know that it is possible to define a second SPI port which is described in the Adafruit article [Creating a new SPI](https://learn.adafruit.com/using-atsamd21-sercom-to-add-more-spi-i2c-serial-ports/creating-a-new-spi). But that adds second SPI port. It does not redefine the pins for the _standard SPI port_.
It is important that the _standard SPI_ port and not a second SPI port because using the second SPI port does require that current code and libraries need to be modified, which depending on the quality of the code/libraries, may either be relatively easy or more complex and difficult to implement.
To make the standard SPI port available on other more regular pins than those of the ICSP connector on top, either the standard SPI pins need to be remapped/redefined in setup() (if possible at all and I don't know how) or a separate board definition for the SAMD21 M0-Mini needs to be added.

It is more useful and more common to define the default SPI port on pins that are available on the side/bottom than define them for the pins of the ICSP connector (that is only available on top).

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at setup() and the existing Arduino Zero (USB Native Port) board definition, then compare its standard SPI mapping with the linked SAMD21 M0-Mini pinout. Define the board so standard SPI uses the side/bottom pins, and verify that existing SPI code and libraries work without requiring a second SPI port or code changes.

Written by the indexing model from the issue text.

Assessment

Tech stack
arduino, c
Domain
embedded-iot
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.