STM32_ISR_Servo Library

STM32_ISR_Servo library GitHub release
arduino-library-badge

Why do we need this STM32_ISR_Servo library

Features

This library enables you to use 1 Hardware Timer on an STM32F/L/H/G/WB/MP1-based board to control up to 16 independent servo motors.


Currently supported Boards

  1. STM32F/L/H/G/WB/MP1 boards (with 32+K Flash)
  • Nucleo-144
  • Nucleo-64
  • Discovery
  • Generic STM32F0, STM32F1, STM32F2, STM32F3, STM32F4, STM32F7 (with 64+K Flash): x8 and up
  • STM32L0, STM32L1, STM32L4, STM32L5
  • STM32G0, STM32G4
  • STM32H7
  • STM32WB
  • STM32MP1
  • LoRa boards
  • 3-D printer boards
  • Generic Flight Controllers
  • Midatronics boards


Changelog

Releases v1.0.0

  1. Basic 16 ISR-based servo controllers using 1 hardware timer for STM32F/L/H/G/WB/MP1-based board
  2. Tested with STM32L5 (NUCLEO_L552ZE_Q) and STM32H7 (NUCLEO_H743ZI2)

Examples

Examples:

  1. STM32_ISR_MultiServos
  2. STM32_MultipleRandomServos
  3. STM32_MultipleServos
  4. ISR_MultiServos
  5. MultipleRandomServos
  6. MultipleServos

Example STM32_ISR_MultiServos on NUCLEO_L552ZE_Q

The following is the sample terminal output when running example STM32_ISR_MultiServos on new Nucleo-144 STM32L5 NUCLEO_L552ZE_Q to demonstrate how to control multiple Servos using 1 hardware timer.

Starting STM32_ISR_MultiServos on NUCLEO_L552ZE_Q
STM32_ISR_Servo v1.0.0
[ISR_SERVO] STM32TimerInterrupt: Timer Input Freq (Hz) = 110000000
[ISR_SERVO] Frequency = 1000000.00 , _count = 10
[ISR_SERVO] Starting  ITimer OK
Setup Servo1 OK
Setup Servo2 OK
Servo1 pos = 0, Servo2 pos = 180
Servo1 pos = 30, Servo2 pos = 150
Servo1 pos = 60, Servo2 pos = 120
Servo1 pos = 90, Servo2 pos = 90
Servo1 pos = 120, Servo2 pos = 60
Servo1 pos = 150, Servo2 pos = 30
Servo1 pos = 180, Servo2 pos = 0
Servo1 pos = 180, Servo2 pos = 0
Servo1 pos = 150, Servo2 pos = 30
Servo1 pos = 120, Servo2 pos = 60
Servo1 pos = 90, Servo2 pos = 90
Servo1 pos = 60, Servo2 pos = 120
Servo1 pos = 30, Servo2 pos = 150
Servo1 pos = 0, Servo2 pos = 180
Servo1 pos = 0, Servo2 pos = 180
Servo1 pos = 30, Servo2 pos = 150
Servo1 pos = 60, Servo2 pos = 120
Servo1 pos = 90, Servo2 pos = 90
Servo1 pos = 120, Servo2 pos = 60
Servo1 pos = 150, Servo2 pos = 30
Servo1 pos = 180, Servo2 pos = 0