2024-03-11 05:22 AM - last edited on 2024-03-12 07:10 AM by SofLit
Good afternoon community,
I am trying to implement the Input Encoder in
STM32F407G Discovery board.
I implement all things, but I am not able to generate desired the output from the board.
I get counter/count/position value as zero.
Can you please help me to implement the Input encoder?
Here is code for your reference, if any reference code you have then please provide me.
Thank you.
2024-03-11 05:42 AM
> void hal_tim_IC_CaptureCallback(TIM_HandleTypeDef *htim)
The correct callback function is HAL_TIM_IC_CaptureCallback. Function names are case sensitive.
The "position" variable should probably be defined as volatile if it will be accessed in the main thread.
If that doesn't work, ensure the pin assignment is correct and ensure the signal is making its way to your board.
2024-03-11 05:55 AM
2024-03-12 05:39 AM
Good afternoon community,
I did not get any response from your side of my above query.
I have changed all things as you said in last response.
Please taking care of it.
Thank you.
2024-03-12 06:59 AM
I would recheck your wiring. Use a logic analyzer to verify the signals are as you think they are. I can't do this part for you.
(Note that waiting 24 hours for a response should be acceptable on a forum that provides free assistance. Be patient and appreciative for best results, not needy.)