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?​

2 REPLIES 2
KnarfB
Principal III

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
Guru

start1 = HAL_GetTick();

...

duration1 = HAL_GetTick() - start;

etc...

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