cancel
Showing results for 
Search instead for 
Did you mean: 

ADC triggering on value

petr_mosna
Associate

Hello,

Is it possible to set trigger when ADC converter reach a certain value? I mean that an interrupt rutine is called when ADC reach a user value. Can you please provide or refer a piece of code?

Thank,

Petr

3 REPLIES 3
RhSilicon
Lead

As far as I know, comparators are used for this.

The Analog Comparator is used to compare the voltage of two analog inputs, with a digital output
indicating which input voltage is higher. Inputs can either be one of the selectable internal references or
from external pins.

image

See here: https://kalapiinfotech.in/stm32-peripherals-comparator/

Which STM32?

In most STM32 ADC there is a feature called ADC watchdog. If, after a conversion, the converted value is outside a region defined by two registers, an interrupt is invoked (if enabled).

Read the ADC chapter in RM.

JW