sparkfun / Arduino_Boards

Board definitions for SparkFun-manufactured AVR, ARM, and ESP-based Arduino boards.
263 stars 125 forks source link

Incomplete pin definitions for Sparkfun SAMD51 Thing PLus #79

Closed ajahern95 closed 1 year ago

ajahern95 commented 3 years ago

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 }.

santaimpersonator commented 1 year ago

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.

Thoughts?

ajahern95 commented 1 year ago

The issue I had, that made me look into pin definitions was I couldn't get the Adafruit music maker featherwing with amp (Adafruit 3436) to work.

It ended up being due to an interrupt that was not defined for D9 on the Sparkfun SamD51 thing plus. Without this, the music maker doesn't work, and was required within the Adafruit library, but it wasn't mentioned in any documentation.

This missing definition was the most important, the rest was me just comparing and making the Sparkfun SAMD 51 pin definition equal to the Adafruit one.


From: santaimpersonator @.> Sent: Wednesday, May 10, 2023 9:00:35 AM To: sparkfun/Arduino_Boards @.> Cc: ajahern95 @.>; Author @.> Subject: Re: [sparkfun/Arduino_Boards] Incomplete pin definitions for Sparkfun SAMD51 Thing PLus (#79)

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 tutorialhttps://learn.sparkfun.com/tutorials/858 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.

Thoughts?

— Reply to this email directly, view it on GitHubhttps://github.com/sparkfun/Arduino_Boards/issues/79#issuecomment-1541093591, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AUADIDSJPXGS7MDOIVSLDELXFLSDHANCNFSM44OWZBXQ. You are receiving this because you authored the thread.Message ID: @.***>

santaimpersonator commented 1 year ago

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 👍

edspark commented 1 year ago

Easy enough fix, thank you for the issue @ajahern95 and bringing this to me @santaimpersonator .