2021-01-22 07:47 AM
Hello
I'm trying to set the HRTIM to generate fixed on-time and variable frequency.
Now I can set the frequency precisely but the duty cycle is somehow held at 50 %.
I have found that similar behavior is expected in so-called "half mode", but the half mode isn't enabled.
I even tried to recover the original compare values, right after setting the period register, but nothing changed.
STM32CUBEMX ioc file and main.c files attached for reference
Thank you very much.
2021-02-02 05:07 AM
Hello,
You can try to use direct register's access:
HRTIM1_TIMA->PERxR = (new_value);
HRTIM1_TIMA->CMP1xR = (new_value);
The change should be visible on pin immediately.
Best Regards,
Jiri