Exit Analog Watchdog Interrupt
Posted: Sun Mar 06, 2022 1:49 pm
Hello,
My question is a newbie question, but I don't know where to look for an answer anymore.
I want to use the analog watchdog of the ADC on my NucleoF411RE board. I set the desired values in HTR and LTR, and enabled the watchdog to generate interupts for regular channels by setting CR1 to ADC_CR1_AWDIE | ADC_CR1_AWDEN in the ADCConversionGroup.
When the voltage drops below LTR, the interrupt indeed gets caught (in the adcerrorcallback function), but then it never returns to normal program execution! What I understand from the STM32F411RE RM (p. 228) I need to reset the AWD bit of the ADC_SR register back to 0 manually (in my adcerrorcallback function, using the ADC_SR_AWD bit definition, right?), but how do I access the ADC_SR register in ChibiOS?
Best,
Maxim
My question is a newbie question, but I don't know where to look for an answer anymore.
I want to use the analog watchdog of the ADC on my NucleoF411RE board. I set the desired values in HTR and LTR, and enabled the watchdog to generate interupts for regular channels by setting CR1 to ADC_CR1_AWDIE | ADC_CR1_AWDEN in the ADCConversionGroup.
When the voltage drops below LTR, the interrupt indeed gets caught (in the adcerrorcallback function), but then it never returns to normal program execution! What I understand from the STM32F411RE RM (p. 228) I need to reset the AWD bit of the ADC_SR register back to 0 manually (in my adcerrorcallback function, using the ADC_SR_AWD bit definition, right?), but how do I access the ADC_SR register in ChibiOS?
Best,
Maxim