Skip to main content
MPero
Associate
December 10, 2018
Solved

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

  • December 10, 2018
  • 2 replies
  • 1750 views

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.
Best answer by waclawek.jan

Remove this:

   TIM_ITConfig(TIM3, TIM_IT_CC2, ENABLE);

   TIM_ITConfig(TIM3, TIM_IT_CC3, ENABLE);

   TIM_ITConfig(TIM3, TIM_IT_CC4, ENABLE);

JW

2 replies

waclawek.jan
Super User
December 10, 2018

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

JW

Tesla DeLorean
Guru
December 10, 2018

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 VenmoUp vote any posts that you find helpful, it shows what's working..
MPero
MPeroAuthor
Associate
December 10, 2018

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
Super User
December 10, 2018

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
December 11, 2018

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