AnsweredAssumed Answered

STM32F1 remap TIM2

Question asked by manit.tanav on Jan 25, 2014
Latest reply on Jan 26, 2014 by manit.tanav
Hi, I'm having a problem about remap timer2 pin.
For the circuit board I've designed, I use PA15&PB3 as timer2 ch1&ch2 so I have to remap them and I also use PB10&PB11 as Usart3 Txd and Rxd.
Then I found that Usart3 PB10&PB11 are not working because they also timer2 remap pin.
Is there any way to remap only timer2 ch1&ch2 pin to make PB10&11 work as Usart3 pin?

here's my current code on the remap part

void USART3_GPIO_Configuration(void){
  GPIO_InitTypeDef GPIO_InitStructure;
  // Configure USART3 Tx (PB10) as alternate function push-pull 
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF_PP;
  GPIO_Init(GPIOB, &GPIO_InitStructure);
  // Configure USART3 Rx (PB11) as input floating 
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
  GPIO_Init(GPIOB, &GPIO_InitStructure);
}

void Tim2_GPIO_Configuration(void){
  GPIO_InitTypeDef GPIO_InitStructure;
  // PA15 TIM2_CH1, PB3 TIM2_CH2
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_15;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
  GPIO_Init(GPIOA, &GPIO_InitStructure);
     GPIO_InitStructure.GPIO_Pin = GPIO_Pin_3;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
  GPIO_Init(GPIOB, &GPIO_InitStructure);
  //TIM2 remap   
  GPIO_PinRemapConfig( GPIO_FullRemap_TIM2, ENABLE );
}

Outcomes