cancel
Showing results for 
Search instead for 
Did you mean: 

TIM2 Output Only CH3/4

tomtom9196
Associate II
Posted on January 11, 2013 at 11:12

Here is a STM32F103-question.

TIM2 is using TIM_OCMode_PWM1 and TIM_OPMode_Single (one-pulse mode).

Im using TIM2 CH1 for (internal) triggering ADC injected reads using a compare. 

Im using TIM2 CH2 for (internal) triggering ADC regular reads using another compare.

TIM2 CH1 and CH2 is therefore not connected to any IO-pins.

But now I need to generate a PWM-signal on output pins PB10/11 which is TIM2-CH3/CH4.

IS it possible (at all) to use the TIM2 in this way, meaning CH1/CH2 not connected to any IO-pins and CH3/CH4 connected to PB10/11 ?

The way I understand it, if I use the remap, it will hook up TIM2-CH3/CH4 to PB10/PB11 and that is fine, BUT it will also hook up TIM2-CH1/CH2 to PA0/PA1 and that is not possible since I use those for a analog inputs.

Could someone please clarify this to me ?

#tim2 #alternate-remap #pwm
2 REPLIES 2
Posted on January 11, 2013 at 17:16

Are you configuring PA0/PA1 in AF mode?

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;

If not they should not route to the timer in a meaningful way.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
tomtom9196
Associate II
Posted on January 28, 2013 at 06:52

You are right. I made some experiments and have confirmed that it is indeed possible to have it working with the PA0/PA1 as analog inputs if they are not hooked up to the timer in the way you suggest.