Hello, I made up to add 8 (16 would be better) rotary encoders to my diy midi controller. I don't know really much about multiplexers and shift registers...
Wich is the best way to implement them? Using less pins would be funny
Well I'm considering to use relative rotary encoder with 3 pins (ACB) plus 2 for the switch. I posted here because I tought it's a metter of multiplexer or shift register...
You need to read the encoders rapidly and then you need some sort of user feedback on each channel you show where each channel is set to.
Have you thought how you are going to do this. You can't use the position of the knob because it is only relitave.
what I am trying to realize is a midi controller that allow me to act on 8 (or 16) parameters of a virtual instrument, but I have to switch among virtual instruments, so I just need to send a +1 or -1 CC message. I'll solve this problem later... now I have to find the best way to connect 8 encoders to arduino saving pins for button switches and relative leds. Thanks to who helps
Can you explain with the easiest words how to do this? And please, help me to reduce the number of pins used, because I have to add many buttons and almost every button needs a led to feedback the state...
Grumpy_Mike:
So do all Arduinos, with the pin change interrupt vector.
All Arduinos except the ones that dont....
The ATmega2560 has 24 pins that can generate pin change interrupts, and only 18 are brought out
to pins on the Arduino Mega. There are only 3 pin-change enable registers in the map for ATmega architecture
so 24 pins is the max - which happens to be enough for all the Uno pins, but not for the Mega.
Tronky:
Can you explain with the easiest words how to do this? And please, help me to reduce the number of pins used, because I have to add many buttons and almost every button needs a led to feedback the state...
No one?
Saving pins on the encoders is not going to work out very well. But why not use serial in parallel out shift registers (e.g. 74HC595) for your LEDs, and some parallel in serial out shift registers for your buttons, or just multiplex them in one big matrix?
Some sort of port expander with its own change interrupts might be good. A quick search
reveale the MCP23017 which has 16 gpio pins which can be configured to interrupt on change
and have internal pull-ups. That should handle 8 rotary encoders with just the SPI bus and one interrupt pin.
PieterP:
aving pins on the encoders is not going to work out very well. But why not use serial in parallel out shift registers (e.g. 74HC595) for your LEDs, and some parallel in serial out shift registers for your buttons, or just multiplex them in one big matrix?
Pieter
Yes, I have very poor knowledge in electronics, that's why I'm asking to you! can you givr more info about that?
MarkT:
Some sort of port expander with its own change interrupts might be good. A quick search
reveale the MCP23017 which has 16 gpio pins which can be configured to interrupt on change
and have internal pull-ups. That should handle 8 rotary encoders with just the SPI bus and one interrupt pin.
It sound quite interesting! what is SPI bus? May be this is what I was looking for...