Skip to main content
SWill.11
Associate II
April 8, 2020
Solved

How to know which GPIO Pin to use for Timer Input Capture?

  • April 8, 2020
  • 2 replies
  • 2518 views

If I'm using a timer in input capture mode, how do I know which pins it wants to use for channels 1 and 2? I've been through the manual a bunch of times, looked for examples and other posts etc, I can't find the answer to this seemingly simple question.

For example, I'm struggling to get TIM1 in input capture mode to work. One channel is set to rising edge, the other set to falling, etc. CubeMX suggests that TIM1 wants to use PC0 for Channel 1 (STM32F303), but I have no idea why it's that pin, and since I can't get any change on the pin to trigger a capture event, but the timer otherwise seems like it's working, I'm skeptical it's the correct pin.

This topic has been closed for replies.
Best answer by berendi

Check the pin mapping table in the datasheet, and the description of the GPIO MODER and AFRL/AFRH registers in the reference manual.​

​

Check the schematics of your board​ to see if there is something connected to the pin.

2 replies

berendi
berendiBest answer
Principal
April 8, 2020

Check the pin mapping table in the datasheet, and the description of the GPIO MODER and AFRL/AFRH registers in the reference manual.​

​

Check the schematics of your board​ to see if there is something connected to the pin.

SWill.11
SWill.11Author
Associate II
April 8, 2020

Thanks. I knew that was simple. At this point I'd forgotten the data sheet existed and was only looking in the reference manual.