2017-09-23 03:32 AM
Hello, I am trying STM32H7 HRTIM1, i could set duty cycle and period when i first initialize timer, but after that, i can't change duty cycle. usually, i write direly to compare register, but now it has no effect. I am running HRTIM1 TD1 and writing HRTIM1->sTimerxRegs[3].CMP1xR = newvalue; dosent to anything, while it what is done in init function to set timer in the first place. Could any one give me explanation how to do it ?
Thanks #stm32h7 #hrtim12017-09-23 09:59 AM
2018-06-07 07:21 AM
I was having the same problem. I would update the period, but the output waveform would not change. In the Reference Manual, I found that one needs to set one of the update event modes for changes to take effect. In CubeMX. change the following line to enable updates on timer reset or expire.
sConfig_timerD.ResetTrigger = HRTIM_TIMRESETTRIGGER_NONE; // will not update
to
sConfig_timerD.ResetTrigger = HRTIM_TIMRESETTRIGGER_ENABLED; // updates
I am using the HRTIM to provide a programmable external clock. It works great.