cancel
Showing results for 
Search instead for 
Did you mean: 

Issue in ADC data acquisition using GPDMA on STM32U585 MCU

Shivakumar92
Associate

Hello,

  • I am using STM32U585QII3 mcu in my current project (with system clock 160MHz)
  • I have set a 48MHz clock(MSIK) for ADC1(channel 11) with a 12-bit resolution. I am using TIMER4 to trigger ADC1 at 10.24kHz (sampling rate). I have configured ADC1 to DMA circular mode.
  • I have configured GPDMA (channel 15) to standard mode with circular mode of operation.

ISSUE: 

  • The samples present in the adc_buffer are discontinuous. I plotted a graph in Excel with the samples inside adc_buffer but the waveform is discontinuous. I used an oscilloscope to generate a sine wave of 1kHz for this test, which is very stable.
  • To verify that the sine wave generated is stable and if ADC1 with timer is working properly, I disabled GPDMA and read samples from ADC1->DR register, not surprisingly the samples are continuous and the waveform on Excel is good(I used the same oscilloscope to generate a sine wave).

I have attached waveforms of both cases for comparison.

I have also attached my STM project with all the configurations. 

Please let me know if I am missing something in the initialization or missing anything in any step. Also, let me know if I missed any point to mention which is useful for the analysis of the code.

    

1 REPLY 1
Shivakumar92
Associate

Sorry, Ignore my previous project since it doesn't build.

I have attached a new project.

Note: Generate code using the adcWith_Timer_GPDMA.ioc file before building the project.