Gecho MIDI Interface
How to add MIDI IN and MIDI OUT functionality to Gecho
MIDI is a standard, wide spread interface for connecting various music gear like keyboards, synthesizers, drum machines and other. It carries information about notes - their pitch and velocity, plus some effects, timings etc. (as opposed to a complete sound carried by other interfaces e.g. common analog or digital lines). It works pretty much like a digital representation of music score.
Since the MCU used in Gecho can drive both MIDI IN and OUT pretty well, you will be able (in certain channels) control Gecho with a MIDI keyboard, or - the other way around - control devices that have MIDI input. The USB-MIDI keyboard that connects to PC won't work, you need one of those with classic 5-pin DIN connectors:
On Gecho board there is a (normally unassembled) area to host a simple MIDI interface. Your board will look quite like this one (only it won't be this greasy, as machine assembly does not use much soldering flux :)
In order to make MIDI work, few elements need to be added:
There are resistors, diode, and the most important element - optocoupler (or opto-isolator). Blue dashed lines represent internal PCB traces, also points carrying supply voltages are highlighted. IN(-) is a solder bridge to select which pad the negative input goes to, as the layout can accommodate various types with 4,5,6 or 8 leads. So far the TLP2368 is confirmed to be working fine, and I have few more alternatives to test:
The options to choose from
This is work in progress - for now, there is not much MIDI functionality implemented, apart from what was demonstrated early - basic receiving notes and playing sound and sending notes to Korg synthesizer.
But if you are interested in this feature anyway, you can:
- Source the components by yourself and follow the schematics
- Ask me to solder the harder SMD parts for you, and do the rest (you'll also get connectors for a break-out cable: 4-pole 3.5mm jacks, both male and female, and two DIN5)
Connectors and battery holders
Since DIN5 connectors are bulky, it's a good idea to leave them on a break-out cable and only include smaller connector in Gecho. They will fit into the battery compartment when not used. In my prototypes I have this 4-pole 3.5mm jack, or two normal stereo jacks:
Looks like too many wires? The remaining four (black-white-green-red) are there for SWD programming connector (which you only need if you want to work on source code). They all fit neatly with AAA battery holder, and the sliding door can be closed:
For comparison, AA battery holders take this much space:
Why two holders like this, and not a single 3xAA one? It's because the MCU can benefit from 3V voltage for backing up SRAM (the respective pad on board it's marked VBAT), it is good for storing user settings - memory content there is preserved during power off. This voltage is taken from first two cells (it works from 1.65 to 3.6V actually). To achieve the same with AAA holder, you can do something like this - the brown wire is connected to VBAT:
I got these from eBay and although they were advertised as MIDI cables, internally the connection was wrong. MIDI needs signal to be connected to pins 4 and 5, here the stereo jack was wired simply to pins 1,3,5. Some rework was needed - notice that one of them is now isolated by shrink tube instead of original connector. Perhaps you can come with your own solution, put your cables together the way you want (either with two 3-pole jacks or one 4-pole jack). Here is a good tutorial that explains correct wiring. Otherwise, you can wait until proper cables are available (those will use 4-pole connector).