Skip to main content
Associate II
November 27, 2023
Solved

ADC Triggered by Timer

  • November 27, 2023
  • 1 reply
  • 3641 views

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.

 

This topic has been closed for replies.
Best answer by Mahmoud Ben Romdhane

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.

1 reply

Technical Moderator
November 27, 2023

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.