Skip to main content
Senior
Oct 25, 2019 11:05 PM UTC
Solved

COMPx_OUT as a retriggerable monostable output

Hi,

I am using an STM32L4 MCU and I need to make the COMPx_OUT acting as a retriggerable monostable output.

​

I know I can use timers as blinking source for COMPx_OUT, but this would not help, and as far I understand, the only way to solve my problem via firmware would be, at each EXTI interrupt:

​

  • Set to VOH the GPIO output
  • Start a one shot timer for t seconds
  • Set to VOL the GPIO once the timer has overflowed.

​

Am I missing something or is there any better automated firmware solution ?

​

Thanks for any hint.

Regards.

s

This topic has been closed for replies.
simo zzBest answer
Senior
Oct 26, 2019 3:22 PM UTC

Reading better the TRM (RM0394), I see that I can redirect the COMPx_OUT to TIM1 or TIM2 TGI, so use one of these timers as retriggerable OPM mode and use the TIMx_CHx output instead of the COMPx_OUT.

1 reply

simo zzAuthorBest answer
Senior
Oct 26, 2019 3:22 PM UTC

Reading better the TRM (RM0394), I see that I can redirect the COMPx_OUT to TIM1 or TIM2 TGI, so use one of these timers as retriggerable OPM mode and use the TIMx_CHx output instead of the COMPx_OUT.