cancel
Showing results for 
Search instead for 
Did you mean: 

Using basic timer to trigger ADC conversion

GBert.2
Senior

Hi,

Using an STM32G4, I want to start an ADC conversion periodically using an event from a timer.

To do so I choose the TIMER6 (basic timer) and ADC2 peripherals.

Sadly, it didn't work.

The reference manual, seems to imply that you can't use a basic timer to start an ADC conversion.

0693W00000KdTREQA3.png 

That said, CubeMX clearly allows us to configure TIMER 6 as a trigger source.

0693W00000KdTSCQA3.pngIs this a CubeMX bug or I'm missing something?

Thanks

1 REPLY 1
TDK
Guru

> The reference manual, seems to imply that you can't use a basic timer to start an ADC conversion.

Why do you say that? TIM6/7_TRGO are listed as triggers for the ADC regular conversions.

0693W00000KdTdFQAV.png 

Note that the part you highlighted pertains to the DAC, not the ADC, but I don't see how it's relevant.

The timer section explicitly says that it can be used as an ADC trigger.

0693W00000KdTdjQAF.png 

> Sadly, it didn't work.

This isn't enough information to diagnose the issue. Show the code you've used along with how you've determined that it isn't working.

If you feel a post has answered your question, please click "Accept as Solution".