SAMD21 + DRV8316 Board

Hello, I have just made a motor-mounted controller inspired by @Jason_Kirsons board with the help of @runger designed to fit snugly on 41xx motors.

The Altium files and flashing instructions are on the repository here (WIP).

So far the SAMD21 is able to keep up with controlling motors well enough, and the DRV8316 is also working like a champ (as expected). Motors do not get warm when idle and are essentially silent so it seems to be functioning properly.

The board should be able to work with a supply voltage of up to 40v.
The board also has a USB Type C port and there is a USB protection circuit that pulls DRVOFF high if the USB port is the current source.

Total cost is about $25, assuming you can find stock for the SAMD21G18 ¯_(ツ)_/¯

Here is what it looks like:

Any IO stuff (digital read or write for instance) definitely interfere with the FOC loop so I would like to look into redesigning this board with the RP2040 to utilize the dual cores.


Nice work!


I like the block title :slight_smile:

1 Like

awesome! love it. I think I might try it, with a samd51

1 Like

Haha I just checked the datasheets and I had no idea the pinouts were exactly the same, maybe I’ll get some SAMD51s to put on these boards!

That’s one nice looking board. Excited to see some motors spinning!


Looking at micro controllers. I can buy aSTM23M4 for the price of a SAM21. The M4 has hardware floating point and CAN bus pins. The crazy chip supply has some M4 cheaper than M0

Multitasking can be make easier with an RTOS. But I admit to ignorance about mixing SimpleFOC and an RTOS although Google finds many people running FOC in a real-time task.

Using a faster uP with hardware math and one of the RTOSes opens up a lot of silly stuff like “Micro ROS”, CAN bus, One is, another is