Skip to main content
reedomneck
Associate III
January 21, 2026
Solved

Adc data in awdg callback

  • January 21, 2026
  • 1 reply
  • 113 views


I'm using stm32u535RCT mcu and I've requirement of zero crossing detection using analog watchdog.
I need 6 channels and configured DMA circular buffer to collect 1Kb data on each channel. Channel 5 is mapped to analog watchdog.
Here I want to understand in callback how do I get channel 5 last sampled data.
Should I calculate by calculating the index with help of NDTR register or how.

 

 

Best answer by TDK

Yes, using NDTR would be the best way.

If your buffer is one sample per channel, this is easier. Otherwise, it should be an integer times the number of channels you're converting.

Be sure to invalidate cache before reading the value.

Don't use AWDG1 for this as DMA request won't be generated for out of range values (see reference manual for details).

1 reply

TDK
TDKBest answer
Super User
January 21, 2026

Yes, using NDTR would be the best way.

If your buffer is one sample per channel, this is easier. Otherwise, it should be an integer times the number of channels you're converting.

Be sure to invalidate cache before reading the value.

Don't use AWDG1 for this as DMA request won't be generated for out of range values (see reference manual for details).

"If you feel a post has answered your question, please click ""Accept as Solution""."