Interrupt Maximum before the RED light DEATH?

I’ve been hunting around for a maximum of interrrupt 1-6 on the 2006 controller and 2005 if they are different. Best I’ve found is Kevin’s documents that say “thousand of clicks per second” on a 40 MHZ PIC chip.

Is there a spec somewhere? Or does that really depend on how much code you have?

We are using the gear teeth sensors which say they have a maximum of 6KHZ of bandwidth, but wanted to make sure we wouldn’t kill our CPU if we try and spin the gears up pretty fast. I think we are running around 1176 pulses per second, and the interrupt seems to be behaving. It would be nice to know what are “true” max is before we bury the CPU.

The PIC executes ten million instructions per second. If your interrupt service routines don’t use them all up, the main program will be able to execute. Counting instructions is tedious and error-prone, but it’ll give you the answer you’re looking for.

A less tedious way would be to set an output pin high when you enter the interrupt service routine, then set it low as you leave. An oscilloscope on that pin will tell you how long and how often the routine runs, and will give you a reasonable indication of what fraction of the time you’re spending servicing interrupts.

Sorry, I’m not quite getting what you’re saying, and if this doesn’t help, again, I apolgize, just ignore it.

From what we, team 1719, have figured out, it seems that the geartooth ticks are determined by the amount that it’s low.

We have so far seemed to have no problems with our system and we haven’t worried about any of this math.

Best of luck,
Paul Dennis

It does depend on your code of course and the worst case time it takes you to execute a fast loop including your maximum # of interrupts. Unless the slow loop is really bloated I doubt you’d be bound by that time, but if your time to complete a fast loop approaches slow loop speed you’ll be in trouble.

When the slow loop becomes impacted you get the Red Light of Death.

You can also get an approximation by counting the number of fast loops per second with minimal interrupts, then running your interrupts at max and comparing, both times looking for the worst case.
I think we measured the streamlined camera code at a worst case of 65,000 loops per second without other interrupts.

What type of output? An relay? A PWM? Don’t those only update after every putdata() call, i.e. every 26.2ms?

Confused,
Robinson

A digital output. They’re directly connected to the CPU pins, and change state immediately.