cancel
Showing results for 
Search instead for 
Did you mean: 

Conflict between remapped TMR2 and remapped SPI1 in STM32F103

eng239955_stm1
Associate
Posted on October 27, 2015 at 12:28

I am Facing a problem to use TMR2 and SPI3 in STM32F103. I am using Keil Software to write the code and the Problem is if i remap and choose SPI1 TMR2 will stop working and if i stop using the remapped SPI1; the remapped TMR2 will work. The pins i am using for the Remapped SPI1 is PB3/B4/B5 and the pin that i am using for the remapped TMR2 is PA15. This is a sample code for how i am declaring these pins:

RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA |RCC_APB2Periph_GPIOB | RCC_APB2Periph_GPIOC | RCC_APB2Periph_SPI1 | RCC_APB2Periph_AFIO, ENABLE );

GPIO_PinRemapConfig(GPIO_Remap_SWJ_JTAGDisable, ENABLE);

RCC_APB1PeriphClockCmd(RCC_APB1Periph_TIM2, ENABLE);

GPIO_PinRemapConfig(GPIO_PartialRemap1_TIM2,ENABLE);

GPIO_PinRemapConfig (GPIO_Remap_SPI1, ENABLE);

#spi1 #stm32f103r8 #tmr2
1 REPLY 1
Posted on October 27, 2015 at 13:45

May be you should consider a different STM32 family that permits PIN level peripheral configuration? The F1 uses a course block level for groups of pins, and this can be significantly more difficult to escape all the peripherals in the manner you want.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..