Skip to content

[variant] Fix XIAO M0 Plus pin definitions and add PIN_NEOPIXEL#81

Open
cumin777 wants to merge 3 commits into
Seeed-Studio:masterfrom
cumin777:master
Open

[variant] Fix XIAO M0 Plus pin definitions and add PIN_NEOPIXEL#81
cumin777 wants to merge 3 commits into
Seeed-Studio:masterfrom
cumin777:master

Conversation

@cumin777
Copy link
Copy Markdown

@cumin777 cumin777 commented May 18, 2026

Summary

Two changes for the XIAO M0 Plus variant:

  • Add PIN_NEOPIXEL macro in variant.h — Define PIN_NEOPIXEL as alias to PIN_LED_RGB (D11/PA27) for compatibility with the Adafruit NeoPixel library and its example sketches.

  • Rewrite variant.cpp with complete and corrected pin definitions based on schematic 202004620_XIAO SAMD21-Plus_V1.0, covering all 31 pins. Bug fixes included:

    • PA15/PA14: TC3 only has CH0/CH1, corrected from invalid CH3/CH2
    • PA19: TC3/WO[1] is on F-mux, use PIO_TIMER_ALT instead of PIO_TIMER
    • PB23: No EXTINT line on SAMD21G18A, use EXTERNAL_INT_NONE instead of EXTERNAL_INT_7

Test plan

  • Verify Adafruit NeoPixel strandtest sketch compiles and runs on XIAO M0 Plus
  • Verify attachInterrupt() on D24 does not cause unexpected behavior
  • Test PWM output on D15 (PA15) and D16 (PA14)
  • Test PWM output on D19 (PA19)
  • Test I2C0 (D4/D5), I2C1 (D13/D14), SPI (D8-D10), UART (D6/D7)

🤖 Generated with Claude Code

cumin777 and others added 2 commits May 18, 2026 19:32
Adafruit NeoPixel library expects PIN_NEOPIXEL. Define it as alias
to PIN_LED_RGB (D11/PA27) for compatibility.

Co-Authored-By: Claude <noreply@anthropic.com>
…d pin definitions

Based on schematic 202004620_XIAO SAMD21-Plus_V1.0, define all 31 pins
including I2C0/I2C1 (SERCOM2/SERCOM1), SPI (SERCOM0), UART (SERCOM4),
I2S, RGB LED, user button, and additional GPIOs.

Bug fixes included:
- PA15/PA14: TC3 only has CH0/CH1, corrected from invalid CH3/CH2
- PA19: TC3/WO[1] is on F-mux, use PIO_TIMER_ALT instead of PIO_TIMER
- PB23: No EXTINT line, use EXTERNAL_INT_NONE instead of EXTERNAL_INT_7

Co-Authored-By: Claude <noreply@anthropic.com>
@cumin777 cumin777 changed the title [variant] Fix XIAO M0 Plus variant pin definitions [variant] Fix XIAO M0 Plus pin definitions and add PIN_NEOPIXEL May 18, 2026
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

Successfully merging this pull request may close these issues.

1 participant