cancel
Showing results for 
Search instead for 
Did you mean: 

Overflow interrupt problem stm32f1

Skyy_Tsuki
Associate II

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

2 REPLIES 2
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

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.