cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L0xx Comparator2

CDesh
Associate III

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.

1 ACCEPTED SOLUTION

Accepted Solutions
CDesh
Associate III

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.

View solution in original post

3 REPLIES 3

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.

0693W000007Z6luQAC.jpg

CDesh
Associate III

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;

CDesh
Associate III

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.