cancel
Showing results for 
Search instead for 
Did you mean: 

PA15 as TIM2_CH1 doesn't work on F103RG with SPI 3 on

Victoria13
Associate
Hi all,
I'm using a F103 on my current project. I have trouble using the PA15 as TIM2_CH1 which is connect to a LED. I also have a serial flash connected via SPI on PB3 to PB5. As long as I don't activate the corresponding SPI timer in the RCC_APB1ENR register the LED works. I tried using SPI3 with PB3, PB4 and PB5 and I also tried to remap the SPI1 to use this pins.

My question is: Is it possible to use the SPI on PB3 to PB5 and use PA15 as TIM2_CH1?
1 ACCEPTED SOLUTION

Accepted Solutions

Thanks for your reply. I couldn't get it working with CubeMX, but I found the solution in the reference manual. The NSS pin (PA15) needs to be defined as output (set the SSOE bit in SPI_CR2 register). After that it is posible to use the PA15 pin as TIM2_CH1. (I also did the partial remap of TIM2 and diabled the JTAG interface)

View solution in original post

3 REPLIES 3
AScha.3
Chief III

Hi,

>Is it possible to use the SPI on PB3 to PB5 and use PA15 as TIM2_CH1?

Yes.

Just set it with CubeMx , then you see...(and how to set the init, even if you dont want use Cube.)

If you feel a post has answered your question, please click "Accept as Solution".

Thanks for your reply. I couldn't get it working with CubeMX, but I found the solution in the reference manual. The NSS pin (PA15) needs to be defined as output (set the SSOE bit in SPI_CR2 register). After that it is posible to use the PA15 pin as TIM2_CH1. (I also did the partial remap of TIM2 and diabled the JTAG interface)

DvD34
Associate

Hi Victoria13,

Can you share how you solved it? I'm running into the same problem. I have SPI3 and TIM2_CH1 on the same pins and all other pins are in use as well.
I understand the problem, but I'm new in this STM32 and coding stuff so all the code has to come from examples, and i have no idea how to solve it the way you did.

When an example to drive a servo didn't work on my PCB i tested it on a nucleo and then it worked.
After some tests i expected there had to be a conflict, that CubeIDE did not show.
I went searching and found several posts about this issue. Some say the F4 serie does not have it, so as a final solution replacing the F1 with a pin compatible F4 may be an option, but if you can share your software solution this saves a lot of trouble.
 The partial remap of TIM2 is already done by CubeIDE and the JTAG is disabled as well.
The NSS (SSOE?) can not be set to Hardware or output via CubeIDE, because that is in a conflict of the TIM2 on PA15, so i would have to overrule this in the code somehow, which i expect you did.