2026-04-01 2:35 AM - last edited on 2026-04-01 2:41 AM by Andrew Neil
An issue has been encountered with the STM32G474: when the blanking source is selected for the comparator module output, the events of the HRTIM
Hi,
The complete code files are in the attachment. As shown in the picture above, for the HRTIM module of the G474, Event 4 uses COMP1 as the input source. When the output of the comparator flips due to blanking, the outputs of TA1 or TA2 of the HRTIM event do not change due to the flip of the comparator output.
Thanks.
2026-04-02 5:11 AM
Hello,
As far as I can see from your project HRTIM1_EEV4 is sourced by COMP1_OUT.
I can also see that:
COMP1_OUT is blanked by TIM2_OC3
HRTIM1_EEV4 is blanked by at timing unit A level from counter reset/roll-over to compare 3.
From HRTIM TIMA perspective the blanking window for HRTIM EEV4 combines the blanking window defined at COMP1 level and the blanking window defined at HRTIM TIMA level.
Is that what you want?
regards,
2026-04-02 9:55 PM
Thanks for your answer,
It's like this. I want eev4 to trigger the reset timing of HRTIM1 unit A. However, eev4 should not reset the timer before the count reaches compare 3. So there is a blanking window for eev4. Then, after compare 3, I want either the rising edge or the high level of comp1_out to trigger eev4. But obviously, eev4 can only select the rising edge of comp1 (if level triggering is selected, the low level will also trigger eev4, which is not what I want). So I came up with an idea. I want to use the blanking of compare1 to blank the output of comp1_out or invert its level. In fact, through the external output pin, it can be seen that comp1_out becomes low level due to the blanking source. After the blanking window, the rising edge of comp1_out can be used to trigger eev4, achieving my goal. But I think the blanking does not work between comp1 and hrtim. Finally, I attach a picture. Please answer my questions: If so, why does the output of COMP1 connect directly to HRTIM? How can the official OC protection be achieved in this way? Are there any other methods to achieve my goal?
regards,