Incomplete pin definitions for Sparkfun SAMD51 Thing PLus
ajahern95 opened this issue · 4 comments
The pin definitions does not fully line up with the pinout of the SAMD51 Thing Plus pin out, as seen here: https://cdn.sparkfun.com/assets/c/a/8/6/8/ThingPlusSamD51a.pdf
For example, D9 the interrupt and analog is not attached, nor analog on D4. D9 is important on the Adafruit Music Maker Feather Shield (https://www.adafruit.com/product/3436), as it is used as an interrupt to allow background music playback. In the current state, background music playing results in nothing happening. For a new or unexperienced user, they might think that either the Thing Plus or Music Maker shield is broken.
Original line for D9 in variants.cpp:
{ PORTA, 7, PIO_DIGITAL, PIN_ATTR_DIGITAL, No_ADC_Channel, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_NONE }
Possible corrections:
{ PORTA, 7, PIO_DIGITAL, PIN_ATTR_DIGITAL, ADC_Channel7, NOT_ON_PWM, NOT_ON_TIMER, EXTERNAL_INT_7 }.
I wan't to say that we intentionally left out some of the additional pin functionalities for a specific reason(s), but I don't remember why. (That was back in 2019. Maybe pin compatibility... like it could only be defined as a digital pin or analog pin?)
However, I do remember we linked in the Adding More SERCOM Ports for SAMD Boards tutorial to the SAMD51 Thing Plus hookup guide. This was for specific use cases, where users needed to modify the board definitions. Maybe we could clarify that more in the hardware overview or Arduino IDE sections.
- It looks like we only have it linked at the end of the paragraph in the Hardware Overview section:

- Maybe, if we linked the SERCOM tutorial like the board definition tutorial from the ESP32 guide:

Thoughts?
Ahh, got it. Sorry, I trying to refresh my memory on the pin funtionality and for some reason thought this was about the SERCOM ports and ADC 🤷.
I know the engineer put interrupts on specific pins for various reasons around funtionality. However, I don't remember if there was a limit to the number of interrupts that can be attached. Unfortunately, the engineer that worked on this board has moved on from SparkFun, but I can see if the engineering team has the bandwidth to look into the changes you proposed.
Update:
Upon digging further into the interrupts to update our hookup guide... you might be right.
I thought the interrupts might be limited to 16 pins, as mentioned in the datasheet. However, I noticed that we declared interrupts on almost all the pins on the SAMD51 MicroMod. I'll ping the engineering team to take a look, when they have time.
That said, I can definitely update the tutorial on which pins have an interrupt functionality 👍
Easy enough fix, thank you for the issue @ajahern95 and bringing this to me @santaimpersonator .