New Portenta_H7_ISR_Servo Library

Portenta_H7_ISR_Servo library GitHub release
How To Install Using Arduino Library Manager


Features

This library enables you to use 1 Hardware Timer on an STM32H747XI-based Portenta_H7 board to control up to 16 independent servo motors.

These hardware timers, using interrupt, still work even if other functions are blocking. Moreover, they are much more precise (certainly depending on clock frequency accuracy) than other software timers using millis() or micros(). That's necessary if you need to measure some data requiring better accuracy.

Functions using normal software timers, relying on loop() and calling millis(), won't work if the loop() or setup() is blocked by certain operation. For example, certain function is blocking while it's connecting to WiFi or some services.


Currently Supported Boards

This Portenta_H7_ISR_Servo library currently supports the following boards:

  1. Portenta_H7 boards, using ArduinoCore-mbed mbed_portenta core


Changelog

Initial Releases v1.0.0

  1. Basic 16 ISR-based servo controllers using 1 hardware timer for STM32H747XI-based Portenta_H7 boards

Examples

  1. Portenta_H7_ISR_MultiServos
  2. Portenta_H7_MultipleRandomServos
  3. Portenta_H7_MultipleServos

Debug Terminal Output Samples

1. Portenta_H7_ISR_MultiServos on PORTENTA_H7_M7

This is the terminal output when running Portenta_H7_ISR_MultiServos on Portenta_H7.

Starting Portenta_H7_ISR_MultiServos on PORTENTA_H7_M7
Portenta_H7_ISR_Servo v1.0.0
[ISR_SERVO] Portenta_H7_FastTimerInterrupt: Timer Input Freq (Hz) = 200000000
[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
1 Like