cancel
Showing results for 
Search instead for 
Did you mean: 

Problem when change delai of a synced timer

mika14
Associate II

Hello Forum,

 

I am struggling with a sync timer problem and I have no more idea for resolve it. Here we go :

TMR5 is configured as master for TMR3

TMR3 is configured as master for TMR4

 

I configured TMR3 as OnePulse output signal with a delai from a OutputCompareStatus of TMR5

I configured TMR4 as PWM signal started by OutputCompareStatus of TMR3

 

I do Init/Configure/Start after a powerOn and the system works well. I want to do an update of the delai on TMR3 and, impossible to have a correct synchronization between my signals as in the first call.

I did several attempt and I lost my self in all theses, someone know the exact sequence of call I have to do for make the magic happened ?

Thanks a lot

 

When it works,

mika14_0-1708009435115.png

 

Any other attempt stop/update same delai/start, the blue wave loose the synchro

mika14_2-1708009506263.png

 

 

 

Mickael

1 ACCEPTED SOLUTION

Accepted Solutions
mika14
Associate II

Hello,

 

For people meet same kind of problems, the DeInit API for TIM_PWM and TIM_OC can be replaced by

__HAL_RCC_TIMX_FORCE_RESET/

__HAL_RCC_TIMX_RELEASE_RESET

 

Then, I modified my value of Delay of my first slave and duty of second slave.

Finally, call Init/ConfigChannel/MasterEx/SlaveConfig,Start.

 

Bye

 

Mickael

View solution in original post

3 REPLIES 3
TDK
Guru

If you give a graph that shows the behavior you want, typically something can be done.

> I configured TMR4 as PWM signal started by OutputCompareStatus of TMR4

Probably a typo here. Unlikely to be able to start TIM4 by looking at itself.

 

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

yes ! Error of typo, I added also graphs, thanks a lot for your feedback.

mika14
Associate II

Hello,

 

For people meet same kind of problems, the DeInit API for TIM_PWM and TIM_OC can be replaced by

__HAL_RCC_TIMX_FORCE_RESET/

__HAL_RCC_TIMX_RELEASE_RESET

 

Then, I modified my value of Delay of my first slave and duty of second slave.

Finally, call Init/ConfigChannel/MasterEx/SlaveConfig,Start.

 

Bye

 

Mickael