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
Exit Analog Watchdog Interrupt Topic is solved
Moderators: RoccoMarco, barthess
- Giovanni
- Site Admin
- Posts: 14457
- 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
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
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
Who is online
Users browsing this forum: No registered users and 35 guests