2022-10-03 06:25 AM
Hi everyone!
I want to read 2 channels with an ADC via DMA using circular buffer. So far so good. Now I want to use a watchdog for both channels when a certain threshold is reached. However, when the watchdog is triggered and I read the values in the DMA buffer, none of them are above the threshold, meaning they are probably old values.
So the question is: How do I get the ADC value that triggered the watchdog interrupt (values for all channels)?
I am using STM32F746 DISCO with CubeMX, CubeIDE.
Thanks!
Peter
2022-10-03 07:54 AM
Hi @PSmol.1 ,
Can you check the higher and lower threshold of the analog watchdog ?
If you get the analog watchdog interrupt, it means that the value is below the lower threshold or above the higher threshold value.
Please find attached the corresponding Reference Manual.
Best Regards,
A.MVE
2022-10-03 08:16 AM
Thanks for your response!
The lower threshold is 0, meaning it is a given that the upper threshold was triggered.
2022-10-03 08:16 AM
Thanks for your response!
The lower threshold is 0, meaning it is a given that the upper threshold was triggered.
2022-10-03 08:30 AM
Once the analog watchdog triggered :
Thanks
A.MVE
2022-10-03 08:33 AM
> However, when the watchdog is triggered and I read the values in the DMA buffer
How?
If you just look at them from debugger, they are probably long ago overwritten with newer values, as DMA does not stop when debugger stops the processor (i.e. upon breakpoint).
JW
2022-10-03 08:48 AM
So this is already great information thanks.
I tried multiple ways to read out the values:
1) not read them out at all but use the values to achieve the behaviour that I want (i.e. comparing the two values to decide what the triggering channel was).
2) debugging (as you mentioned, not a good idea).
3) output over usart.