2020-08-29 10:03 PM
Hi,
Beforehand, let me tell you my setup:
Board selected on CubeMX: STM32L100C-DISCO.
Input Capture with TIM2, Channel 2, Pin A1.
I've been working on a project where I have to measure frequency, so I setted up the Input Capture on Timer 2 as in the Picture:
After exporting the code, and implementing the functions as needed based on a tutorial I watched I didn't get any result out, nor any execution of the interrupt that should start at the capture event, what I noticed is that the GPIO pin is being declared as a alternate function push pull output instead of an input... is that ok?, you can watch that in this picture:
In case anyone is interested, this is the tutorial I followed: https://www.youtube.com/watch?v=de4tfSzXrGM&t=693s
Thanks in advance for your comments, I am not posting the code as I first would like to check that the way cube mx is showing the info as in the pictures is correct...
Víctor.
Solved! Go to Solution.
2020-08-29 11:43 PM
>GPIO pin is being declared as a alternate function push pull output
>instead of an input... is that ok?,
Yes.
When set as AF, the connected peripheral controls the actual direction of the pin, i.e. whether it's input or output.
JW
2020-08-29 11:43 PM
>GPIO pin is being declared as a alternate function push pull output
>instead of an input... is that ok?,
Yes.
When set as AF, the connected peripheral controls the actual direction of the pin, i.e. whether it's input or output.
JW
2020-08-29 11:50 PM
Thank you very much for your answer, now I know the problem must reside somewhere else, I will post again in case I can't solve it by myself.
Víctor.