Skip to main content
MPero
Associate
Dec 10, 2018 2:36 PM UTC
Solved

Why, after the first saturation of the timer, the code doesn't enter in the systik handler anymore?

I was trying to write a code to integrate a input signal, triggering the ADC with a timer, and print the information every 0.5 s with the systick. I don't understand why After the first saturation of the timer, the code doesn't enter in the systik handler anymore.

This topic has been closed for replies.
waclawek.jan
waclawek.janBest answer
Super User
Dec 10, 2018 9:17 PM UTC

Remove this:

   TIM_ITConfig(TIM3, TIM_IT_CC2, ENABLE);

   TIM_ITConfig(TIM3, TIM_IT_CC3, ENABLE);

   TIM_ITConfig(TIM3, TIM_IT_CC4, ENABLE);

JW

5 replies

waclawek.jan
Super User
Dec 10, 2018 3:50 PM UTC

You don't handle/clear the CC2-CC4 timer interrupts you've enabled.

JW

Tesla DeLorean
Guru
Dec 10, 2018 4:00 PM UTC

Sounds like it is stuck in interrupt loop.

Might also want to increase the priority of SysTick so it preempts other sources.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
MPero
MPeroAuthor
Associate
Dec 10, 2018 4:39 PM UTC

It's not a systick problem, couse i canceled the systick part e set the print flag with the timer itself, but after 130 prints, it stops to enter even in the main.

waclawek.jan
waclawek.janBest answer
Super User
Dec 10, 2018 9:17 PM UTC

Remove this:

   TIM_ITConfig(TIM3, TIM_IT_CC2, ENABLE);

   TIM_ITConfig(TIM3, TIM_IT_CC3, ENABLE);

   TIM_ITConfig(TIM3, TIM_IT_CC4, ENABLE);

JW

MPero
MPeroAuthor
Associate
Dec 11, 2018 8:43 AM UTC

Thank you, now it works. I copied the configuration from a previous project and i didn't notice it.