Skip to main content
Visitor II
February 15, 2024
Solved

Problem when change delai of a synced timer

  • February 15, 2024
  • 2 replies
  • 2118 views

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

    This topic has been closed for replies.
    Best answer by mika14

    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

    2 replies

    Super User
    February 15, 2024

    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.

     

    mika14Author
    Visitor II
    February 15, 2024

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

    mika14AuthorAnswer
    Visitor II
    February 19, 2024

    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