2014-01-25 09:41 AM
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 partvoid 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 );} #rtfm #stm32-timer-remap
2014-01-25 10:07 AM
GPIO_PinRemapConfig(GPIO_PartialRemap1_TIM2, ENABLE );
From RM00082014-01-25 10:28 PM
I've already try that but still doesn't work, it still can't send or recieve data from Usart3.
In addition I also use Usart2 in interrupt mode to connect with another board with the same initial code as Usart3 and it work just fine. now I don't even know where to look to fix this thing. Do you have any suggestion to where it can go wrong?edit:: already get it work!!. it doesn't work because a soldering bug(from my bad soldering skill Xp). Thank you very much for the help ^ ^.