2025-11-21 12:55 AM
Hi, I am trying to reset HRTIM on an external event using TIM1 TRGO as a reset event. I am trying to make a single pulse every 200ms (5Hz) because I want to make a single puls test. However, I also need a high resolution so I can vary the on time and blanking time precisely, which is way I want to use the HRTIM.
I have trouble getting the HRTIM to reset however, and I dont understand why. I am running the clock at 100Mhz and have set the TIM1 PSC to 9999 and ARR to 19999 to get the 5hz. I have also enabled the MSM(master/slave mode) and set the TRGO to RESET. In the HRTIM I have enabled EEV1 as source 3(TIM1_TRGO). Timer A is configured as a retriggerable single-shot mode where the reset trigger source is set so the timer counter reset is upon EEV1.
The HRTIM clock is divided by 4 and the period is 50000. And I have compare unit 1 set as 49000 and compare unit 2 as 49500. The output polarity is set to active low and set and source selection is CMP1 and CMP2 respectively. Later I would also like to use Timer B in similar manner, but I would like to get the single-shot mode working first.
I have enabled
HAL_TIM_Base_Start(&htim1);
and HAL_HRTIM_WaveformOutputStart(&hhrtim1, HRTIM_OUTPUT_TA1); // Enable the generation of the waveform signal on the designated outputHAL_HRTIM_WaveformCounterStart(&hhrtim1, HRTIM_TIMERID_TIMER_A); // Start the counter of the Timer A operating in waveform mode
Is there something I am missing here?
Thanks, Magnus