Skip to main content
Visitor II
December 30, 2025
Question

"Jumps" in ADC output of stm32G474RET6 using DMA

  • December 30, 2025
  • 3 replies
  • 86 views

I am running the ADC using a timer trigger and DMA to sample a sinusoidal signal.
The captured samples are transmitted to a PC via UART.
However, as shown in the attached image, the ADC output appears to be step-like and does not capture smoothly changing values, even though the input signal is a clean sine wave.
I have checked the external reference voltage, interrupts, and the microcontroller power supply, but the issue still persist

1000028368.jpg

    This topic has been closed for replies.

    3 replies

    Super User
    December 30, 2025

    Are you calibrating the ADC on startup? This is mandatory.

    Are there appropriate decoupling caps next to the VREF+ pin?

    Consider sharing the schematic if you can.

    Super User
    December 30, 2025

    The error may be in your DMA code?

    Try ADC sampling by polling first for checking analog input signal integrity.

    hth

    KnarfB

    Super User
    December 30, 2025

    welcome to the forum.

    Please give some more details about your setup;  in particular, your code & schematic - see:

    How to write your question to maximize your chances to find a solution

     


    @Mshakiba wrote:

    as shown in the attached image, the ADC output appears to be step-like and does not capture smoothly changing values,


    The images show that it does correctly capture the smoothly changing values most of the time - there is just a regular "glich" at a certain point in the waveform.

    Does that glitch correspond to where your DMA completes?

    Or where your UART transmission occurs?

    Or something else that happens regularly in your system?

     


    @Mshakiba wrote:

    I am running the ADC using a timer trigger and DMA to sample a sinusoidal signal.


    As @KnarfB said, have you tried it without DMA ?

    Have you tried it with steady voltages - to see if it's something to do with that particular voltage range (rather than time-related) ?

     


    @Mshakiba wrote:

    I have checked the external reference voltage, interrupts, and the microcontroller power supply,


    Have you checked the  actual input voltage at the STM32 pin ?