2021-02-21 11:59 PM
Hi everyone,
I am using comparator 2 to capture a signal of duration 3-5usec. But observed that, I am able to trigger the comparator only when the duration of the signal is >5usec. I was wondering if there is any delay introduced by Vrefint in STM32L0xx. Attached is sample image of signal of interest and let me know if there is a solution from HW/SW to trigger the comparator when the signal duration is <5usec.
Solved! Go to Solution.
2021-04-01 02:07 AM
The issue has been resolved by setting EN_VREFINT flag during comparator initialization. Now the COM2 response time is in nsec which is required for our application.
Thanks @Vangelis Fortounas for your input.
2021-02-22 07:41 AM
Hello
A hi capacitance in the input of comparator in combination with hi output impendance of source can cause such a delay.
Note that low delay propagation times can be achieved in fast mode and under certain vdda voltages
TI and EXTI lines can "catch" pulses in nanosecond scale.
2021-02-24 09:06 PM
Thanks for your response.
I am using ST development board (B-L072Z-LRWAN) where there I am using a simple push button to trigger the comparator. Following are the settings on COMP2 and even in fast mode, I am missing pulses <5msec duration. According to the data sheet propagation delay should be in usec, but in reality it is taking more time (>5msec).
compHandle.Instance = COMP2;
compHandle.Init.WindowMode = COMP_WINDOWMODE_DISABLE;
compHandle.Init.Mode = COMP_POWERMODE_ULTRALOWPOWER;
compHandle.Init.NonInvertingInput = COMP_INPUT_PLUS_IO1;
compHandle.Init.InvertingInput = COMP_INPUT_MINUS_VREFINT;
compHandle.Init.OutputPol = COMP_OUTPUTPOL_NONINVERTED;
compHandle.Init.TriggerMode = COMP_TRIGGERMODE_IT_FALLING;
2021-04-01 02:07 AM
The issue has been resolved by setting EN_VREFINT flag during comparator initialization. Now the COM2 response time is in nsec which is required for our application.
Thanks @Vangelis Fortounas for your input.