Skip to main content
abbas14
Associate III
January 10, 2020
Question

Is GPIO control disabled when using Input Capture?

  • January 10, 2020
  • 2 replies
  • 926 views

Hello.

I am trying to do single-channel touch-sensing without using the TSC. For that, I put a weak pull-up on that pin. In a cyclic process, I make the pin OUTPUT-LOW, then release it and measure the rise time through Input Capture. It's a very basic test application, and I have successfully done it on many other controllers including BlueNRG-2. Unfortunately, I am not able to do the same in this.

Through various measures, I have confirmed that the user application loses control of the pin as soon as the corresponding timer (associated to the pin for Input Capture) is enabled, no matter what Pin-Timer combination I use.

Does anyone have any idea how to bring the control back to the user application with the Input-Capture enabled?

Please note, I am configuring the controller and all its peripherals, including the Input-Capture Timer, through the latest version of STM32CubeMX.

Any suggestions on how to resolve this is highly appreciated.

This topic has been closed for replies.

2 replies

waclawek.jan
Super User
January 10, 2020

> Does anyone have any idea how to bring the control back to the user application with the Input-Capture enabled?

You can't. When pin is connected to TIM, it is in Alternate Function state set in GPIOx_MODER; whereas for GPIO output you'd need to set it to Out in MODER.

JW

waclawek.jan
Super User
January 10, 2020

But maybe you can use a trick, using TIM's Compare as a means to output, and Capture on the adjacent channel.

0690X00000BvqODQAZ.png

JW

abbas14
abbas14Author
Associate III
January 14, 2020

Thank you, waclawek.jan, for the suggestion.

It worked!