Updating from SAMD21 SAMD51

Updating @AdinAck SAMD21 board this to SAMD51. I’d appreciate a helping hand on confirming the following please:

We are using ATSAMD51G18A-MF. Considering the SERCOM config, what should be the SPI host pinouts to communicate with 2 SPI devices supporting the simpleFOC firmware?

Currently mapped as -
MOSI- PA12
MISO- PA14
SCK- PA13
SS1- PA18
SS2- PA19

Is this mapping ok?

Is there a test board like a adafruit or sparkfun board you can run tests with? Which implies that Ardunio support is ready for this specific MCU?

Because otherwise, speaking from experience, setting up new SAMD chips to work with Arduino is a bit of a pain.

On the other hand if there is a board you can test on you can check these questions just by running a quick test sketch…

thanks @runger

So, Feather M4 is probably one of the best bets, right? I have personally not tested it but noticed on other forum topics that it is mentioned as tested with the SimpleFOC. So, in theory follow the feather M4 design is a better option?

Yeah, unfortunately there are not so many SAMD51 boards to choose from… the Feather M4 is suitable, but the Adafruit Metro M4 has more pins available, which could be practical.

The Feather M4 Express is using a ATSAMD51J19A - also a 48 pin package. It’s worth checking to be sure but very likely the pinout is the same as the ATSAMD51G18A.

The Metro M4 also has a ATSAMD51J19A but looks like its a 64 pin package…

1 Like

thanks @runger I will check out the Metro

Once we have implemented the intended upgrade to SAMD51 using either Feather M4 Express or Metro M4, my assumption is that the current SimpleFOC code will need only 2 updates in the firmware:

  1. correct pin names/references
  2. Update board reference in platformio.ini

Am I being too optimistic, or in theory that is all we need to change if all goes to plan?

Yes, if you can pretend your board is one of the existing ones, and just use different pins, then this should work.

If you use a different MCU type which doesn’t already have a board description, the work is much more and much harder to create the board files.

You’ll also have to re-tune your PID and LPF settings because the SAMD51 is much faster

@runger

So, you mean pretend it is Metro or Feather M4 Express, correct?

Oh yes, PID and LPF the fun part. Thanks for the reminder :slight_smile:

Yes :slight_smile: if we can masquerade as one of the “ready” boards life is much easier - no board files need to be made and a hardware is available for first tests without having to order a PCB…

@runger thank you for confirming.