2023-11-01 11:57 PM
Hello,
is there a solution to generate duty cycles between 0...100% with the HRTIM? I tried up-counting mode and center-aligned mode, but I wasn't able to achieve it.
Regards
Dominik Schmid
Solved! Go to Solution.
2023-11-02 01:28 AM
HRTIM has a few limitations, e.g. it cannot generate PWM at real 0% or 100%, as can also be found in RM0440:
The second point concerns the requested 100%, which is always at least one HRTIM period smaller. And section Null duty cycle exception case says:
The high-resolution behavior is not supported for pulses narrower than 3 tHRTIM periods [...] and any value strictly below 3 periods of the fHRTIM clock [...] in the HRTIM_TIMxCMPy register is forbidden[...]. However, it is possible to skip an output pulse and have a null duty cycle by simply writing a null value in the following two registers: HRTIM_TIMxCMP1 and HRTIM_TIMxCMP3, if and only if the following conditions are met: [...]
For any other use case, this can be done by programming the SET and RESET events with the very same compare values, above 3 periods of the fHRTIM clock.
Does it answer your question?
Regards
/Peter
2023-11-02 01:28 AM
HRTIM has a few limitations, e.g. it cannot generate PWM at real 0% or 100%, as can also be found in RM0440:
The second point concerns the requested 100%, which is always at least one HRTIM period smaller. And section Null duty cycle exception case says:
The high-resolution behavior is not supported for pulses narrower than 3 tHRTIM periods [...] and any value strictly below 3 periods of the fHRTIM clock [...] in the HRTIM_TIMxCMPy register is forbidden[...]. However, it is possible to skip an output pulse and have a null duty cycle by simply writing a null value in the following two registers: HRTIM_TIMxCMP1 and HRTIM_TIMxCMP3, if and only if the following conditions are met: [...]
For any other use case, this can be done by programming the SET and RESET events with the very same compare values, above 3 periods of the fHRTIM clock.
Does it answer your question?
Regards
/Peter