cancel
Showing results for 
Search instead for 
Did you mean: 

How to start analog watchdog with interrupt?

smrtkai
Senior
Posted on March 16, 2016 at 16:48

Hi,

I am having trouble to get the analog watchdog to work. I want to get an interrupt each time the input voltage is not within a given range.

I have configured the analog watchdog for ADC3 with STM32CubeMX as follows:

Watchdog Mode: All regular channels

High Threshold: 3850

Low Threshold: 1050

Interrupt Mode: Enabled

ADC3 is configured with two channels and DMA. ADC is started as follows:

> HAL_ADC_Start(&hadc3);

> HAL_ADC_Start_DMA(&hadc3, memory, size);

> HAL_ADC_Start_IT(&hadc3);

For the interrupt of the analog watchdog, I expect the following callback to get invoked, so I have implemented that function. But unfortunately it is never executed. And I cannot set a breakpoint within that function, when debugging with Keil uVision.

> void HAL_ADC_LevelOutOfWindowCallback(ADC_HandleTypeDef* hadc);

What am I doing wrong? 
1 REPLY 1
smrtkai
Senior
Posted on March 17, 2016 at 10:48

I have simply forgotten to enable global interrupts for the ADCs.