Usable as an alarm? #6
-
I am looking for a high-resolution STM32 timer library under Arduino and this one looks very good but my specific use case is I am looking to launch functions based on timers that are only .80ms to 23ms in the future. I will be turning GPIO pins on and off based on these "alarms". Can this library be used for this purpose? So specifically fast, one-shot events. I don't want them to repeat. I want to set it up, have it go off, and be gone. If this can be done, I can workout the setup time overhead and take that into account when I set the future timer value. Also, what is the finest resolution for the hardware time interval supported (on an STM32F411CUE6)? What should be the minimum software interval (as a multiplier of the hardware time interval)? Thanks much! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Currently, the timer clock is set at 1MHz, meaning the resolution can be in 1uS range. So 800uS-23000uS is easily achieved, certainly depending on how your code is behaving. Just use the Timer directly, see TimerInterruptTest example Try testing to use these functions to stop /start the timer and verify which are OK for you to use
In the worst case, it's also easy to program the Timers directly using one-shot feature, which this library is not designed to use. Read more about STM32 Timers or ask in the Arduino forum if you need further help. |
Beta Was this translation helpful? Give feedback.
Currently, the timer clock is set at 1MHz, meaning the resolution can be in 1uS range. So 800uS-23000uS is easily achieved, certainly depending on how your code is behaving.
Just use the Timer directly, see TimerInterruptTest example
Try testing to use these functions to stop /start the timer and verify which are OK for you to use
In the worst case, it's also easy to program the Timers directly using one-shot feature, which this library is not designed to use.
Read more about STM32 Timers or ask in the Arduino forum if you need further help.