English Version Spanish Version French Version

MIDIbox Hardware Platform, USB Module

Note that meanwhile a better solution has been found: MBHP_USB_GM5

This module is expired as USB is natively supported by the MBHP_CORE_LPC17 module!

The USB module provides 2 MIDI In and 2 MIDI Out ports which are linked to the computer via USB. The driver is based on the official Device Class Definition from www.usb.org and plays together with every operating system which supports this class: WinME, Win2k, WinXP, Mac OS X, Linux, Pegasos, MorphOS and OS4.
Note: the MIDI-USB device class is not supported by Win95, Win98, Win98SE, OS/2 or Mac OS9!

The module has currently only be tested with WinME, WinXP and Linux (v2.4.21), I cannot guarantee that it also works with other operating systems, although they support the same driver class. During the development I noticed some anomalies where the Microsoft driver doesn't comply to the specification or just crashes either the firmware or the complete OS (e.g., if the example descriptors from the Spec are used 1:1, WinME crashes immediately ;-). In the meantime I was able to find workarounds so that the current implementation runs without crashes. But there are still three imperfections which should be considered before starting with this module:

  • The Microsoft driver isn't multiclient capable. This means, that only one program can allocate a MIDI port at the same time.
  • The Microsoft driver isn't able to send one SysEx string which is distributed over multiple buffers without errors. The complete SysEx string has to be sent from a single buffer (this affects the MIOS download, in the MIDI-Ox port config menu, you have to increase the Low level Output buffer size from 256 to 2048).
  • The Microsoft driver doesn't allow the USB module to change the device name. In the german distribution of Windows the ports are just called "Audiogeraet" (Audio Device). Use "regedit" and search for this name and change it to "MBHP_USB"

However, apart from these problems the module is running fine (under WinME and Linux...). If you build this module please don't forget to report me your experiences!

But there are also good news:

  • The Linux driver is multiclient capable and has no problems with longer SysEx strings

...just for the records ;-)

The USB firmware is written in C, open source and licensed for non-commercial use only. The source code is released for people who want to improve the driver or just take it as first step into the world of USB. The code has been developed with the free available EZ-USB toolchain which can be downloaded from the Cypress website (Design Resources->Developer Kits->Universal Serial Bus->Full Speed Peripherals->AN2131-DK001 EZ-USB Development Kit->EZ-USB Development Tools V2.61.700 - 62 MB!).
Note that these tools are not required to get the MBHP USB module running, the control panel which allows to upload the firmware comes with the mbhp_usb_v1_2.zip package!

The heart of the module is the AN2131SC from Cypress, a 8051 derivative with integrated USB peripheral. The advantage of this chip is the availability for hobbyists (Reichelt: 10.50 EUR, DigiKey: US $10.50), the embedded 8k SRAM which saves you from attaching an external memory, the IIC bootloader which loads the firmware from a EEPROM (24LC64) into the SRAM during power-on, and of course the free EZ-USB development kit.

Disadvantage of this chip: it's only available in a SMD package! This means that you need:

  • some soldering skills (beware of soldering this module when you just started with electronics)
  • a good soldering iron or station with a small tip! Best with temperature regulation (soldering temperature should be about 310° Celsius/590 Fahrenheit).
  • a desoldering pump for the case that you unintentionally soldered two neighboured pins

These requirements make the USB module not to a cheap replacement to a commercial MIDI Interface, although the electronic parts don't cost more than 20 Euro! It's only an alternative for real electronic enthusiasts or for people who finished every MBHP module successfully and looking for a new kick! ;-)
If you are searching for a cheap alternative, buy a M-Audio MIDIsport 2x2 for about 90 EUR, search for a similar device at EBay or buy some second-hand soundcards with MIDI interface.

Download

PCB data, can be viewed, modified and converted with Eagle Light. The .pdf based schematic has been created with xcircuit. There are no special eagle schematics available, since components have been netlisted in the .brd file directly!
Module Schematic Layout Data Quick-view
MBHP_USB_V1 mbhp_usb.pdf mbhp_usb_v1b.brd mbhp_usb_v1b.gif
Note: the difference between mbhp_usb_v1 and mbhp_usb_v1b: we forgot to enter the "ratsnest" command before saving the file, therefore the ground plane wasn't visible as well as the connection between pin 3 and 4 of IC2. If you've created your own PCB, check that these pins are connected to ground. If you've ordered a premade PCB from Mike, you will notice that this connection is already there.
MBHP_USB mini mbhp_usb_mini.pdf --- ---
Firmware
File Size Description
mbhp_usb_v1_2.zip 453k This package contains the precompiled firmware, the source code and the EZ-USB control panel. Note that the EEPROM can only be burned under Windows with the EZ-USB application.
New: v1_2 contains a .syx file which can be downloaded via a MIOS core. A description about the various files has been added. Difference between v1_1 and v1_2: each port is buffered with 128 bytes now!
Additional informations
File Size Description
mbhp_usb_orderlist.txt 1k Reichelt orderlist
mbhp_usb_connections_case1.pdf 5k How to connect 1 core module and one MIDI keyboard
mbhp_usb_connections_case2.pdf 5k How to connect 2 core modules
mbhp_usb_connections_case3.pdf 5k How to use the module standalone
mbhp_usb_connections_case4.pdf 5k How to power a core module via USB

Available Ports

Following interfaces are provided by the USB module:

Name No. of pins Description
J1 2 External power supply port. Can either be used to power the USB module from external if the Vout of your computer or especially laptop is not "strong" enough (in this case the Power Supply Jumper near by the USB port should be opened!) or this port can be used to power a core module (in this case the Power Supply Jumper near by the USB port should be closed!)
J2 2 Connection to a Power-LED. Recommented for debugging!
J3 4 IIC port for future extensions (e.g an Audio Device)
J4 2 MIDI-In indicator LED for port #1
J5 2 MIDI-Out indicator LED for port #1
J6 2 MIDI-In indicator LED for port #2
J7 2 MIDI-Out indicator LED for port #2
J8 4 Direct link to J11 of a core module, port #1. Note: the Vd pin (+5V) should not be connected to avoid power problems. If you would like to supply the core module, use J1 instead.
J9 4 Direct link to J11 of a core module, port #2

Used Components

Here a list of the used components. A complete orderlist for Reichelt can be found here, Mouser partlist for the US: see SmashTV's Website, if you have a orderlist for a distributor on your country, feel free publish it on this page!

Soldering Guide

Here are some photos made with the first protype. Note that the final layout "mbhp_usb_v1" looks different. Comments will be added as soon as I've soldered the PCB from Mike.

Installation Guide

Not written yet. However, it's fairly easy: connect your Windows PC with the USB module, thereafter you will be asked for the EZ-USB driver which can be found in the mbhp_usb_v1_2 archive. After this driver has been installed, you will be able to upload the firmware with the EZ-USB control panel. You are also able to burn the firmware into the 24LC64 EEPROM. By doing this, the module will start w/o the EZ-USB driver and on other operating systems.

Performance

The performance is no issue ;-) See also the Benchmark Results

Credits

A big thank-you goes to SmashTV who gave me a lot of usefull design tips and created the PCB layout of the USB module - he has also made the two prototype boards for me! :-)



Last update: 2024-05-08

Copyright © 1998-2023, Thorsten Klose. All rights reserved.