2020-01-10 04:10 AM
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.
2020-01-10 04:50 AM
> 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
2020-01-10 04:58 AM
But maybe you can use a trick, using TIM's Compare as a means to output, and Capture on the adjacent channel.
JW
2020-01-14 03:48 AM
Thank you, waclawek.jan, for the suggestion.
It worked!