Question re: interrupts...

Status
Not open for further replies.

Constantin

Well-known member
Just got back from a trip to EU, was great fun to see friends, classmates, and family. Hope you are all well!

For some reason, I was under the impression that there is a version of attachinterrupt which omits much of the overhead of dropping into a ISR routine when all that's needed is a increment on a variable (i.e. counter++). For the life of me, I cannot find that reference anymore.

The closest I can come up with is the encoder library, which appears to be optimized with some assembly code on the Teensy to make it more efficient. However, the encoder library expects two inputs whereas my project only expect to use a single, simple external interrupt that is triggered on a falling signal.

If anyone here has an idea what I'm talking about, please speak up! Otherwise, please enjoy your 4th of July weekend! Either way, many thanks for all the help thus far!
 
Which Teensy are you talking about, AVR or ARM? The encoder library only has assembly code for AVR.

I've looked at the generated code for ARM and it looks good. The only significant inefficiency is that all pins of a port are checked when an interrupt occurs (there is only a pin change interrupt for a port, not per single pin).
 
Which Teensy are you talking about, AVR or ARM? The encoder library only has assembly code for AVR.

I've looked at the generated code for ARM and it looks good. The only significant inefficiency is that all pins of a port are checked when an interrupt occurs (there is only a pin change interrupt for a port, not per single pin).

Yup, but you can write your own ISR without these checks (if they are not needed)
 
Hi everyone and thanks for the insights!

The intended application is on a Teensy 3.1, ie a ARM processor. The inputs will be tempered by a Debounce chip to minimize noise on the interrupt pins.

I doubt i have the skills to write a better ISR... As good as it likely would be for me to learn!!!
 
Status
Not open for further replies.
Back
Top