Nice work @beckdac.
I only wonder how this fits with the big picture of your USB connected switches, @jofemodo.
Wouldn’t it be better to use this controller with a USB Interface, so that you can chain them?
Tell me, if I should integrate his wiring as selectable option in the webconf.
Quick note: under this setup, an encoder’s A and B pins must be on the same MCP23017 bank.
@mheidt, I have an external controller based on Teensy 3.2 that has 8 encoders, 8 buttons and 8 air guitar strings. Is that what you are referring to? The schematic for that is here:
Nice!
Guess, it should be possible to mix rotary with normal push pads as well.
Then we need a dynamic configuration and new features like midi/audio file playback and map those to the buttons.
They are WiringPi ports 27 and 25. WiringPi has its own “portable” numbering. This pinout chart shows how to map the the WiringPi to the recent GPIO pin header in parens next to the BCM pin #:
Another quick note. I included 4.7k pullups in my original prototype and it works fine. However, the Raspberry Pi 3 has 1.8k pullups on those lines so in practice on my prototype the final pullup resistance is 1.3k which is above the minimum for fast mode so there is no problem with the rise time. When I build another, I will leave off the external pullups. I have removed them from the schematic.
Finally i had some time for testing the new “All-In-One” PCB, that includes the MCP23017 for the encoders+swithes and MIDI IN-OUT-THRU based in the @Imager’s circuit, using H1L11 optocouplers.
The controllers part works like a charm with your new code. I didn’t need to change a single line. You made a very good work, man!! Thanks a lot!
FYI, i’m testing without external pull-ups, and using the Zynthian Controller PCBs with “capacitor-to-ground” for debouncing: 100nF for switches and 10nF for encoder pins. This is really simple and works quite well. The software debouncer almost don’t need to work.
I hope to merge your changes into the master branch ASAP, so please, make a “pull request”.
In the other hand, i made a stupid error in the PCB design and MIDI-OUT & THRU are not working. You can use it to fry an egg, but not to do MIDI stuff with it, so i’ve removed the optocoupler and fixed the PCB. Now i’m awaiting for the new ones to arrive …
Of course! The main reason to move the controllers to a GPIO expander is easing the configuration of hardware devices like displays and soundcards by avoiding “pin collisions”.
The new All-In-One circuit only uses I2C and the GPIO 25 & 27 (pin 35 & 36) for interrupts. This 2 GPIO ports are rarely used by any device. If you know some device using it, or you think there is a better choice, speak now, please!!!, before i order a few hundred of PCBs!
I think it should be perfectly possible to have a few meters. it depends of I2C frequency and cable capacitance. If needed, you can change the I2C frequency tweaking the config.txt, like that: