Exit Analog Watchdog Interrupt Topic is solved

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderators: RoccoMarco, barthess

maxpav
Posts: 3
Joined: Tue Oct 19, 2021 8:24 am
Has thanked: 1 time

Exit Analog Watchdog Interrupt

Postby maxpav » 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

User avatar
Giovanni
Site Admin
Posts: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: Exit Analog Watchdog Interrupt  Topic is solved

Postby Giovanni » Sun Mar 06, 2022 5:13 pm

Hi,

The SR register is cleared by the driver itself, there is no need to clear it from the callback.

Is the program continuously re-triggering the callback? it is possible if the conversion is continuous and the voltage stays out of limits. Try to break the program after exiting the callback and see if/where it is stuck somewhere.

Giovanni


Return to “STM32 Support”

Who is online

Users browsing this forum: Google [Bot] and 23 guests