2024-02-08 02:36 AM
Hello, I have a problem currently, I am a beginner on stm32 and I would like to create a pulse counter but I cannot get the interrupts from my timer 3 to increment my variable. I don't understand then that the function is indeed carried out but it is not called.
I have to count the number of pulses on an input (P2_pin) the period lasts about 1.3 seconds but my counter stops at 10000 pulses when it should go to 65536 already I don't understand this, and I used a low frequency generator to see how many Hz my pin could increment my counter is the maximum is 100Hz my counter doesn't go any faster. I would like to count my total number of pulses on the P2_pin as quickly as possible and display it on my lcd screen, but I can't manage to do it. Could you help me? I would need my tim3 to count up to 65536 pulses and if my number of pulses exceeds that I would increment it during the acquisition of my period because I would like to know the phase shift of my motor between my FCEMs and my hall cells. thank you
2024-02-08 05:38 AM
Duplicate:
https://community.st.com/t5/stm32-mcus-products/overflow-interrupt-don-t-trig-stm32f1/td-p/637091
Why do you think your counter stops at 10000? Maybe you're only receiving that many pulses.
The timer counts up to ARR, which is 65535 in your case.
2024-02-08 07:44 AM
When i print the timer3 value in my lcd screen (pulsecount) is going to 0 at 10000, and I used a low frequency generator to see how many Hz my pin could increment my counter is the maximum is 100Hz like when i was going to approach 9800 on my pulse count i put 1hz on the low generator and my timer was going to 10k and going to zero.