cancel
Showing results for 
Search instead for 
Did you mean: 

HRTIMER Windowing

avieira95
Associate

I'm using the HRTIMER_F on an STM32G474 running both TF1 and TF2 (half mode with deadtime insertion)

I'm trying to setup a window where a capture from an external event can occur (COMP3_OUT). The interrupt from the capture is triggered regardless of the window. Is that the expected behavior?

Relevant code lines below:

 LL_HRTIM_EE_SetPrescaler(HRTIM1, LL_HRTIM_EE_PRESCALER_DIV1);
LL_HRTIM_EE_SetSrc(HRTIM1, LL_HRTIM_EVENT_8, LL_HRTIM_EEV8SRC_COMP3_OUT);
LL_HRTIM_EE_SetSensitivity(HRTIM1, LL_HRTIM_EVENT_8, LL_HRTIM_EE_SENSITIVITY_RISINGEDGE);

 

LL_HRTIM_TIM_SetCompare2(HRTIM1, LL_HRTIM_TIMER_F, TRAY_PWM_START_PERIOD-5000); 
// Top mosfet gets reset on period, we want Compare2 to be slightly before that
LL_HRTIM_TIM_SetCompareMode(HRTIM1, LL_HRTIM_TIMER_F, LL_HRTIM_COMPAREUNIT_2, LL_HRTIM_COMPAREMODE_REGULAR);
LL_HRTIM_TIM_SetEventFilter(HRTIM1, LL_HRTIM_TIMER_F, LL_HRTIM_EVENT_8, LL_HRTIM_EEFLTR_WINDOWINGCMP2);
 
I have the interrupt handler toggling a pin on Compare2 so I can "see" the window on the scope. COMP3_OUT is also mapped to a pin so it can be monitored. The setup above guarantees COMP3_OUT rising edge to be after the window, however, the Capture1 interrupt is always triggered regardless of the window.
 
What am I missing here?
Thanks!
0 REPLIES 0