This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Timer and Interrupt on C167

Hi,
I've timer T6 set to send interrupt (level 11, group 1) each 500 microseconds. This interrupt is managed by a routine.
I need to know how many time remains after this routine before the next T6 Interrupt, because I need to insert some other code in the same routine if it's possible.

I suppose I need another timer, but I don't know how to use it.

Another question: what happens if the routine requires more than 500 microseconds.

Many Thanks,
Marco

Parents
  • If you have a spare pin - toggle it when you enter and leave the ISR. That gives an indication how many % of the total CPU capacity the ISR takes. Note that you have to manually add a bit of time for the prologe/epiloge.

    The advantage with this approach is that you can see how much the pulses jitter, i.e. variance in ISR execution times (if there are conditionals in the code) and how the start of the ISR jitters because of other ISR, disabled interrupts etc.

Reply
  • If you have a spare pin - toggle it when you enter and leave the ISR. That gives an indication how many % of the total CPU capacity the ISR takes. Note that you have to manually add a bit of time for the prologe/epiloge.

    The advantage with this approach is that you can see how much the pulses jitter, i.e. variance in ISR execution times (if there are conditionals in the code) and how the start of the ISR jitters because of other ISR, disabled interrupts etc.

Children