if i have a voltage range from 2.5 to 4.3 at sine wave. let's say i have i want to choose 3v at set point to activate interrupt then from that i want the micro
do something else
The ADC has a conversion complete interrupt, a simple test in interrupt
will permit, via flag, a redirection in processor code execution.
Set a flag in the interrupt, return to main, then test if >3V was result, and
call the function/code you want executed. The reason you do this vs call
other subroutines in ISR is to avoid a lot of stack push/thrashing, which
slows down ISR active to result code execution.
Note part has a comparator interrupt, that would be even faster detection
method for 3V.