cancel
Showing results for 
Search instead for 
Did you mean: 

Is GPIO control disabled when using Input Capture?

abbas14
Associate II

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.

3 REPLIES 3

> 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

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

Thank you, waclawek.jan, for the suggestion.

It worked!