My New MIDI Merger uses 10 MIPS £1.00 PIC Microcontroller using PIC18F4320

This unit provides 4 autonomous MIDI inputs and 1 MIDI output. Note this is a ‘proper’ MIDI Merger – all 4 MIDI inputs can be used at the same time, unlike other ‘designs’. The unit also provides an indication of the channel number being played, and has shown itself to be capable of expansion into a full-blown controller.
The PIC microcontroller I used – 18F4320 was being sold off cheap, at £1.00 each by Crownhill Associates, in Ely – but don’t pester them for any 18F4320’s at this give-away price, as I bought the rest of their stock!
It’s always worthwhile to take a glance at their website, as inevitably they have PICs at discounts you wouldn’t find anywhere else. A purchase I made this week, was 5 PIC18F6620s – a 64-pin TQFP monster PIC – at only £2.00 per pop!

MIDI Merge

The intention here is to provide details of the schematic and photographs/advice on construction. The PIC code will be discussed more fully on All source-code is provided in this post, together with Eagle project files for the printed circuit boards.

The schematic is below. Apart from the PIC and it’s crystal, the other main components are 4 6N138 opto-isolators, 5 on-board DIN sockets, a voltage regulator, and a few resistors. I mounted the LEDs on a separate interface/indicator board, and the schematic for this is shown later. The handful of pin headers are used to add a key matrix and FTDI USB-TTL lead, for upgrading the software, using an internal bootloader.

Following are some views of the PCB. Note these are not all to the same scale. The complete Eagle project for the PCB is available for download.

As shown in the main schematic, the unit functions as a MIDI-Merger and Indicator. With the addition of a keypad, extensions to this are easily added. I added the following, mainly because I find them useful.

  • MIDI Minimum volume (set on a channel-by-channel basis)
  • MIDI Channel re-assign – Re-assign any MIDI Channel to another
  • Filter-out unwanted MIDI commands – Get rid of those pesky pitch-wheel messages from your MIDI Guitar Unit!

The front panel I have shown above – I created a separate user-interface board that incorporated a 16-key matrix, and duplicated the reset switch and LEDs.
The 4 resistors are 10K in value and the capacitor is 100nF. I used small TACT switches and extra-bright 3mm LED’s. I used 2- double-row pin headers to connect everything to the main board.


For more detail: My New MIDI Merger uses 10 MIPS £1.00 PIC Microcontroller using PIC18F4320

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us: