2023-08-12 03:07 PM
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
2023-08-12 04:08 PM - edited 2023-08-12 04:08 PM
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.
See here: https://kalapiinfotech.in/stm32-peripherals-comparator/
2023-08-12 04:22 PM
2023-08-13 12:17 AM
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