Skip to main content
MBenh.1
Associate
November 24, 2021
Solved

ADC external trigger features in STM32F103C8T6

Currently working with a STM32F103 MCU for a power metering application.

In order to have a programmable time shift between sampling voltage & current , i decided to use a PWM signal from the Timer to clock the ADCs.

I wanted to kick the ADC1 at the rising edge & the ADC2 at the falling edge.

The CubeMX doesn't show this feature in the TRGO , i checked out the code & it's preconfigured to rising edge ..Is that a limitation in the ADC of this family ? Or do i need to do something before it will appear in the configuration.

Regards,

Mohammed

This topic has been closed for replies.
TDK
TDKBest answer
November 24, 2021

Here are your options for triggers:

0693W00000GYjuVQAT.png 

You could set TIM1_CH1 as the PWM output and configure CC2 and CC3 to trigger ADC1 and ADC2 at specific times during this PWM cycle.

The TRGO configuration is a per-timer setting, so you can't configure it to happen at the rising edge for one ADC and the falling edge for another.

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

2 replies

TDK
TDKBest answer
November 24, 2021

Here are your options for triggers:

0693W00000GYjuVQAT.png 

You could set TIM1_CH1 as the PWM output and configure CC2 and CC3 to trigger ADC1 and ADC2 at specific times during this PWM cycle.

The TRGO configuration is a per-timer setting, so you can't configure it to happen at the rising edge for one ADC and the falling edge for another.

"If you feel a post has answered your question, please click ""Accept as Solution""."
MBenh.1
MBenh.1Author
Associate
November 25, 2021

I have been successful in making it (edge triggering with same timer for both ADCs) with F303 serie , the option is available while configuring TRGO2. Does this limitation coming from the abscence of TRGO2 in F103 ?

Thank you for the suggestion , i believe it will also work with your idea , i'll test it ASAP.