How to set the STM32G474 HRTIM to variable frequency with constant on-time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-01-22 7: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.
- Labels:
-
HRTIM
-
STM32CubeMX
-
STM32G4 Series
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2021-02-02 5: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
