PU-1: Let’s do MIDI

After days spent trying to find reliable ways to get Midi data from the pedal board to the computer,  and more days trying to get data from the computer to the pedal board, the proverbial shovel finally hit me square in the face. This is what happened:

The PU-1 is using an Arduino to process signals from its pedals and switches. Since I wanted to send data to the computer for more interaction, I hacked a USB-Midi dongle to receive Midi data from the Arduino’s TX (transmit) pin. It worked quite well, but would be susceptible to the intermittent bug, where the communication would seem to be out of phase and it would only send invalid Midi data.

Then, it was time to receive Midi data from the computer. The goal here is to allow the computer to control, live, the equipment linked to the pedal board. The general idea was to get Midi commands from the USB-Midi dongle. The problem I had (many days), was to design a system that would receive the Midi signal and use an opto-isolator to follow the midi.org recommendations. Right from the get-go, I erred by forgetting to use the opto-isolator. I then decided to use the Midi  breakout board that I have, with an unhacked USB-Midi dongle. It worked perfectly! So I figured my hacked dongle was broken.

The whole idea is to send digital data from the Arduino to the USB port of the computer in such a way that the computer receives Midi data. The other way around, I want to send midi data to a USB port and let the Arduino read it. Using the dongle, I have to add a pile of electronics to the (apparently) simple data path.  So, I took a look at the USB-Midi dongle again: Apart from the opto-isolator and a bunch of capacitor, resistors and one or two transistors/logic inverters, the only important piece of hardware there is a chip (IC). The IC is an MFM0860. According to one manufacturer, this chip will (their words, not mine…):

Key Specifications/Special Features:

  • Features:
  • 1, full-speed USB device interface, compatible with USB20. Norms. External components, only crystals and capacitors.
  • 2, providing 16 Midi input channels and 16 output channels Midi.
  • 3, in line with the relevant specifications, the computer terminal without having to install drivers windows2000/XP below can be used directly.
  • 4, input / output in line with TTL level, can be directly connected to Microcontroller, support plus optical coupling for transmission.
  • 5, using lead-free SSOP-20 package, ROHS.
  • 6, supports all types of organ market

So, this is when the shovel hit. Beside the fact that it “supports all types of organ”(?!), the inputs and outputs are TTL. Mmmmhh. What if I could connect to the “TTL”before the signal had to go through the “midi” part of the dongle?

At risk here was a perfectly good Arduino and a USB-Midi dongle. The Arduino is extremely resistant to electrical abuse. It’s made that way. I wasn’t so certain about the dongle. But I paid $6 for it and I figured… what the hell, let’s do it for science! Besides, let’s think about the connections: the dongle is connected to the computer using USB. It is safe to assume that it uses 5 volts, and the IC is 5 volts too, since I could not find anything that looked like a voltage divider. Because it’s TTL compatible, it is doubly safe to assume it works on 5 volts internally. The dongle is also connected to the Arduino. In fact, I use the dongle to power the Arduino, which gets its 5 volts from the USB power bypass I incorporated in the dongle.

I started with a simple Arduino sketch that sends a midi command through its TX pin (pin 2) when I press a button. I then started to touch the dongle at different points with a wire linked to the TX pin. I started from the “IN” connector inward. At some point, the dongle started transmitting data to the computer. Midi data. Yeah!

I then used a small program on the computer to send Midi data to that USB port. I started touching different points on the “OUT” side of the dongle with a cable connected to the RX pin of the Arduino. I found several points sending nicely formatted Midi commands. Yeah!

All I needed was to solder short jumpers to the pins of the Arduino. As an added benefit, the Midi INPUT and OUTPUT of the dongle are still operational and can (will) be used to connect to standard midi equipment.

Here’s a closeup of the finished modification:

By the way, here’s the schematic for this dongle (or a very similar one)(Thanks Gerry!):

and the whole datasheet (in Chinese): MFM0860 USB MIDI

This entry was posted in Arduino, Pedal board and tagged , . Bookmark the permalink.

9 Responses to PU-1: Let’s do MIDI

  1. Andy says:

    Hi,

    Would it be possible to mail me the datasheet for the mfm0860 ? I can’t find it by using Google.

    Thanks

    • rt says:

      Unfortunately, i don’t have the datasheet for this IC. The only one I found was in Chinese…
      I kind of “reversed-engineered” the USB-Midi dongle that I had on hand (read: trial and error). I have been trying to contact a distributor to get some samples, to test integration in some of my circuits. If I ever get the part, I will publish the information here. In the mean time, should you be able to get the datasheet, I would really appreciate the sharing.

  2. Rodolfo says:

    Hello

    I am looking for MFM860 ic datasheet too. Does anyone find out it ?
    Thank you for your time.

    • rt says:

      Sorry Rodolfo, no luck so far.

      • Rodolfo says:

        I see one of those ics inside a roll up drum, so I guess it has some kinf of programmable features.

    • none says:

      i’ve contact many sellers in china, and they dont seem to have the datasheet as well 🙁

      • rt says:

        One Chinese reseller told me that this is an old part. Some resellers have it, without the datasheet, from $0.76US, in large quantities. I won’t go for it without a datasheet, of course. Keep in mind that we can buy USB-MIDI dongles for $5US on EBay! So I just end up hacking them directly into my projects now!

  3. NinthLamp says:

    Hi

    Using this web page a as starter ( thanks ) I too obtained a couple of the $5 ebay MIDI dongles and also a few samples of the MFM0860 for my own project.
    The chinese supplier was aslo kind enough to send me a data sheet.
    If anyone would like a copy, just email me at:
    clayconic
    at
    tiscali
    dot
    co
    dot
    uk
    and I’ll happily send a copy. It’s not great but it does have a scmeatic of an application circuit which is better than nothing.
    Cheers
    NinthLamp

  4. NinthLamp says:

    I have a suspicion that the MFM0850 may just be a re-packaged Microchip 18F14K50.
    Please see this link on ‘Hack-a-day’ for some background info.
    http://hackaday.com/2011/01/18/mcp2200-usb-to-serial-chip-hacked-to-do-your-bidding/

    I’m going to try and connect my PIC programmer to the MFM0860 to see if it indeed turns out to be a Microchip device.

    Ninthlamp

Leave a Reply

Your email address will not be published. Required fields are marked *