Hi! I'm still very new to all of this and diving in to learning about electronics with a custom midi controller project, so please bear with me.
I'm looking to put 8 rotary encoders on a Teensy++ without using the two I2C pins (so I have 6 interrupt pins to work with). I'm a little unclear as to how this will work with shift registers... Will I need two shift registers and wire one pin to the first shift register and the other pin to the 2nd shift register, or would I wire 4 to one and 4 to the other?
Edit: Or can I make some sort of matrix and do it all with one shift register?
It is not clear how you are proposing to use them.
They are part of an HID design - controlling music software.
One person I've been conversing with suggested that I may be able to use all of the PORTB pins on the Teensy++ as interrupts as well, but we're not 100% sure about that. Do you know?
Though, I wanted to avoid using pin 0 & 1 because of the potential for linking units...
Reading rotary encoders through shift registers is not a good idea.
I've read things along these lines a few times, but I haven't found anything explaining why. Would you mind explaining (or pointing me to an explanation?)
Because the outputs from a shaft encoder change rapidly and so you need to continually read in the shift register in case you miss a change. Even then you will probably miss a change if your sketch has something else to do.
A safer way is to use a port expander like a 23S17 or a 23016, these are very much like a shift register but with extra circuitry. These have a single output that can signal if a change has occurred in any of the up to 16 inputs. Then when you know a change has happened you can then spend the time to read in the levels and work out what has changed.
I may be able to use all of the PORTB pins on the Teensy++ as interrupts as well,
Yes on all AVR processors there is a "pin change interrupt mode", where by an interrupt is generated when ever any pin changes state.
An example of using this is in this project I did. http://www.thebox.myzen.co.uk/Hardware/Crazy_People.html
Another person I was talking with described why the only way shift registers would work is if I was using absolute encoders... Unfortunately I already have a handfull of incremental types that were gifted to me for the project. :\
Will a port expander work with incremental encoders?
Yes but that is only a low resolution mechanical switch one. Good for some things but not for others. For example I would not put it on the end of a motor, for that you need optical encoders not mechanical ones. With only 16 steps per revolution you are limited to simple front panel controls , which might be what you wanted but you didn't say.
Ah - yes, a MIDI controller is an HID. It's for controlling music software, so a high resolution isn't necessary. Either way, I already have the EN11-HSM's so I'll just stick with that and the port expander suggestion.