cancel
Showing results for 
Search instead for 
Did you mean: 

Long Timer interrupt routine

XooM
Senior

I am using STM32F100. I wrote a very long code for my timer interrupt. If the processing time of this code exceeds the interrupt duration, can a pin I SET be RESET?

3 REPLIES 3
XooM
Senior

How can I see how many milliseconds it takes for the MCU to complete the code I wrote in the timer interrupt routine?

  1. Please tell us what you want to achieve and why you think you need interrupts.
  2. Please tell us what exact MCU you are using and at what clock frequency it is running.
  3. Please post a snippet of your code or add your project as an attachment
  4. What does "can a pin I SET be RESET" mean?

You want to keep handling interrupts as short as possible. If it takes too long you need to break it up in multiple steps.

Kudo posts if you have the same problem and kudo replies if the solution works.
Click "Accept as Solution" if a reply solved your problem. If no solution was posted please answer with your own.

As @unsigned_char_array said, please give some more details - see: How to write your question to maximize your chances to find a solution.

 


@XooM wrote:

I wrote a very long code for my timer interrupt.


That's generally a poor practice - so why did you do that?

Rather than try to bodge the problems that it causes, why not adopt a better approach instead?

 


@XooM wrote:

can a pin I SET be RESET?


Pardon?

 


@XooM wrote:

How can I see how many milliseconds it takes for the MCU to complete the code


  • toggle an IO pin at the start of your routine, and again at the end. view the pin on an oscilloscope or logic analyser.
  • use a timer
  • use the DWT->CYCCNT register