2025-03-24 4:46 PM
2025-03-25 2:11 AM
Hi @Scotty55
First of all, you need to learn how to write a question on the community by following this article: "How to write your question to maximize your chances of finding a solution"
Regarding the Swap Mode,
The swap mode in HRTIM is applied by using the SWPD bit in the HRTIM_CR2 register.
The procedure is the following:
During initialization: Set the PREEN bit to 1 during the initialization of the HRTIM (to prepare the HRTIM for swapping).
It is important to keep the PREEN bit set to 1 even after the output swapping. It must remain enabled even after the swap: The swap occurs on the update following the toggling of the swap bit.
During run-time:
- To Swap Output (0.normal output): If the current output is normal, set the SWPD bit to 1 in the HRTIM_CR2 register (The outputs will be swapped on the following update event).
- To Return to Normal Output (0.swap output): If the output is currently swapped, set the SWPD bit to 0 in the HRTIM_CR2 register (The outputs will be swapped back to normal on the following update event).
This process allows for the swapping of the outputs without stopping the timer, ensuring continuous operation.
You can use this HRTIM example project (and update it according to your needs) for swap mode:
Thank you.
ELABI.1
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.