#minidexed — Public Fediverse posts
Live and recent posts from across the Fediverse tagged #minidexed, aggregated by home.social.
-
Превращаем MIDI клавиатуру в синтезатор. Часть 1. Железо
Все началось со статьи Как собрать клон Yamaha DX7 за 10$ . Так как я достаточно давно занимаюсь музыкой, и люблю конструировать всякие электронные штучки, меня эта статья заинтересовала. Я тут же начал прикидывать по цене возможные варианты. RPI2040 конечно же очень дешево, но посмотрев пару обзоров на Picodexed на YouTube, меня не привлекла простенькая синтезаторная составляющая. Понятно, что это полная эмуляция движка Yamaha DX7, но слишком уж звук невзрачный и простой. После просмотра вариантов эмуляторов синтезаторов на RPI на YouTube меня больше заинтересовали проекты MiniDexed , MT32-pi и Mini-JV880 .
https://habr.com/ru/articles/982570/
#синтезатор #midiконтроллеры #roland_mt32 #Roland_JV880 #Minidexed #dyi
-
MiniDexed Raspberry Pi IO Board V2 Build Guide
Here are the build notes for my MiniDexed Raspberry Pi IO Board V2 Design. The previous version can be found here:
- Version 1: MiniDexed Raspberry Pi IO Board.
- SSD1306 Version: MiniDexed Raspberry Pi IO Board – Part 2
- HD44780 Version: MiniDexed Raspberry Pi IO Board – Part 3
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to electronics and microcontrollers, see the Getting Started pages.
Bill of Materials
- MiniDexed SSD1306 IO Board V2 PCB (GitHub link below)
- 1x SSD1306 OLED 132×64 display, pin order SDA, SCL, VCC, GND (see notes below on voltage levels)
- 1x GY-PCM5102 module
- 1x H11L1 optoisolator
- 1x 1N4148 or 1N914 signal diode
- Resistors: 1x 220Ω, 1x 470Ω
- Capacitors: 3x 100nF, 5x 10nF
- EITHER: 2x 3.5mm stereo TRS sockets (see PCB and photos for footprints)
- OR:1x 3.5mm stereo TRS socket and 1 5-pin DIN socket (see PCB and photos for footprints)
- 2x tactile buttons: 6x6x12 mm (suggested, see notes)
- 1x switched rotary encoder (see PCB and photos for footprint)
- 1x 2×20 GPIO extended header socket
- Pin headers
- Optional: 1x 6 pin DIP socket
Some SSD1306 OLED displays require 3V supplies and some require 5V. This requires a 5V version, but then there might be issues interfacing it to a Raspberry Pi if the display doesn’t include level shifters for the I2C lines.
There is a detailed discussion of what to look out for here: MiniDexed Raspberry Pi IO Board – Part 2.
Build Steps
Taking a typical “low to high” soldering approach, this is the suggested order of assembly:
- Diode and resistors.
- DIP socket (if used) or optoisolator (if not).
- TRS socket(s).
- Disc capacitors.
- GY-PCM5102.
- 2×20 way extended GPIO header.
- OLED display (maybe – see notes).
- Tactile buttons.
- Rotary encoder.
- DIN socket (if used).
Here are some build photos and additional notes.
Normally I would recommend the use of a DIP socket to protect the chips used, but in this instance, if this board is to be used with a case it may be that a DIP socket raises the optoisolator too high.
For once, I opted to skip the use of the DIP socket and soldered the optoisolator directly to the PCB. But the photo below shows a build in progress using the socket.
The MIDI IN socket is a dual footprint TRS or DIN mount. I’m using TRS here, so that is soldered on at the same time as the other TRS socket. If using DIN, then that should probably be the last thing to be soldered.
Unlike the previous board, this one uses the audio output pins of the GY-PCM5102 module. The simplest way to mount the module is the fix the pins as shown below and then fit the module over the top.
Not all the pins need to be connected, but the photo shows the minimum number required and their position.
Warning: The GY-PCM5102 may require some solder jumpers setting prior to installation. Full details of what is required can be found on the Clumsy MIDI pages here (see the important note about the “DAC solder bridges”): https://github.com/gmcn42/clumsyMIDI.
I’m suggesting 12mm high 6x6mm tactile buttons (that is 12mm total height, so around 8mm button height) but the exact height will depend on the encoder used and where any case would sit height wise with the encoder, display and buttons accessible.
Although I’m not using the extended pins of an extended GPIO header, they are slightly taller than a non-extended header which is useful here. I’ve just cut off the excess pin lengths once fixed on. Being able to cut off the outer row of pins also makes soldering the inner row a bit easier.
I’ve used longer pins for the display which allows me to set the height to a suitable level to fit with the height of the encoder and buttons. I’ve soldered them to the PCB and will add the display and trim the pins down to size once I know how tall I want to make it.
Here is a side-on view. As just mentioned, I’ve soldered the long pins in place for the display but won’t solder the display itself in place until I know the exact height I’ll need. As can be seen below it is unlikely to need the full height of the longer pins.
The completed board looks something like this. There are optional pin headers for the two buttons either in addition to or instead of the buttons themselves, but I’m not using them here.
Testing
I recommend performing the general tests described here: PCBs.
PCB Errata
There are no known issues with this PCB at this time.
Enhancements:
- None
MiniDexed Configuration
The MiniDexed configuration is unchanged from the first version of the board. Details can be found here: MiniDexed Raspberry Pi IO Board – Part 2.
3D Printed Case
There is now a version of my MiniDexed 3D Printed Cases for this version of the PCB when fitted with the MIDI TRS socket and used with a RPi 3A+.
Closing Thoughts
I’m really pleased with this update. It already feels a lot slicker than the first version.
It remains to be seen if this is easier to design a case for, but at the very least, not having a large gap for a MIDI DIN socket I’m sure will be an improvement1
Kevin
-
MiniDexed Raspberry Pi IO Board V2 Design
My two MiniDexed PCBs were some of the earliest ones I made and so I’ve wondered about revisiting them for a while now.
This is a respin of the SSD1306 version of the IO board that is, hopefully, slightly nicer to build a case around!
Here is the link to the original PCB: MiniDexed Raspberry Pi IO Board. There is the original version for the Raspberry Pi V1: MiniDexed Raspberry Pi V1 IO Board and scattered around the blog are boards for a Pi Zero, a RPi 400, a TX816 style device, a dual Pi version, and a version for a Pi5 that supports quad stereo audio output, among other things.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers and single board computers, see the Getting Started pages.
Basic Requirements
As a bare minimum I’m after a revision of the SSD1306 version of the board that is slightly more case-builder friendly than the original.
I’d also like to add or change the following:
- MIDI TRS.
- Better audio output socket.
- Fix the minor errata from the original board.
It still has to fit within a normal “HAT” type footprint for a Raspberry Pi as I’d like to be using it with a Pi 3A+ again.
I’d also like to arrange the connectors to be on the same side as much as possible.
The Circuit
This is the same schematic as before with the addition of a TRS audio output direct from the PCM5102 module. I’ve also fixed a few of the non-functional errata such as some erroneous component values.
The GPIO map remains unchanged, although “SELECT” is now labelled “BACK”:
PCB Design
I’ve updated the MIDI socket footprint to my dual DIN-TRS footprint. I’m probably going to use the TRS version myself, but it is nice to keep DIN as an option. I’ve had to move the buttons to allow for a second TRS socket for the audio output and have consequently moved the GY-PCM5102 module back away from the edge of the board.
With this arrangement all of the IO is now on the same side of the board apart from the RPi’s own USB (and ethernet if using a B+ version).
Getting the height of the components correct will be a bit fiddly as the display and buttons will be determined by the height of the encoder’s body.
As I keep forgetting which GPIO is used for what, I’ve added details on the underside of the PCB.
As the GY-PCM5102 has an analog GND to support the analog OUT, I thought it might be prudent to keep that part of the PCB GND isolated from the main digital areas. But I’ve also seen that two GND planes separated by a thin non-conducting strip also has another name – “antenna”…
This is where my experience meets peak ignorance, so I’ll have to see how it goes and if I end up reconnecting everything, then I’ll patch something through somehow
Closing Thoughts
Ultimately I won’t know if this is any easier to use than the V1 board until I start designing a new case. But the addition of MIDI TRS at least removes the need for accommodating a large DIN socket on the board and having all the connectors on the same side will be better I think.
I have wondered about a Pi Zero version that could have DIN sockets on the underside of the PCB, mirroring what I did for the HD44780 version of my original board.
I might still give that a try as that would make for quite a nice compact unit too.
Kevin
-
I'm making my own minidexed case. For a setup using a PCM5102A DAC, SSD1306 OLED, KY-040 encoder, 3 low profile key switches and TRS MIDI in. #synthdiy #electronics #minidexed #dx7
-
MiniDexed EuroRack PCB Build Guide
Here are the build notes for my MiniDexed EuroRack PCB Design.
This is a DIY module only for use in my own DIY system.
Do NOT use this alongside expensive modules in an expensive rack. It is highly likely to cause problems with your power supply and could even damage your other modules.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to single board computers, see the Getting Started pages.
Bill of Materials
- MiniDexed EuroRack PCB (GitHub link below)
- Front panel
- Raspberry Pi Zero (1 or 2)
- GY-PCM5102 module
- 128×32 SSD1306 OLED display module (pins order: GND-VCC-SCL-SDA)
- 1x L7805 regulator
- 1x H11L1 optoisolator
- 1x 1N5817 Schottky diode
- 1x 1N4148 or 1N914 signal diode
- 1×220Ω, 1×470Ω resistors
- 5x 10nF ceramic capactiors
- 3x 100nF ceramic capacitors
- 2x 47uF electrolytic capacitors (low profile if possible – see text)
- 1x switched rotary encoder with a threaded shroud and nut
- 2x tall tactile buttons – 6x6mm base, at least 12mm height (it needs to poke through the panel!)
- 16-way shrouded EuroRack style power header.
- 40-way GPIO header (optional: extended – see discussion).
- Pin-headers and connecting wires.
Also required: 3.5mm panel mount sockets for audio and MIDI – I use different types, but it will depend on the panel used (see panel discussion).
Build Steps
Taking a typical “low to high” soldering approach, this is the suggested order of assembly:
- Resistors and diode on the top.
- H11L1 (assuming soldered directly to the PCB).
- Disc capacitors on the top.
- Diode and disc capacitor on the bottom.
- Electrolytic capacitors on the bottom.
- GPIO and 16-way power socket on the bottom.
- Buttons and encoder on the top.
- GY-PCM5102 module (see photos for steps required prior to fixing).
- SSD1306 (see photos for steps required prior to fixing).
Here are some build photos and more details of the steps involved.
Note: Most of these photos show the build for V0.1 of the PCB. There are some minor updates in V0.2 which will be noted where relevant.
The power circuit on the underside of the board has two options for mounting the regulator. It can go either vertically or horizontally, but with the tab up. Both methods use the same solder holes. Which is chosen will largely depend on what heatsink options there are.
Note: the first version of the board only had a single option, with the tab down, making contact with the PCB. This didn’t really work from a cooling perspective, hence the change.
The following “in progress” photos still show the first version of the board with the regulator the other way around, an additional resistor, omitted from V2, and the diode in a different place.
Note that low-profile capacitors may be required as they will sit underneath the Raspberry Pi Zero. If the regulator is “standing up” then it should be possible to bend the capacitors over into the space reserved for the regulator.
The GPIO headers have to allow enough space for the Zero to be mounted and not interfere with the PCM5102. See discussion below.
The EuroRack headers need to be correctly oriented and shrouded headers are strongly recommended.
The SSD1306 requires additional spacers on the pins to raise it above the PCB for presentation closer to the front panel.
The PCM5102 must have its solder jumpers configured, if not set already, and requires both sets of pin headers adding.
In the photo below, the PCM5102 has zero-ohm, surface mount resistors as jumpers – but it is really hard to see! On first glance, it looks like there is no link configured at all, but they are connected as: 1L, 2L, 3H, 4L.
These modules have to be added after the other components, as they prevent access to the solder pads during assembly.
GPIO Header Options
One option is to use extended headers, which ought to allow room for the Zero and a heatsink (if required) on the main BCM chip. Note: A V2 Pi Zero could probably benefit from a heatsink I’d imagine if running fully processing all 8 tone generators.
Another option is to remove the on-board 3.5mm, SMT, audio jack on the PCM5102 as shown below, and use “normal” sized GPIO headers.
If non-extended GPIO header is used then, as already mentioned, low-profile electrolytic capacitors may be required as they are positioned underneath the Pi Zero too.
Power Options
As previously mentioned, there wasn’t really much choice when it came to mounting the power regulator for V1 of the board, but in V2 I’ve positioned it differently to allow it to be “tab up” or upright.
The upright positioning was hopefully placed so that a long, thin heatsink could be mounted alongside the Pi. This shows one of those heatsinks you can get for M2 SSD cards. I figure that drilling a hole in it would do the trick, but I’ve not actually done this myself (see below).
The solution I went with in the end was to actually replace the 7805 with a 7805-compatible DC-DC buck converter. These are available fairly cheaply online.
These work a lot more efficiently than a 7805, so especially when drawing 300mA or so from a Pi Zero 2 whilst dropping from 12V down to 5V, they still have no need of a heatsink.
The downside of using these (apparently) is that as a switching power unit, they can be pretty electrically noisy. But as I’m powering a microcontroller rather than a pure analog circuit in the first place, I decided it probably wasn’t going to be making things much worse. This is hardly a high quality, electrically clean build anyway!
Final Assembly
Required Components to use my panel:
- MiniDexed EuroRack Panel (see Github link below).
- Raspberry Pi Zero (1 or 2) with GPIO header pins.
- MiniDexed EuroRack PCB as described above.
- Panel mount 3.5mm TRS socket for MIDI. 6mm diameter hole assumed.
- Panel mount 3.5mm TRS socket for audio. 8mm diameter hole assumed.
- 2.5mm mounting posts, screws and nuts.
I’m using the same designs of TRS sockets for MIDI and audio that I use in all my modules. These need mounting on the panel. Soldering will come in a moment.
I found that with the GPIO header height I was using, alongside the final height of the SSD1306, height of the buttons, and the encoder’s shroud, that the following mountings were required:
- 2x black nylon 2.5mm 6mm screws
- 2x black 10mm 2.5mm spacers
- 2x white 8mm 2.5mm spacers with screws
- 2x white nylon 2.5mm 6mm screws
An alternative build had a slightly larger gap (due to using 12mm buttons) so required four sets of 10×2.5mm spacers.
Another quirk of my first build was that I only had 9mm high buttons which wasn’t quite enough to reach through the panel. Ideally a 11mm or larger button would be required.
But this allowed me to 3D print a white 2.8mm diameter, 3.0mm high, extension that I could glue on the top, meaning that the exposed part of the button was white, matching the panel.
My second build used a black panel and 12mm buttons, but as already mentioned this meant the panel had to use 10mm spacers instead of 8mm spacers. One issue with that is that there isn’t much of the encoder shaft exposed. I found some knobs that worked ok, but my preferred (cheap) knobs could not be fitted and still allow the encoder switch to function.
In summary, there is still a fair bit of trial and error with each build depending on the exact combinations of screen height, encoder shaft length, button length and so on.
Once the PCB and panel is fixed together then the two 3.5mm sockets can be soldered to the PCB (or connected using headers if that was the preferred option).
Recall that MIDI IN does not required a GND connection. Also double check which solder tabs correspond to the TIP and which to the RING, which should match the “T” and “R” labels on the PCB (“S” is for shield, i.e. GND).
Testing
I recommend performing the general tests described here: PCBs.
Then, prior to plugging in the RPi Zero, do the following:
- Verify that the 12V and GND connections of the EuroRack connector have no shorts.
- Power up the board (no Pi) and verify that there is a 5V signal present and going to the PCM5102 and SSD1306. The PCM5102 should have its red power LED on.
Only then power off, plug in the RPi Zero with an SD card containing MiniDexed (configuration below) and verify that the display, encoder, buttons, MIDI IN, and audio out are all working.
MiniDexed Configuration
The following are the key MiniDexed.ini configuration options required:
SoundDevice=i2s
SSD1306LCDI2CAddress=0x3C
SSD1306LCDWidth=128
SSD1306LCDHeight=32
LCDColumns=20
LCDRows=2
ButtonPinBack=5
ButtonActionBack=click
ButtonPinSelect=11
ButtonActionSelect=click
ButtonPinHome=6
ButtonActionHome=click
ButtonPinShortcut=11
EncoderEnabled=1
EncoderPinClock=10
EncoderPinData=9PCB Errata
As already noted, there were a number of issues with the first version of the PCB, but these should have been addressed in the published version.
As the time of writing, there are no further known issues with V0.2 of the PCB.
Enhancements:
- I feel like the power situation ought to be better. One option could be to break out a USB connection to the Zero directly allowing the use of a standard “wall wart” type supply.
- Another option might be to make use of the solder pads on the rear of a Zero (like the Zero STEM does).
- It might also be useful to provide a configurable (e.g. solder bridge) link to enable the EuroRack +5V supply as an option.
- There are already options to use internal (within a rack) links for MIDI and audio if required using the pin headers on the PCB, but it might be nice to allow a choice between panel or rear connectors.
Closing Thoughts
I’m still not fully happy with the longer-term implications of how I’m powering these boards, but I’ll see how things go. Those DC-DC converters seem like a feasible option so I’ll see how they perform.
The panel height issue could be better too – it would be nice to have a recommended set of components and a known useful size of spacers, but there is still a fair bit of trial an error at the moment with each build.
Also, sometimes the display height isn’t perfect, as shown below. I might 3D print a display bezel or surround to help.
The end results looks pretty good though, so for this stage in my thinking about these, I’m pretty pleased with how this has ended up.
But one last time, just to make my position totally clear: this is a DIY system and should only be used with other DIY modules you wouldn’t mind too much losing.
It is NOT for use alongside other commercial (expensive) or treasured modules. There are commercial versions of MiniDexed apparently for that, that I have no experience of.
Kevin
-
Someone asked on the MiniDexed forums if the Google/Raspberry Pi AIY Voice HAT could be used with MiniDexed. This reminded me that I had V1 of the kit tucked away in a corner somewhere, so decided to finally take a look at it!
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers and single board computers, see the Getting Started pages.
Parts list
- Raspberry Pi 3
- AIY VoiceKit
- USB MIDI Controller
AIY Voice HAT
The core project information can be found here:
- https://aiyprojects.withgoogle.com/voice-v1
- https://pinout.xyz/pinout/voice_hat
- https://github.com/google/aiyprojects-raspbian/tree/aiyprojects
And here are some additional sources of information:
- https://dronebotworkshop.com/hacking-google-aiy-voice-kit-part-1/
- https://community.element14.com/products/raspberry-pi/b/blog/posts/google-s-alexa-like-pi-aiy-kit-mini-teardown
The Google-designed AIY Voice HAT is an add-on board designed for use with a Raspberry Pi 3 to provide audio input and output, with breakout connections for I2S, SPI, servos and motor drivers. Audio input is provided via two MEMS microphones that stream I2S directly into the Pi and audio output is provided by a MAX98357A – a “Tiny, Low-Cost, PCM Class D Amplifier with Class AB Performance” according to the datasheet.
This is the same device used on the “Adafruit I2S 3W Class D Amplifier Breakout – MAX98357A” and in fact, if you look at the schematic for the voice HAT there is an interesting section that seems to imply that one of the Adafruit modules can be added to provide a second channel output for full stereo operation.
And it can be seen that there is a row of 7 unmarked pin header holes that when paired with a couple of additional holes the other side of the onboard MAX98357A, looks suspiciously like the pin footprint of the Adafruit board.
And sure enough, in the guide it does suggest adding that module to give a right channel output (see more here).
Audio on the AIY Voice HAT
In terms of GPIO interface, the full details can be found at pinout.xyz here and in the AIY Voice datasheet, but the relevant ones for audio output are as follows:
Physical PinGPIOFunction25V Power6GND1218I2S Clock3519I2S WS3616Amp Shutdown3820I2S Data IN4021I2S Data OUTThese are standard power and I2S (PCM) audio connections, apart from GPIO16 “Amp Shutdown”. This is connected to “SD_Mode” of the MAX98357A (see above schematic section). The datasheet tells us that driving this LOW will put the amp into shutdown. But it also says it is responsible for selecting the mode of the amplifier, depending on the resistor used to drive SD_Mode HIGH. Example resistor values are provided for 1.8V and 3.3V operation:
There is a solder jumper on the board that changes the resistances to enable stereo mode – i.e. L channel goes to the onboard MAX98357A and R channel goes to the Adafruit add-on module.
For operation with MiniDexed, this pin just has to be held HIGH to 3.3V.
Also, of course, MiniDexed has no audio input, so GPIO20 (pin 38) just has to remain unused.
AIY Voice HAT Other Pins
Key additional functions for a MiniDexed would typically be:
- Serial MIDI interface via the UART (RX/TX).
- Display either via direct GPIO or over I2C.
- Button inputs.
- Rotary encoder.
In terms of the AIY Voice HAT, there are breakouts for I2C, SPI and then bespoke output driver connections for servos or motors. The button header includes outputs for a LED and an input for a button switch (which is also duplicated by the on-board button).
This means the following GPIO pins are easily available for MiniDexed purposes:
GPIOTypical AIY UsePossible MiniDexed Use2I2C headerI2C SDA for display3I2C headerI2C SCK for display7SPI headerGeneral IO8SPI headerGeneral IO9SPI headerGeneral IO10SPI headerGeneral IO14TXD headerTX for MIDI15RXD headerRX for MIDI22SPI headerGeneral IO23ButtonButton InputAll other GPIO pins include electronic circuitry as part of the AIY HAT which means it would be somewhat problematic to use for other purposes.
Use with MiniDexed
So for basic audio output it is possible to use the AIY Voice HAT with MiniDexed provided that GPIO 16 (Amp Shutdown) can be set HIGH.
Thankfully the Raspberry Pi has the config.txt file which is read and processed on startup before any operating system runs and this has the ability to preset GPIO pins to a defined state.
To use the AIY Voice HAT with MiniDexed therefore requires the following configuration.
In MiniDexed.ini, configure sound output to be I2S:
SoundDevice=i2s
In config.txt, preset GPIO 16 to be HIGH:
gpio=16=op,dh
Then be sure to check that any other GPIO uses in minidexed.ini do not conflict with any of the GPIO pins used by the AIY Voice HAT.
Then it is just a case of connect up the speaker, plug in a USB MIDI controller, and it just works.
https://makertube.net/w/hu8qmtHg4xQY1khWfGvFdE
Closing Thoughts
Apparently these HATs can be bought quite cheaply these days, and I suppose if you have one lying around already (that you got a number of years ago off a magazine!) then it is an easy source of an I2S DAC.
But really, it isn’t easy to build out the other MiniDexed interface components to make a fully functional system, so I’d probably say save you AIY HAT for some neat robotics applications and just get a GY-PCM5102 module.
But if you want to get on an use the AIY Voice HAT as your sound output for a MiniDexed, then yes. It works. And so would the Adafruit MAX98357A breakout.
Kevin
https://diyelectromusic.com/2024/10/12/aiy-voice-hat-and-minidexed/
-
Here are the build notes for my RPi 400 MIDI and Audio PCB.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
In this case – inserting this pcb incorrectly (which unfortunately is possible with the RPi-400) could damage the RPi 400. See full post below for details.
If you are new to microcontrollers and single board computers, see the Getting Started pages.
Bill of Materials
- RPi 400 MIDI and Audio PCB (GitHub link below)
For the MIDI circuit
- 1x H11L1.
- 1x 74HCT14 (NB: Must be the HCT version, not the HC).
- 1x 1N914 or 1N4148 signal diode.
- 5x 220Ω resistors.
- 1x 470Ω resistor.
- 2x 100nF ceramic capacitors.
- Either: 3x 5-pin, 180 degree PCB-mount DIN sockets (see photos for footprint).
- Or: 3x stereo TRS PCB-mount sockets (see photos for footprint).
- Optional: 6-way DIP socket; 14-way DIP socket.
- 1x 2×20-way right-angle GPIO header socket.
For the additional DAC and MiniDexed sections:
- 1x GY-PCM5102 DAC module.
- 1x SSD1306 32×128 OLED display (pin order: GND-VCC-SCL-SDA).
- 5x 10nF ceramic capacitors.
- 2x 100nF ceramic capacitors.
- 1x switched rotary encoder (see photos for footprint).
- 2x slim toggle pcb-mount button switches (see photos for footprint).
- Optional: 4-way header socket for SSD1306 display.
For structural support when installed:
- 2x 2.5mm, 6mm nylon spacers
- 2x 2.5mm nylon nuts
Build Steps
Taking a typical “low to high” soldering approach, this is the suggested order of assembly:
- All resistors and diode.
- DIP sockets (if used) and TRS sockets (if used).
- Disc capacitors.
- GY-PCM5102 module (if used) – check that the solder jumpers on the back (see below).
- Buttons (if used).
- 4-way SSD1306 header socket (if used).
- GPIO headers.
- DIN sockets.
- Rotary encoder.
As mentioned in the design notes, it is possible to install the three main sections of the PCB independently depending on what is required:
- The MIDI circuits.
- The PCM5102 DAC.
- The MiniDexed IO components (display, encoder, buttons).
If a DIP socket is used for the 74HCT14 the to install the SSD1306 display will probably require a 4-way header socket in order to lift it high enough to avoid the installed 74HCT14 and to not negate any benefits of having the chip in a socket!
If the H11L1 and 74HCT14 are soldered directly to the board then a SSD1306 with extended pin headers should be adjustable enough to be soldered over the other components.
The capacitors that are labelled “10p” are actually 10nF capacitors. This is an error in the silkscreen.
Here are some build photos for a complete build with all sections complete.
At this point the MIDI sections are complete and it is possible to now install the TRS or DIN sockets and the GPIO header if a MIDI only board is required.
To continue building the DAC and IO sections see below.
Note check the PCM5102 jumper settings before fixing – more here. Also note how the capacitor for the PCM5102 is folded down underneath the board.
At this point the TRS or MIDI sockets can be installed.
Once complete, it is strongly advised to add a couple of 2.5M 6mm spacers to the middle of the PCB in order to support it when plugged into the RPi 400. This is particularly important if using a switched rotary encoder and the buttons.
As one of the holes for the spacers is under the corner of the PCM5102, it might need trimming down slightly to fit without pushing the PCM5102 upwards. In my case I had to cut the thread down slightly as shown in the photos below.
Here is the final board.
Testing
I recommend performing the general tests described here: PCBs.
Once the above tests were complete, I tried the board with a Raspberry Pi 3A+ on the basis that if something went wrong it would cost me a lot less to replace a 3A+ than my new RPi 400.
Care must be taken to orient the board correctly though when not using a RPi 400 – see photos below.
Once all seems to be functioning, I switched to my Raspberry Pi 400.
IMPORTANT: Additional care must also be taken when installing in a RPi 400 as it is quite possible to plug the board in “one pin out”. If this happens, then there is a distinct risk of connecting one of the 5V GPIO pins to GND which would damage the RPi 400.
With hindsight, the use of a keyed header socket (assuming they exist in right-angled, pcb-mounted format) would stop this happening.
If I rebuild this board, then I might leave pin 4 5V unconnected to prevent this happening. I don’t think any other power pins are adjacent to GND, although it still leaves the possibility of feeding a HIGH GPIO directly to GND in other places.
PCB Errata
There are the following issues with this PCB:
- As mentioned before, the capacitors labelled “10p” are really “10n”.
- The pcb slightly overlaps the uSD card slot on the RPi-400 which means it can’t be removed when the pcb is installed.
- Inserting incorrectly could connect GPIO 5V to GND and damage the RPi 400.
Sample Applications
MiniDexed Raspberry Pi 400
The board is essentially a mirror of my MiniDexed Raspberry Pi IO Board physically arranged to support the Raspberry Pi 400 form-factor.
Below are the key minidexed.ini configuration settings that allows the RPi 400 to act as a MiniDexed synth with this board.
The MIDIThru setting is not required for general operation but can be used to turn on software MIDI THRU between the IN and OUT ports.
Also, MIDIThru can be used to direct the RPi 400 keyboard to the MIDI OUT port, turning it into a MIDI controller. The internal keyboard is device “ukbd1” which needs linking to “ttyS1” for the MIDI interface.
SoundDevice=i2s
#MIDIThru=ttyS1,ttyS1
MIDIThru=ukbd1,ttyS1
LCDEnabled=1
SSD1306LCDI2CAddress=0x3C
SSD1306LCDWidth=128
SSD1306LCDHeight=32
SSD1306LCDRotate=0
SSD1306LCDMirror=0
LCDColumns=20
LCDRows=2
ButtonPinPrev=0
ButtonActionPrev=
ButtonPinNext=0
ButtonActionNext=
ButtonPinBack=5
ButtonActionBack=click
ButtonPinSelect=11
ButtonActionSelect=click
ButtonPinHome=6
ButtonActionHome=click
ButtonPinShortcut=11
EncoderEnabled=1
EncoderPinClock=10
EncoderPinData=9The built-in keyboard can be used as a simple 2-octave music keyboard to play the synth as follows:
Raspberry Pi 400 MIDI and Audio Interface
The board can be used as a MIDI and audio interface for the standard Raspberry Pi 400 OS too.
The basic idea is to use a I2S DAC overlay for the PCM5102 and to enable the serial port, but not the serial console, in the raspi-config and map MIDI onto it in some capacity.
Enabling the PCM5102 Sound
The full instructions are the same as described here: https://learn.pimoroni.com/article/raspberry-pi-phat-dac-install
But the short version (for 32-bit Raspberry Pi OS “bullseye”) is as follows.Edit /etc/config.txt and comment out or add the following:
# dtparam=audio=on
dtoverlay=hifiberry-dacThere are other settings in there related to I2S but these can be ignored as the overlay file will include everything it needs. Note: commenting out the audio=on line will disable the built-in audio via the bcm device in the Raspberry Pi.
Then create an /etc/asound.conf file with the following:
pcm.!default {
type hw card 0
}
ctl.!default {
type hw card 0
}According to this document, this tells ALSA (the Linux sound system) to override its own default with hardware card 0, which is now the PCM5102. This can be confirmed using the command:
pi@raspberrypi:~ $ cat /proc/asound/cards
0 [sndrpihifiberry]: RPi-simple - snd_rpi_hifiberry_dac
snd_rpi_hifiberry_dac
1 [vc4hdmi0 ]: vc4-hdmi - vc4-hdmi-0
vc4-hdmi-0
2 [vc4hdmi1 ]: vc4-hdmi - vc4-hdmi-1
vc4-hdmi-1
pi@raspberrypi:~ $For it to work though I have to then select the “snd_rpi_hifiberry_dac” option in the “Device Profiles” by right-clicking on the Raspberry Pi OS Desktop “sound” icon in the tray (next to the clock).
Enabling Serial (UART) MIDI
Serial MIDI is linked up to the Raspberry Pi’s GPIO TX/RX ports on pins 14 and 15. But by default there are a couple of issues with just hooking these up to a MIDI interface:
- They are usually either expected to be used with a serial console or configured (apparently) for a faster Bluetooth link.
- The supported baud rates don’t include the standard MIDI 31250 baud.
- By default there is nothing that will connect a UART based serial port to ALSA to allow it to be used.
Details of how to solve this can sort of be found around the Internet, but I’ve not found a complete “just do this and everything works, and this is why” document. The official Raspberry Pi documentation for the UART can be found here: https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-uarts (although to be honest, I didn’t quite follow most of it myself… primary UARTs? Hmm)
Other references:
- https://www.instructables.com/PiMiDi-A-Raspberry-Pi-Midi-Box-or-How-I-Learned-to/
- https://gist.github.com/CarloCattano/8c01a6dea6ecbb459acd0b6bcd752ea6
- https://www.samplerbox.org/article/midiinwithrpi
First enable the serial port and disable the console. This can be done by editing /boot/config.txt directly, but can also be done from the Raspberry Pi Configuration GUI tool.
Then in /boot/config.txt these additional updates are required:
enable_uart=1
dtoverlay=miniuart-bt
dtoverlay=midi-uart0The first is probably already there if the serial port was enabled using the GUI. The second one apparently switches the internal Bluetooth over from using TX/RX on pins 14/15 to using ttyS0 (it is also possible to disable it completely with “disable-bt”). This frees up ttyAMA0 (TX/RX) for our use, which is the first UART on the PL011 peripheral on the bcm chip. The last setting includes some magic to tweak the clocks and baud rates so that the standard rate of 38400 will actually come out at the MIDI rate of 31250.
Details of each of these overlays can be found in the Raspberry Pi documentation (the README) here: https://github.com/raspberrypi/firmware/tree/master/boot/overlays and details of how the UARTS are set up and used on the different Pi versions, and which options are available, can be found here: https://www.raspberrypi.com/documentation/computers/configuration.html#configuring-uarts
Note: there are variants of midi-uart for other UARTs (which apparently can be enabled on a RPi 4) and a special midi-uart0-pi5 version for the Raspberry Pi 5.
This should have enabled the primary UART on TX/RX (pins 14,15) to be available with a suitable MIDI baud rate. But to use it, that serial port needs linking up to the operating systems sound setup.
Apparently the most common way to do this appears to be to use the ttymidi tool, which I guess fulfils a similar function to hairless-midi on a Windows PC (although I note hairless says it supports Linux too, even though it too recommends ttymidi!).
Unfortunately there doesn’t seem to be a ready-made version just to install, so it has to be built. The instructions from here worked fine for me:
$ sudo apt-get install libasound2-dev
$ wget http://www.varal.org/ttymidi/ttymidi.tar.gz
$ tar -zxvf ttymidi.tar.gz
$ cd ttymidi/
$ make
$ sudo make installOnce installed this needs to be started to connect the serial port to ALSA:
$ ttymidi -s /dev/ttyAMA0 -b 38400 -v
This provides the serial port and baud rate (remember 38400 has been tweaked to really be 31250 “on the wire”). The “v” option means it will dump any messages to the console. An optional “n” option can be used to give the link a nice name that can be used later. Without it, it defaults to “ttymidi”.
Two additional, useful tools to install (using the Raspberry Pi Add/Remove Software tool) are pmidi and midisnoop. pmidi can be used to list MIDI devices.
pi@raspberrypi:~ $ pmidi -l
Port Client name Port name
14:0 Midi Through Midi Through Port-0
128:1 ttymidi MIDI in
pi@raspberrypi:~ $The ALSA tool aconnect can also list available ports:
pi@raspberrypi:~ $ aconnect -l
client 0: 'System' [type=kernel]
0 'Timer '
1 'Announce '
client 14: 'Midi Through' [type=kernel]
0 'Midi Through Port-0'
client 128: 'ttymidi' [type=user,pid=2619]
0 'MIDI out '
1 'MIDI in '
pi@raspberrypi:~ $MIDIsnoop can be configured to use these ALSA ports and then can be used to show everything working.
How to actually use the ports I’ll might come back to, but in essence that becomes a tutorial in how to use ALSA and sound on Linux and there are lots of tutorials about that out there already.
At some point I’d like the above to all happen automatically on startup so that ttymidi is running and available to ALSA. That should be possible to add to one of the startup scripts, but that is left as an exercise for the reader (i.e. I haven’t looked that up yet).
Closing Thoughts
The “off by one” possibility of error when plugging the board in is concerning. I’d not anticipated that! But by being careful that should be manageable.
I also wasn’t anticipating not being able to unplug the uSD card! Oh well.
Apart from that, I’m really pleased with how it works.
At some point I might return to this and detail how to drive the display from Raspberry Pi OS itself as that would be a nice way to finish things off.
Kevin
https://diyelectromusic.wordpress.com/2023/12/18/rpi-400-midi-and-audio-pcb-build-guide/
-
Now I’ve got my Raspberry Pi 400 up and running I’ve built a MIDI and I2S audio add-on board for use with the GPIO.
- Build guide here: RPi 400 MIDI and Audio PCB Build Guide.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers and singled board computers, see the Getting Started pages.
The Circuit
The key features of this design are:
- Raspberry Pi 40 pin GPIO header connection.
- Powered via the RPi GPIO.
- Includes 3V3 MIDI IN circuit using H11L1.
- Includes proper buffered MIDI OUT and THRU using 74HCT14.
- Includes I2S connection to a GY-PCM5102 module.
- Includes optional I2C SSD1306 OLED 32×128 display.
- Includes optional rotary encoder and buttons with debouncing capacitors.
The primary aim for this board is Raspberry Pi 400 MIDI and I2S audio DAC. But I thought it I was going that far then I would also include the options for a rotary encoder, buttons and display which would allow the board to be used as a MiniDexed user interface too.
PCB Design
The board will plug in behind the RPi 400, so the idea is to use a 90-degree angle GPIO connector. The board supports either TRS or DIN MIDI sockets.
To just be used as a MIDI interface, the following components are required – all shaded out components may be omitted.
The I2S Audio DAC section is highlighted in purple on the left hand side if that is wanted to be added to the MIDI or just used on its own. Note how the capacitor for the PCM5102 will be situated between the PCB and the PCM5102 itself. It will need folding down to be installed.
This is a now standard (for my blog) H11L1 MIDI IN circuit paired with a 74HCT14 (not the HC variant – it has to be the HCT version to support the level shifting required) based MIDI OUT section. There is also a hardware MIDI THRU port. As can be seen from the PCB the board will take either TRS or DIN MIDI sockets – footprints are included for both.
Note: This is designed to be used with a right-angle GPIO header for plugging into a Raspberry Pi 400. Should the board want to be used with a typical RPi, then the power pins are on the far right hand side of the board with 5V on the top row and 3V3 on the bottom row. The GPIO connector will “point upwards” so it really has limited use with a normal Pi as all the components would be on the underside of the board – i.e. between the PCB and the Pi… but electrically it would all work!
To use the board as a MiniDexed user interface then the buttons, rotary encoder and SSD1306 display, and associated capacitors, can be added. Note that the SSD1306 display will have to sit above the 74HCT14.
There is one error on the board. All the debouncing capacitors for the encoder and the switches are labelled “10p” when it should be “10n”. I’ve made that mistake before and it simply got copied over to this design too without me spotting it!
Closing Thoughts
I was tempted to try to make something a bit simpler that could be used with my Cyberdeck, but instead opted for this stand-along board.
Whilst I don’t see a lot of use for a RPi-400 based MiniDexed, I couldn’t really think of a reason not to include the additional components. Having to route the PCM5102 such that the jack was in a useful position meant I wasn’t able to make the board much smaller anyway.
Kevin
https://diyelectromusic.wordpress.com/2023/12/18/rpi-400-midi-and-audio-pcb-design/
-
Here are the build notes for my RPi Zero MiniDexed IO Board PCB.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
If you are new to microcontrollers and single board computers, see the Getting Started pages.
Bill of Materials
- RPi Zero MiniDexed IO Board PCB (GitHub link below)
- SSD1306 OLED 128×32 I2C display (pinout: GND-VCC-SCL-SDA).
- Optional: GY-PCM5102 I2S DAC module.
- 2x 100nF ceramic capacitor.
- 5x 10nF ceramic capacitor.
- 1x Switched rotary encoder (PCB mount, see photos for footprint).
- 2x miniature toggle switches (PCB mount, see photos for footprint).
- 1x 4-way header socket.
- 1x 2×20 GPIO header socket.
Build Steps
Taking a typical “low to high” soldering approach, this is the suggested order of assembly:
- Disc capacitors.
- Button switches.
- GY-PCM5102 module (if used).
- 4-way header for display.
- GPIO header.
- Rotary encoder.
Build Options:
- With DAC: As described below with a GY-PCM5102 module on the board. The display will have to be fitted in a 4-way header socket and raised above he PCM5102 once fitted.
- No DAC: It is possible to use a PWM audio add-on for the Zero and not bother with a DAC. More details here: Raspberry Pi Zero PWM Audio Interface.
- External I2S DAC: It is possible to use something like the Pimoroni Audio DAC SHIM between the Zero and the MiniDexed IO board. More details here: A DX7 USB Dongle.
Note: in the case where the SSD1306 is soldered directly to the board, e.g. if no PCM5102 is used, the 100nF ceramic capacitor for its supply pins will have to be bent over flat prior to mounting the display.
Here are some build photos.
Prior to soldering on the GY-PCM5102 module, the jumpers on the rear of the board may need to be configured. Sometimes they are soldered (left) and sometimes use zero-ohm SMT resistors (right), but the configuration required is 1=L, 2=L, 3=H, 4=L.
Only the 6-way connector is used for connection to the board, but it is recommended that at least a single additional header pin is used on the 9-way header to help physical stability of the final build.
This can be used with any Raspberry Pi, but my main aim was for something that could be used with a Pi Zero acting in USB Gadget Mode for example, with my DX7 USB Dongle as shown below.
Testing
I recommend performing the general tests described here: PCBs.
Once assembled, the correct MiniDexed configuration is required, as described below.
PCB Errata
There are the following issues with this PCB:
- The 5 debouncing capacitors for the encoder and switches are listed on the board as “10p” but they should be “10n” – i.e. 10nF ceramic capacitors.
Enhancements:
- Additional GPIO headers could be added for further expansions – e.g. more buttons.
MiniDexed Configuration
The key elements of the minidexed.ini configuration required to support this board are as follows.
# If in USB Gadget mode - see A DX7 USB Dongle.
USBGadget=1
# Either pwm or i2s
SoundDevice=i2s
LCDEnabled=1
SSD1306LCDI2CAddress=0x3C
SSD1306LCDWidth=128
SSD1306LCDHeight=32
SSD1306LCDRotate=1
SSD1306LCDMirror=0
LCDColumns=20
LCDRows=2
ButtonPinPrev=0
ButtonActionPrev=
ButtonPinNext=0
ButtonActionNext=
ButtonPinBack=5
ButtonActionBack=click
ButtonPinSelect=11
ButtonActionSelect=click
ButtonPinHome=6
ButtonActionHome=click
ButtonPinShortcut=11
EncoderEnabled=1
EncoderPinClock=10
EncoderPinData=9Closing Thoughts
Whilst it is somewhat irritating to have made the 10p/10n mistake yet again, I’m quite pleased with how these boards have come out.
I have a stackable TRS MIDI interface in the works too which should be able to work with this IO board too.
Kevin
https://diyelectromusic.wordpress.com/2023/12/02/rpi-zero-minidexed-io-board-pcb-build-guide/
-
The amazing Rene Stange added USB Gadget (i.e. device) support to the Circle bare metal Raspberry Pi environment a while ago so I’ve now incorporated that into MiniDexed. This allows MiniDexed to be used as a USB device – i.e. it can just be plugged into a PC and used via USB MIDI directly, as long as your Raspberry Pi supports USB Gadget mode and you have some means of audio output.
This post looks at how to make a “USB dongle” that is basically a USB MIDI accessible DX7.
A quite note before I start however. Why would someone want to do this? There are several VST DX instruments for PCs if you want DX sounds in your DAW and Dexed itself gives you full access to a DX7 via a software interface.
So there is probably very little practical reason to do this. But personally, I just couldn’t resist the idea of having a plug-in DX7 on a USB stick!
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key tutorials for the main concepts used in this project:
If you are new to microcontrollers and single board computers, see the Getting Started pages.
Parts list
- Raspberry Pi Zero, Zero W or Zero W2.
- I2S or alternative audio output for a Pi Zero.
- USB “STEM”, “Zero Dongle” or other USB device connection (micro USB to USB A).
Note: the Pi Zero and Zero W will give access to a single MiniDexed tone generator. The Pi Zero W2, will support 8 tone generators.
Warning: When using a Raspberry Pi in USB Gadget mode, do not plug in its usual power supply! It should be USB “bus powered” only.
The Hardware
Whilst any Raspberry Pi that supports USB Gadget mode could be used with a suitable lead to power and link to MiniDexed, to make a USB “dongle” requires the use of a Pi Zero (any flavour) and a “dongle style” add on.
I’ve used the following:
It will also need a means of outputting audio from the Zero as MiniDexed only supports USB MIDI, not USB audio.
There are several options for audio out on a Pi Zero. By far the easiest is some kind of off-the-shelf I2S audio interface.
A really good, low-profile one ideal for use as a dongle is the Pimoroni Audio SHIM, which can be found here. It doesn’t even need soldering, it can push-fit over the Pi’s GPIO headers, but any I2S audio interface for the Pi can be used as long it doesn’t interfere with the USB plug for the “dongle”.
My ideal combination is the USB STEM and the Pimoroni Audio SHIM as it is both low-profile and has the USB plug at one end and the audio output at the other. But it does have to be soldered on.
The cheap adaptor board has the advantage of using spring-loaded connectors, so no soldering is required, although the PCB is very thin, so I don’t know how long it would last.
The 8086 solderless dongle is a neat solution, but whilst it works, the combination of location of the audio output and USB plug isn’t great. I’d have preferred it to be the other way round.
But it seems a lot more robust for a solderless solution than the cheap adaptor board.
MiniDexed Configuration
Hopefully by the time you read this, USB Gadget support in MiniDexed will be merged into the main code (it is PR567). Details of how to configure it can be found on the wiki here, but the key MiniDexed configuration (minidexed.ini) required for this configuration is as follows:
USBGadget=1SoundDevice=i2s
The rest of the configuration is largely ignored, but things like the LCD, buttons and encoder can simply be disabled (set to 0) as they are not required.
A Single DX7
As mentioned previously if using a Zero V1/W then a single tone generator is available. The MIDI channel it uses will be as defined in the default performance.ini file. It is set to OMNI by default. To change it, change:
MIDIChannel1=<MIDI channel 1 to 16>
The default MIDI configuration for MiniDexed assumes voice changes will be made with a combination of bank select Control Change and Program Change messages with each bank containing 32 voices. But the following configuration allows four banks to be spread across all 128 Program Change values:
ExpandPCAcrossBanks=1
When plugged into a PC it will come up as “MIDI Gadget” as a USB MIDI compatible device. Here it can be seen in MidiOx, being selected as the MIDI output.
This configuration assumes you’ve installed ROMS 1a, 1b, 2a and 2b at least (details here) in your sysex/voices directory on the SD card.
I have a MidiOx instrument file with all the voices for Roms 1a/1b/2a/2b/3a/3b/4a/4b selectable via Bank Select messages, and Roms 1a+1b+2a+2b configured for use as a single 128-voice bank via Program Change messages.
Find it on GitHub here. This needs to be copied to the “instr” directory of the MidiOx installation.
In MidiOx, View -> Instrument Panel, select “INS File: DX7ROMS.INS” and then choose one of the following for “instr”:
- “YAMAHA DX7 ROMS” for the individually selectable 8 ROMs.
- “YAMAHA DX7 VOICES” for the first four ROMs to be linked as a 128-voice single bank.
Both views (and voice selections) are shown below.
An 8-DX7 Instrument
If using a Zero 2W then 8 tone generators are available. In that case there is a choice. It can be treated as eight independent tone generators, in which case the MIDI channels for each TG should be set independently.
The following configures TGs 1-8 for MIDI channels 1-8.
MIDIChannel1=1MIDIChannel2=2MIDIChannel3=3...MIDIChannel8=8
At this point, the MIDI interface is the same as before, but changing the MIDI channel will change the tone generator being used.
Alternatively, it is possible to now treat the 8-way TG MiniDexed as a single instrument with much more complex sounds.
If the following setting is enabled in minidexed.ini:
PerformanceSelectChannel=1
This will interpret Program Change messages on MIDI channel 1 as selecting “performances”. Each “performance” is a configuration of up to 8 tone generators with a range of voices and effets.
The full list of default “performances” can be sound by browsing the MiniDexed github repository here.
Once again I’ve added a mode in my MIDIOx instrument file to support performances:
Warning: There is a proviso with this configuration.
At present, MiniDexed loads performances into consecutive “slots” meaning that the numbers in the MiniDexed repository do not relate to the “patch numbers” used over MIDI. The MIDIOx file supports the files in the repository at the time of writing. If new performances are added in some of the gaps (and there are gaps) in the numbering, then the names will be out of sync with what is installed.
Personally I think we need to change this and make the numbers relate to the MIDI program numbers. Watch this space!
Closing Thoughts
As mentioned in the introduction, with a good selection of software synths available that provide a DX7 on a computer for use with a DAW, there is limited use for a “DX7 on a USB stick”.
But I still think this is a pretty neat thing to be able to do, if nothing else, just for the fun of knowing that a $2000 synth from the 1980s can now be replicated with ~$20 worth of hardware that can be plugged into any PC and just “played”.
Kevin
https://diyelectromusic.wordpress.com/2023/11/22/a-dx7-usb-dongle/
#midiox #minidexed #raspberryPi #RaspberryPiZero #usbDevice #usbGadget
-
MiniDexed Raspberry Pi IO Board – Part 2
This is the set of build notes for the smaller of my MiniDexed Raspberry Pi IO Boards.
- Update: There is a newer version of this board: MiniDexed Raspberry Pi IO Board V2 Design.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key tutorials for the main concepts used in this project:
- My first experiments in KiCad: Arduino Uno Dual Merge MIDI “Shield” – Part 2
- MiniDexed: “Bare Metal” Raspberry Pi MiniDexed DX7
If you are new to microcontrollers and single board computers, see the Getting Started pages.
Bill of Materials
- Raspberry Pi 3 or 4 with associated power, uSD card, etc.
- You’ll need the smaller (SSD1306 version) of the PCB: MiniDexed Raspberry Pi IO Board (GitHub link below).
- 1x 128×32 I2C OLED SSD1306 display (see photos). Note it requires the pinout SDA-SCL-5V-GND. WARNING: Similar looking modules have been seen with different variations of this! Also, ensure it has built-in level shifting for 3V3 I2C operation.
- 1x GY-PCM5102 module (see photos).
- 1x H11L1 optoisolator.
- 1x 220Ω resistor.
- 1x 470Ω resistor.
- 1x 1N914 or 1N4148 signal diode.
- 2x 100nF ceramic disk capacitors.
- 5x 10nF ceramic disk capacitors (not 10pF as stated on the PCB).
- 1x rotary encoder with switch (see photos).
- 1x 5-pin 180 DIN PCB mounted socket (see photos).
- 2x “button” push-switches (see photos) – optional.
- 2x 2-way header pins – optional.
- 1x 6-way DIP socket – optional.
- 1x extended 2×20-way GPIO header socket for the Raspberry Pi.
- 1x 4-way header socket – optional.
- 1x 6-way header socket – optional.
As always, a socket are recommended for the H11L1, and the SSD1306 and PCM5102 modules can either be used with sockets or soldered directly, depending on how brave (or lucky?) you’re feeling.
Build Steps
This should be a relatively straight forward “through hole components” build. I did things in the following order:
- Resistors and diode.
- 6-pin DIP socket.
- Capacitors.
- Buttons (if used).
- If you are using headers for the SSD1306 and PCM5102 then do them next.
- If you are using header pins for the switches, do them next.
- MIDI socket.
- Rotary Encoder.
- PCM5102 and SSD1306 (if you aren’t using headers) – WARNING: see note below about the PCM5102 solder bridges before soldering.
- GPIO socket.
Note that an extended GPIO header is recommended to give the board a little extra clearance from the Raspberry Pi, but it means that if you don’t want the extra pins above the board, they should be cut off once soldered in place.
PCM5102 configuration:
The GY-PCM5102 modules I’m using, as shown in the photos, as the same as used for the Clumsy MIDI project and you have to be sure the configuration jumpers on the back of the modules are correctly set up before soldering in place. Full details of what is required can be found on the Clumsy MIDI pages here (see the important note about the “DAC solder bridges”): https://github.com/gmcn42/clumsyMIDI.
SSD1306 OLED Logic Levels
Several versions of these modules exist, but to use it with a Raspberry Pi requires one with 3V3 level shifters included. The 128×32 variety used in the photos often seems to include these, but the 128×64 variety often won’t!
The level shifters can be spotted on the back as follows:
In this case, marked “U2”. But to be sure, power the unit from 5V and measure the voltage on the SCL and SDA pins to see if it is pulled up to 3V3 or 5V.
Testing
I recommend performing the general tests described here: PCBs.
I used the “fishing wire trick” to be able to plug in the SSD1306 and PCM5102 without soldering and require using headers (nylon fishing wire in the holes gives enough traction to be able to push a header pin in, have it grip and make contact, without soldering. This allowed me to check everything was working, including the modules, whilst still giving me options for debugging.
It is probably also worth attempting to power up the board without connecting it to the Raspberry Pi as a “smoke test”. The PCM5102 and SSD1306 are powered from the 5V line, whilst the H11L1 is powered from the 3V3 line.
PCB Errata
Functionally, all seems ok, but there are a couple of markings I’d change.
- First off, an error in the capacitor values – the debouncing capacitors should be 10nF not 10pF.
- I labelled the switches Home and Select, but given the flexibility in the configuration (and the fact that typically the encoder’s switch will be “select), maybe they should just be “button 1” and “button 2”.
- The diode is labelled 1N914 but I believe 1N9148 tend to be preferred?
- I suspect I ought to use better capacitors (I know the Clumsy MIDI board recommends “X7R or film (e.g. WIMA MKS2)”).
- It might be worth adding a larger capacitor for the power to the board in general.
You can find the PCB design files on GitHub here: https://github.com/diyelectromusic/sdemp_pcbs/tree/main/RpiMiniDexedSSD1306
MiniDexed Configuration
I’m not going through how you set up and run MiniDexed. My own notes on it can be found here: “Bare Metal” Raspberry Pi MiniDexed DX7.
The following settings are required in the minidexed.ini file (correct as of time of writing, but the MiniDexed project shifts pretty quickly!).
For the SSD1306 LCD:
SSD1306LCDI2CAddress=0x3CSSD1306LCDWidth=128SSD1306LCDHeight=32LCDColumns=20LCDRows=2
For the Rotary Encoder:
EncoderEnabled=1EncoderPinClock=10EncoderPinData=9
For the two buttons, and the rotary encoder switch itself:
ButtonPinBack=5ButtonActionBack=clickButtonPinSelect=11ButtonActionSelect=clickButtonPinHome=6ButtonActionHome=clickButtonPinShortcut=11
If you don’t want to use the buttons, but would rather use the button on the rotary encoder for everything, then I suggest (which is the default, at the time of writing):
ButtonPinBack=11ButtonActionBack=longpressButtonPinSelect=11ButtonActionSelect=clickButtonPinHome=11ButtonActionHome=doubleclickButtonPinShortcut=11
Closing Thoughts
I love the idea that all I need is power, an audio output and a MIDI link (either USB or serial) and I have eight DX7s on hand and ready to go in this small, neat unit!
This one doesn’t really lend itself to being put in a case, although I guess it could if you extended the link to the display and buttons. But my next build, using the larger of the two PCBs, hopefully will!
As always, I have a small number of prototype boards, so if you might be interested in having a go yourself, ping me a private message somehow and we can talk.
Disclaimer: Once again, I used the Seeed Fusion service as I had some discount coupons I’d been sent, and once again I have absolutely no complaints about their quick, cheap service. I’m very pleased with these boards.
I am in no way connected to or affiliated with Seeed, but if they (or any other manufacturer for that matter) want to send me discounts, I for one am very happy to receive them.
Either way I’ll always post things here as I see them and make it clear when I’ve taken advantage of any special offers or vouchers.
Kevin
-
MiniDexed Raspberry Pi IO Board
I’ve been toying with the idea of some kind of IO board for my MiniDexed experiments for use with a Raspberry Pi. I initially wanted something fully self-contained – i.e. just pop it on a Raspberry Pi and you’re good to go. But then it was pointed out that having all the IO connections on one side is much more friendly from a “putting it all in a case” point of view.
- Update: There is now a newer version of this design for the SSD1306: MiniDexed Raspberry Pi IO Board V2 Design.
In the end, I used many of the same circuit elements and came up with two designs.
Update: Here are links to the build guides for these PCBs:
There is a version for the Raspberry Pi V1 here: MiniDexed Raspberry Pi V1 IO Board and my pseudo TX816 can be found here: MiniDexed TX816.
Warning! I strongly recommend using old or second hand equipment for your experiments. I am not responsible for any damage to expensive instruments!
These are the key tutorials for the main concepts used in this project:
- My first experiments in KiCad: Arduino Uno Dual Merge MIDI “Shield” – Part 2
- MiniDexed: “Bare Metal” Raspberry Pi MiniDexed DX7
If you are new to microcontrollers and single board computers, see the Getting Started pages.
Basic Requirements
I wanted a board to do the following:
- Include a screen or display.
- Have MIDI IN.
- Optionally include MIDI OUT and THRU.
- Have a rotary encoder for input.
- Incorporate a PCM5102 DAC for audio output.
- Optionally include a couple of buttons.
As I mention above, I was initially after something that would fit within a normal “HAT” type footprint for a Raspberry Pi, which is pretty constraining, but following on from the Clumsy MIDI board, should be possible with a small SSD1306 OLED display.
But I was also keen to try to build something that would allow all the IO to line up along the back, so I’ve also designed a larger board that overhangs the Pi and allows for a full three MIDI din sockets. This larger board can accommodate a HD44780 LCD display as used in the original MiniDexed setup.
I’m happy for the whole thing to receive power via the Pi and of course USB and ethernet connections are also available on one side.
MiniDexed RPi IO Board (SSD1306 Version)
Starting a new project in KiCad, there is already a “Raspberry Pi 40-pin Extension Board” template which provides the basic outline, PCB footprint for the GPIO, and cut-outs for the display and camera.
Here is the schematic I’m working to.
Points worthy of note:
- A H11L1 based MIDI IN circuit connected to RX0.
- A rotary encoder (not a KY-040 module) is used with 10pF capacitors for debouncing the connections.
- A PCM5102 in the “GY module” format (as used by Clumsy MIDI).
- Two optional button push-switches which are also broken out to headers, also with debouncing capacitors.
- I’ve included the header for the SSD1306 in SDA-SCL-VCC-GND format.
This is the GPIO map used:
If the rotary encoder seems to be “backwards” then swap RE_A and RE_B in the configuration. Note that at the time of writing, I2C SSD1306 displays are in development but hopefully will be available in MiniDexed by the time you read this.
Here is the board that has been sent off for manufacturing.
Design notes:
- I used the GY-PCM5102 symbol and footprint library from the Clumsy MIDI GitHub repository.
- The H11L1 is upside down as that made routing easier.
- I’ve included footprints for two push-buttons (the very common “through hole” type used in many maker projects) but also included two sets of header pins so these could be wired off to something else if required.
- I’m using a 32×128 OLED (again the same one used with Clumsy MIDI). As I say, MiniDexed doesn’t support this directly at the time of writing, but I’ve submitted a PR for support that is waiting to be accepted, so hopefully it will be fully supported soon.
- Unlike my previous boards, I used a filled zone to create a link to the GND net and provided a ground plane on the rear copper layer of the board.
- Both the SSD1306 and PCM5102 modules I’m using have a built-in regulator to take 5V down to 3V3. This is particularly critical for the SSD1306 as it includes pull-ups for the I2C connection to the 3V3 level (not 5V). But this is why they are hooked up to 5V yet I’m not using level-shifters to interface to the (3V3 logic) Pi.
Here is an early “space test” (without the buttons) with a paper printout to give you an idea of what I’m aiming for.
And an image of the Gerbers as sent off for manufacture:
MiniDexed RPi IO Board (HD44780 Version)
Again starting a new KiCad project from the Raspberry Pi 40-pin extension board template, this is the circuit I’m working with for this one.
Schematic Notes:
- This is using the same PCM5102, rotary encoder, and switches as above (although I’ve just realised I never swapped the schematic and pcb over to use the GY-PCM5102 module symbol and footprint – oh well, for this board it is a 6-way set of headers!).
- This uses the “data interface” version of the HD44780. I did think about using the I2C version, but thought this would be the simplest case to build if it could be made to work.
- There is MIDI IN, OUT and (optional) THRU.
- The MIDI circuit borrows heavily from Clumsy MIDI and includes a 74HCT14 hex inverter as an output buffer for OUT and THRU (although it is labelled as a 74HC14 on the schematic and pcb).
- THRU is optional, in which case the unused inputs to the 74HCT14 should go to GND instead (selected by solder jumpers).
- OUT can optionally be changed to a(nother) THRU rather than an OUT, in which case it can be switched via solder jumpers to be connected to RX0 rather than TX0.
To simplify the routing of the PCB, the pinouts for the various components have changed. Here is the pinout being used (this is now quite different to the original MiniDexed pinout).
So this is the design for the pcb that has been sent off for manufacture:
Design notes:
- The PCB is designed to be used with a Raspberry Pi “upside down”. That is, with the connectors at the top, and GPIO at the bottom. This means the USB/RJ45 ports will be on the left hand side, as shown.
- The MIDI THRU section is optional. If only two MIDI sockets are required that part of the board can be cut off along the line indicated. If that is done then the solder jumpers beneath the 74HC14 must be changed as follows:
- Cut the “THRU” jumper (this disconnects the 74HC14 from RX0).
- Solder the “NO THRU” jumper (this connects the unused 74HC14 port to GND).
- The MIDI OUT port can be changed to a THRU too. If the original THRU is removed, this means you can just have MIDI IN and THRU instead of IN and OUT if you wish. If the original THRU is retained, then you can have a MIDI IN and two THRUs. To turn the OUT into a THRU change the two solder jumpers near the H11L1 as follows:
- Cut the “OUT” jumper (this disconnects the OUT circuit from TX0).
- Solder the “THRU” jumper (this connects the OUT circuit to RX0 to make it a THRU).
- Whilst on the subject of MIDI sockets, all three sockets are oriented to go underneath the board so they will go alongside the RPi.
- The optional buttons are not provided on the PCB, but via two sets of headers on the left hand side of the board.
- As mentioned above, annoyingly I forgot to change the PCM5102 footprint to that of a GY-PCM5102 module, so there are no holes for the additional 9-way header. These are not used electrically, but they would have provided some additional physical support. Instead I might solder some header pins and use the plastic pin spacer as a support under the board (but I’ll look into that when I get the boards back).
- I’ve included a simple “preset” pot to control the contrast for the LCD.
- Once again I used a filled zone to create a link to the GND net and provide a ground plane on the rear copper layer of the board. Note that I left a cut-out under the traces to the THRU part of the circuit, to reduce the chance of a short if the board is cut off at this point.
- Most LCD1602/HD44780 modules are 5V parts, with 5V required to ensure the LCD actually illuminates successfully. However, as described here, it is usually ok for a 3V3 output to drive a 5V input, so as long as the LCD isn’t attempting to drive the IO pins for the Pi, the Pi should be fine talking 3V3 to the LCD. So that is the approach I’m taking. It does mean that this won’t accept a 3V3 LCD module. But in all this, remember my level of electronics experience, and make up your own mind…
Manufacturing
Both boards should be built using the standard, cheapest manufacturing options. Both are fine with a 6/6 mil constraint on track width and separation.
The second board is somewhat larger than the common “cheap” tier. For me, all my other boards were $4.60 plus postage for 10 boards, but the larger one has jumped up to around $27 plus postage.
On the back of my first blog post, having used Seeed Fusion to produce my first boards, they sent me some money off vouchers, so I’ve used them once again here. That was particularly welcome given the increased cost of the larger board!
I still don’t really have a space to store these designs. But I’ll update this post when I do!
Closing Thoughts
Although either of these designs could potentially be used in a case to make a nice, small, self-contained unit, I can’t guarantee that the spacing of connectors and components will really allow it. I’m also not sure what will be required in terms of cooling for the Pi, so I’ll have to see how I get on. It may be that I’ll need more spacing between the Pi and the IO board.
I’m still learning with KiCad, so am fully expecting continued mistakes or odd design choices, but I think both of these will be interesting to try.
Update: mistakes already spotted since sending them off:
- The afore-mentioned GY-PCM5102 footprint error.
- Labelling on the board states 74HC14 and it really has to be a 74HCT14.
So that is the walk-through of the design of these boards. Of course I won’t really know if they are successful until I get the boards back from manufacturing!
Kevin
#hd44780 #midi #minidexed #pcb #pcm5102 #raspberryPi #ssd1306