2024-02-23 05:39 AM - last edited on 2024-03-04 12:28 AM by SofLit
Hallo,
I have to use shadow registers (PREEN=1) in HRTIM slave timers.
I have decided to use following configuration:
UPDGAT = 0110: the update occurs on the update event following a rising edge of HRTIM update enable input 1 (hrtim_upd_en1) to perfectly synchronise registry update after software command.
I want to evoke "hrtim_upd_en1" directly from software.
I hope that TIM16.EGR registry should allow it exclusively, even without running TIM16 counter.
Am I wrong?
2024-02-29 02:43 AM
Hello @DrDro,
Thanks for your question!
First, a short reminder : "when the preload mode is enabled, accessed registers are shadow registers. Their content
is transferred into the active register after an update request, either software or synchronized with an event." (page 1545 of RM0399)
You configured UPDGAT = 0110, the update is done on the update event following a request on the update enable input 1..3 (the event can be enabled with TxREPU, MSTU or TxU).
If you want to update from software, I suggest you to directly write 1 into TxSWU bit in HRTIM_CR2.
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2024-03-03 10:33 PM
Thank you, Pierre,
yes, that is the easiest way using TxSWU.
You have expresed here very clearly "update event" and "update request". This helps a lot to understand the logic behind. In RM it is not so obvious. Thanks a lot for this disambiguation.
However, transfering shadow registers immediate on TxSWU is not good solution for me, I need a seguence: update on the update event (timer reset) following the request (software write).
Greetings
2024-03-04 01:46 AM
Hello @DrDro,
When the preload is enabled (PREEN bit set), there are 3 use cases :
If you want to update registers on the timer reset, you should have a look on this figure (especially the option 2) :
Did I answer your question ?
Best Regards,
Pierre
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.