Skip to main content
Explorer
March 11, 2024
Solved

Configure stm32 timer as a counter of a RPM of a rolling gear

  • March 11, 2024
  • 1 reply
  • 2236 views

good morning

 

i was trying for sometime now to configure stm32 timer as a counter to count the pulses in order to count the RPM of a rolling gear and then show it on a lcd screen, and no matter what i do or change in the code or the timer configuration, the number of pulses is always stuck at 0. can anyone please help me with it? i really need it for my studies. (by the way, i am using a proteus simulation to test it).

    This topic has been closed for replies.
    Best answer by mƎALLEm

    Frankly, I'm not in favor using this kind of simulation. Sometimes it does not work but when you switch to a real HW it does.

    I recommend you to use a real HW.

    1 reply

    Super User
    March 11, 2024

    Hi,

    how you get the pulses to the counter ?

    You need select the ETRx as input to count external pulses. 

    Or TIMxx input capture, to measure just one pulse-pulse timing and calculate speed then.

    medraoufAuthor
    Explorer
    March 11, 2024

    @AScha.3 i already tried that...

     

    Technical Moderator
    March 11, 2024

    Hello @medraouf ,

    As stated by @AScha.3 ETR is a serious candidate for your use case.


    @medraouf wrote:

    @AScha.3 i already tried that...

     


    No one here can imagine what you did ..

    You need to share your code to let community members to help you efficiently + your HW connections.

    It could be an issue with your IO configuration or even with the timer itself ..