Post · 9 min read· pp. 148–154

Supported microcontrollers

On this page

Arduino SimpleFOClibrary supports over 20 different microcontroller architectures, giving you flexibility to choose the best MCU for your specific project needs.

Supported Families

The main families supported off-the-shelf are:

And we continue extending support to more architectures! 😃


Choosing the Right Microcontroller

There are three main parameters when choosing the microcontroller for your project:

  1. Processing power (clock speed, architecture, etc.) - this will determine the performance of the FOC algorithm and the maximum speed of your motor.
  2. PWM generation capabilities - this will determine the number of motors you can control and the control modes you can use.
  3. ADC sensing capabilities - this will determine the current sensing options you have for your project.

1. Processing power

When it comes to the processing power, the rule of thumb is:

  • The higher the clock speed the better.
  • Aim for the FOC execution time of loopFOC() to be above 1kHz (ideally above 5kHz) depending on the motor and sensor combination you are using.

This table gives you a rough comparison of the performance of different MCUs with this library. It gives an estimated loop frequency (loopFOC() + move()) for one motor and sensor combination (BLDC + sensor) that you can expect to achieve with the library on each MCU. The values are approximate and can vary depending on the specific board, motor, sensor, and other factors.

1574=Nucleo-64&aggOrder=0%7C1%7C2%7C3%7C4%7C5%7C6%7C7%7C8%7C9%7C10%7C11%7C12%7C13%7C14%7C15%7C16%7C17%7C18%7C19%7C20%7C21" target="_blank" rel="noopener noreferrer">Nucleo-144, Nucleo-144, B-G431B-ESC1Best overall choice for FOC controlSTM32 F172Hz32🟢 Good1-5kHzBluepill, BlackpillBudget-friendly, good performance (⚠️ sometimes limited in memory)STM32 L480MHz32🟢 Good1-5kHzNucleo-64Low-power applications, good performanceTeensy 4.x600MHz32🟢 Prime>10kHzTeensy 4.0, 4.1High-performance, High-end solution, comparable to STM32H7 (limited low-side ADC support)Teensy 3.x72-180MHz32🟢 Good1-5kHzTeensy 3.2, 3.5, 3.6Robotics, reliable real-time controlESP32, ESP32-S2/S3240MHz32🟢 Excellent>5kHzESP32 DevKit, ESP3S2 QtPyGreat performance, IoT integration, Dual-CoreESP32-C2/C3/C6120-160MHz32🟢 Good1-5kHzXIAO ESP32-C3, XIAO ESP32-C6Good performance Much worse than ESP32 or ESP32-S2/3 thoughRP2040 (Pico)125MHz32🟢 Good5-10kHzRaspberry Pi PicoDual-core projects, cost-effectiveArduino DUE84MHz32🟡 Fair1-5kHzArduino DUE32-bit Arduino, good option if you already have one on handSAMD51120MHz32🟢 Good5-10kHzAdafruit Feather M4, SparkFun Thing Plus, Metro M4Good performance, not commonSAMD2148MHz32🟡 Fair1-5kHzNano 33 IoT, QtPy SAMD21, XIAO SAMD21Budget-friendly, OK performance (⚠️ sometimes limited in memory)Renesas48MHz32🟡 Fair1-5kHzArduino UNO R4Modern Arduino, not the best performance but a significant upgrade over the AVR-based UNOSilabs MGM240S78MHz32🟢 Good5-10kHzArduino Nano MatterMatter/IoT integration (v2.4.0+)AVR (8-bit)16MHz8🔴 Limited<1kHzArduino UNO, Arduino MEGA, Arduino Nano, Arduino LeonardoLearning FOC, simple single-motor projectsESP826680MHz32🔴 Limited<1kHzESP8266 NodeMCU, Wemos D1 MiniGood for IoT projects, very limited real-time performance

⚠️ Arduino UNO/MEGA Encoder Limitation

For Arduino UNO/MEGA with encoders, keep total system pulses under 20,000 pulses/second to avoid execution issues.

Example Calculation

With a 10,000 CPR encoder: Maximum motor speed = 120 RPM (2 rotations/second)

Recommendation: Use magnetic sensors (SPI/I2C) instead of encoders with 8-bit Arduino boards.

Performance Guidelines:

  • ✅ Optimal: Loop time < 0.5ms (>2kHz)
  • ⚠️ Acceptable: Loop time 1-4ms (250-1000Hz)
  • ❌ Poor: Loop time > 4ms (<250Hz)

Multi-Motor Systems: If you need to control multiple motors, remember to account for the total system load. Divide the expected loop frequency by the number of motors to ensure you stay within performance limits. The same performance guidelines apply.


2. PWM Generation Capabilities

Most supported MCUs can generate all PWM modes (2, 3, 4, and 6 PWM) with configurable frequencies. 2 and 4 PWM modes are used Stepper drivers (Stepper motors), while 3 and 6 PWM modes are used for BLDC drivers (BLDC motors and Steppers using hybrid control).

