cancel
Showing results for 
Search instead for 
Did you mean: 

How to create many software timer in STM32 using single hardware timer?

parth kothiya
Senior

I want to create many(20) software timer using​ single hardware timer of STM32.Timer accuracy in Mili second.

Example:

Timer = T

​T1 start > T1 over & T2 start > T2 over &T3 start....> T(n-1) over & Tn start.

Sequence of timer or sequential timer

​Timer is expired can be start over again when pin goes high.

​​

How can I achieve this?​

This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
KnarfB
Super User

Keep a sorted list (priority queue) of next event's time points and callbacks. FreeRTOS has an implementation you can study, as well as almost every (RT)OS scheduler.

hth

KnarfB

TDK
Super User

start1 = HAL_GetTick();

...

duration1 = HAL_GetTick() - start;

etc...

If you feel a post has answered your question, please click "Accept as Solution".