I am trying to use the output of COMP2 to trigger the One-Pulse mode of a timer (in my example TIM4, but it's quite flexible if it needs to change to another timer) on the STM32L1 series.
In the reference manual, the explanation for the One-Pulse mode uses TI2FP2 as the timer trigger, which is linked to the Input Capture on channel 2 of the timer, however the output of the comparator can only be redirected to Input Capture on channel 4 (except for TIM10 but it doesn't have a second channel to output the PWM on...), or to OCREF Clear.
I have tried redirecting the COMP2 output to:
- “OCxREF Clear” of TIM4,
- the Input Capture 4 of TIM4,
- the Input Capture 4 of TIM3 and using ITR2 as the TIM4 trigger (ITR2 is TIM3 when used on TIM4)
but none of those options worked.
Should any of these configurations have worked and I just didn’t set them up properly?
Am I supposed to do it differently?
Is there no way to connect the two directly and I should for example start the One-Pulse mode from the COMP2 interrupt?