cancel
Showing results for 
Search instead for 
Did you mean: 

ADC external trigger features in STM32F103C8T6

MBenh.1
Associate

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

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

2 REPLIES 2
TDK
Guru

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
Associate

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.