MCU2 PWM4 PWM3 PWM6 PWMFrequency Config
Arduino (8-bit)✔️✔️✔️✔️✔️ (4kHz or 32kHz)
STM32✔️✔️✔️✔️✔️
ESP32 (MCPWM/LEDC)✔️✔️✔️✔️✔️
Teensy✔️✔️✔️✔️✔️
SAMD21/51✔️✔️✔️✔️✔️
Raspberry Pi Pico✔️✔️✔️✔️✔️
Renesas (UNO R4)✔️✔️✔️✔️✔️
Arduino Nano Matter✔️✔️✔️✔️✔️
nRF52✔️✔️✔️✔️✔️
Arduino DUE✔️✔️✔️❌✔️
ESP8266✔️✔️✔️❌✔️
Portenta H7✔️✔️✔️❌✔️

Note: If you need 6 PWM mode (for specific drivers), avoid MCUs marked with ❌.

See the guide to choosing PWM-capable pins


3. Current Sensing (ADC) Capabilities

Most of the supported MCUs can perform inline current sensing using the ADC, which is the a very common method for FOC control. However, low-side current sensing is equaly as common for high-performance applications and is supported by a smaller subset of high-end MCUs. Make sure to check the table below if you need low-side sensing for your project.

MCUInlineLow-sideHigh-sideNotes
STM32 F1/F4/G4/L4/F7/H7✔️✔️❌Best current sensing support
ESP32/ESP32-S3✔️✔️❌Good ADC, dual-core advantage
ESP32-C6✔️✔️❌Single core, lower CPU performance
Teensy 4✔️✔️ (one motor)❌High-speed ADC
SAMD21✔️✔️ (one motor)❌Limited testing
Arduino Nano Matter✔️✔️ (one motor)✔️ (untested)Newest support (v2.4.0)
Arduino AVR (8-bit)✔️❌❌Inline only
Arduino DUE✔️❌❌Inline only
SAMD51✔️❌❌Inline only
Teensy 3✔️❌❌Inline only
Raspberry Pi Pico✔️❌❌Inline only
ESP32-S2/C3✔️❌❌Inline only
Portenta H7✔️❌❌Inline only
nRF52✔️❌❌Inline only
Renesas (UNO R4)❌❌❌No current sensing yet
ESP8266❌❌❌No ADC support for sensing
STM32 B-G431B-ESC1❌✔️ (one motor)❌Dedicated ESC board

Most boards support inline current sensing. Low-side sensing is available primarily on STM32, ESP32, Teensy 4, and SAMD21.

See the guide to choosing ADC-capable pins


Quick Selection Guide

General Recommendations

  1. If possible, use STM32 - Best overall choice for FOC control
  2. ESP32 or Teensy - Excellent alternatives, each one with their own strengths and limitations
  3. Other 32-bit boards - Fine if current sensing isn’t required or not crucial for your project
  4. 8-bit Arduino - Acceptable for learning and simple single-motor projects
  5. Custom optimization - If you have specific requirements, start with what you have and optimize the library for your use case

Specific Use Cases

Best Overall Performance:

  • STM32 H7 - Top-tier performance for demanding applications and multi-motor systems
  • STM32 F4/G4/F7 - Excellent performance and features for most FOC projects

Alternative High-Performance Options with some limitations

  • Teensy 4.x - Amazing performance (comparable to STM32 H7), can handle fast multi-motor systems
    • ⚠️ limited low-side sensing support (one motor only)
  • ESP32 - Excellent for IoT/wireless projects, great performance
    • If possible, choose ESP32 or ESP32-S3 for better ADC performance and low-side sensing support
    • If using ESP32-C2/C3/C6, be aware of the significantly lower CPU performance. Low-side sensing is supported on the ESP32-C6, but not on the ESP32-C2/C3
    • ⚠️ Aim for one motor with current sensing for optimal performance,
      • multi-motor systems with current sensing may require optimization and careful load management
      • multiple motors without current sensing should be fine

Budget-Friendly with Good Performance:

  • Need current sensing?
    • STM32 F1 - Best price/performance ratio (especially Bluepill/Blackpill boards)
      • ⚠️ check memory limits (use 128KB flash versions)
    • SAMD21 - Affordable with good enough performance for simple projects
      • ⚠️ check memory limits (should have more than 64kB flash)
  • Don’t need current sensing?
    • Arduino DUE - 32-bit Arduino with good performance if you already have one on hand
    • Raspberry Pi Pico (RP2040) - Dual-core capability at low cost, good for projects without current sensing
    • nRF52 - Good for low-power wireless projects without current sensing
    • SAMD51 - Good performance but less common, check availability

Other Options:

  • Arduino UNO/MEGA - Acceptable for learning and simple single-motor projects
    • ⚠️ limited performance with encoders, use magnetic sensors instead
    • ⚠️ poor current sensing capabilities (inline only, no low-side sensing)
  • ESP8266 - Good for IoT projects, very limited real-time performance, not recommended for FOC control
    • ⚠️ no ADC support for sensing, not suitable for FOC control

diagram SimpleFOC Community

If you have ported the library to another device or need help porting to a specific platform, please visit our community forum!

You’ll find answered questions, implementation stories, and helpful community members ready to assist.


Copyright © 2026. Distributed by an MIT license.