Skip to main content
Associate III
February 17, 2026
Solved

Query about data coming out of STM32N6570-DK MCU

  • February 17, 2026
  • 3 replies
  • 317 views

I am using ADC + DMA + USART1 + Timer in STM32 IDE in a setup consisting of:

Motor → Sensors → MCU (STM32N6) → PC

I am capturing the signal received at the serial port using NanoEdge AI. I have shared screenshots of:

  • The actual current waveform observed on the oscilloscope

  • The data received through the STM32N6 MCU

My doubt is:

Is there anything inside the MCU or ADC that could suppress or distort the natural sinusoidal shape of the current waveform?

Note:

  • I have converted ADC values to actual current values using a 3.3V reference.

  • I have removed the sensor bias.

  • I have properly accounted for sensor gain.

I would like to confirm whether the MCU/ADC processing could be affecting the waveform shape


Edited to place the images in the post:

AndrewNeil_0-1771330500890.jpeg

AndrewNeil_1-1771330518452.jpeg

 

Best answer by Andrew Neil

Please use your scope's trace capture facility - it will give much better results than photographing the screen!

 


@chanchal94 wrote:

Is there anything inside the MCU or ADC that could suppress or distort the natural sinusoidal shape of the current waveform?


You need to set an appropriate sample rate!

Your graph shows that you are only sampling about once in each half-cycle ...

3 replies

Andrew Neil
Andrew NeilBest answer
Super User
February 17, 2026

Please use your scope's trace capture facility - it will give much better results than photographing the screen!

 


@chanchal94 wrote:

Is there anything inside the MCU or ADC that could suppress or distort the natural sinusoidal shape of the current waveform?


You need to set an appropriate sample rate!

Your graph shows that you are only sampling about once in each half-cycle ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Associate III
February 23, 2026

Thank you! I got the solution :)

LCE
Principal II
February 23, 2026

@chanchal94 we're always happy if the solution is shared for the next person running across the same problem.

 

P.S.: ADC data over UART: people often forget / oversee that the UART's baud rate is not high enough for ADC data.

Associate III
February 23, 2026

My baud rate was okay, it was the timer issue, I checked it again as @Andrew Neil pointed out about sampling rate, I found out baud rate+ timer settings should be correct for this. My timer setting was a bit distorted.

February 23, 2026

Your MCU and ADC won’t intentionally “suppress” a sinusoid, but several practical factors in the STM32 signal chain can distort the waveform you reconstruct:

1. Sampling rate vs signal frequency
If the ADC sampling frequency isn’t at least ~10× your motor current frequency, you may see aliasing or flattened peaks. Timer-triggered ADC is good, but verify the effective sampling rate after DMA and interrupt overhead.

2. ADC input bandwidth & sampling time
Too short ADC sampling time with a high-impedance sensor output can cause incomplete capacitor charging, leading to rounded or attenuated peaks. Increasing sampling cycles often improves waveform fidelity.

3. Quantization & resolution
Finite ADC resolution (e.g., 12–16 bit) introduces stair-stepping. After bias removal and scaling, this can look like distortion, especially near zero crossings.

4. Analog front-end limitations
Sensor amplifier bandwidth, filtering, or saturation is a common cause. If the oscilloscope probe point differs from the ADC input pin, any RC filter or protection network between them can reshape the signal.

5. DMA/USART throughput
The ADC data itself isn’t altered by DMA, but downsampling, buffer overruns, or PC-side reconstruction can visually distort the sinusoid.

A useful check is probing the signal directly at the MCU ADC pin and logging raw ADC counts before scaling to confirm whether distortion originates in hardware or processing.

Reliable signal integrity across acquisition pipelines is crucial in embedded analytics workflows. Similarly, platforms like the GOGePayslip secure payroll dashboard emphasize accurate data capture and presentation so users can trust the information they analyze or retrieve.