Skip to main content
ivainc
Associate III
May 5, 2021
Question

STM32F103VET6: cannot place TIM2CH1 in OC output remapped mode (pin77)

  • May 5, 2021
  • 5 replies
  • 2651 views

Trying to use CubeMX v6.2.1 to put timer 2 channel 1 in "OC CH1" mode to pin 77. It looking like pin 77 do not configure to output mode by CubeMX and cannot generate. If I use "OC CH1 no output" with interrupt enabled and preconfigured, the pin signal is OK.

Possible points: 1. Pin77 have default function JTDI, but I use SWD (and checked it in CubeMX). 2. This pin share the functions "TIM2CH1" and "TIM2_ETR". However, I set the pin 77 in "TIM2CH1" mode.

Need help.

This topic has been closed for replies.

5 replies

TDK
Super User
May 6, 2021

Works fine for me. Must be something else in your configuration.

0693W00000ANYreQAH.png

"If you feel a post has answered your question, please click ""Accept as Solution""."
ivainc
ivaincAuthor
Associate III
May 6, 2021

Yes, it looks right in CubeMX, but actually in my PCB it does not work. Pin 77 got in reset state and cannot generate. If you have the board with STM32F103VET6, can you please check the pin 77 behavior ander the OC output mode with the following config. To start generate I use HAL_TIM_OC_Start(&htim2,TIM_CHANNEL_1) function. Pin 77 stay in reset state.

TDK
Super User
May 6, 2021
When you said cannot generate, I thought you were talking about generating code, which works. I do not have a board, unfortunately.
"If you feel a post has answered your question, please click ""Accept as Solution""."
ivainc
ivaincAuthor
Associate III
May 6, 2021

Pin 77 must be in output push pull. It is done automatically depending on the mode selected.

ivainc
ivaincAuthor
Associate III
May 11, 2021

This story to be continued. I have a remapping conflict between TIM2CH1 and SPI1. Both peripheral are remapped as shown in IOC file included. Unfortunetely, CubeMX do not manage this remapping issue and do not warn the user. the SPI1 and TIM2CH1 fight for pin77! Those peripherals cannot to win!

The question is: how to prevent this issues it the future projects?

ivainc
ivaincAuthor
Associate III
May 11, 2021

Chip view for recreate.