cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Triggered by Timer

B.Kaya
Associate II

Hello Team,

In my application using STM32G431KCU6 at 160MHz, I want to trigger ADC2 channel by TIM1 channel. 

I aim to read ADC value synchronously with 1.1kHz pwm signal. When I set up the CubeMX config, i can see that TIM1 trigger OutputCompareCallback function but i can not trigger ADC_ConvCpltCallback. Shared my ADC and TIM1 configuration below:

BKaya_0-1701065655338.pngBKaya_1-1701065679267.png

BKaya_2-1701065691737.png

BKaya_3-1701065745458.pngBKaya_4-1701065755994.png

Also I am confused about starting ADC on software because ADC is not continuous conversion mode. Should i start and stop ADC as below or any suggest? 

BKaya_5-1701066014358.png

My finalize code as below:

BKaya_0-1701071631917.png

 

Thanks for your help. 

Best Regards,

Basri.

 

1 ACCEPTED SOLUTION

Accepted Solutions
Mahmoud Ben Romdhane
ST Employee

Hello @B.Kaya,

First let me thank you for posting and welcome to the ST Community.

I advise you to consult this Post. It explains how to configure an STM32 Timer to trigger ADC conversions.

Thanks.

Mahmoud.

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.

View solution in original post

1 REPLY 1
Mahmoud Ben Romdhane
ST Employee

Hello @B.Kaya,

First let me thank you for posting and welcome to the ST Community.

I advise you to consult this Post. It explains how to configure an STM32 Timer to trigger ADC conversions.

Thanks.

Mahmoud.

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.