- I2C Data and Clock lines for LCD display and EEPROM
- Three system buttons for UI
- RX and TX for MIDI
- Two analog inputs for both joystick axes, another for volume, and one more for an external input
- Two footswitches
In a later post I will show the circuit in its entirety for the sake of putting all the pieces together. For instance, I'm excluding the debounce components for the footswitches as well as the specific circuitry for the MIDI interface (which I've already discussed in the Virtual Whammy Bar project). Really what we're concerned about right now is allocating the microcontroller I/O.
Now what about those three "system" buttons? We actually already have what we need for these. Going back to the piano keys we have eight banks, each capable of reading eight inputs. But we only have 61 physical keys. The last bank only reads in five, meaning we have room for another three. By using the same diode configuration the keyboard does, we can add the system buttons to the last bank. It will require the firmware to differentiate them, but that's not a problem. No more I/O's used. We have the eleven pins used for the keyboard and the six we just figured out above for a total of 17. There are only the analog inputs left.
The literature for the PIC16F916 says that it has 8 ADC channels. However, it really only has one actual ADC. They just allow you the option of hooking eight analog sources directly to the chip if desired, and can perform one conversion at a time. Although we only need four, and I kinda have the pins available to do so, I'm gonna multiplex again (also, it's already soldered in place). I may in the future decide to add more features to the keyboard, don't want to eat up all the I/O.
Using a 74HC4051, we can actually borrow from Bank Select circuit. The 4051 will give us eight possible analog inputs, for which we already have three signals set aside to select with. Granted, this will go thru X4 to X7, but these we can simply ignore in software. We have the potential of adding four more analog inputs with very little work.
The remaining I/O actually turned out to be rather painless. Everything is accounted for, and there is still a little room for future need.


