cancel
Showing results for 
Search instead for 
Did you mean: 

adc_sampling

ishu
Associate II

I have generated an pwm of 1khz from timer now I  want to read adc reading  for once for each cycle of pwm after 50 microsecond of rising edge how to do if anyone have code please send in stm 32 .

3 REPLIES 3
Stassen.C
ST Employee

Hello Ishu,

First of all on which STM32 MCU do you wish to implement that?
You have a great video explaining the ADC and DMA here and a wiki here. This should help you.

Regards,
Stassen

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

I AM USING NUCLEO-G491RE  MY SYSTEM CLOCK 96MHZ I HAVE USED ADC INTERNAL TRIGEERING TO ADC .I HAVE CONFIG AN TIMER3 FOR 400US THAT WILL TRIGGER ADC INTERNALLY  ON RISING EDGE  AND ADC IN INTRRUPT MODE . I HAVE USED TIMER2 FOR PWM GENERATION . BY THIS SHLOUD GET ADC VALUE ON RISIING EDGE ONLY BUT I AM GETTING VALUE ON RISING AND FALLING EDGE BOTH.CODE2.PNGCODE1.PNGTIMER3.PNGTIMER 2.PNGADC.PNG

Hello Ishu,

You should be triggering only on rising edge for your ADC trigger if i understand well your question like below:

StassenC_0-1693902440550.png

or else it will trigger on both rising and falling edge.

Regards,
Stassen 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.