cancel
Showing results for 
Search instead for 
Did you mean: 

Query about data coming out of STM32N6570-DK MCU

chanchal94
Senior

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

 

1 ACCEPTED SOLUTION

Accepted Solutions
Andrew Neil
Super User

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.

View solution in original post

4 REPLIES 4
Andrew Neil
Super User

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.
chanchal94
Senior

Thank you! I got the solution :)

@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.

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.