1
\$\begingroup\$

I need to interface a USB MIDI keyboard to a microcontroller host. The microcontroller will be receiving MIDI commands from the USB and occasionally sending MIDI commands.

I'm wondering if there are any implementations on popular microcontrollers like STM32, PIC24 / 32, FTDI etc. that already exist.

I found a company called Hobbytronics that used to make such a board based on the PIC24FJ64GB002,

http://www.hobbytronics.co.uk/usb-host-board-v2

so it seems possible to do it, however I can't find additional info regarding the USB MIDI Host stack on Microchip's website.

I won't mind going for a FTDI midi to serial chip if anything like that exists.

\$\endgroup\$
4
  • \$\begingroup\$ A USB host needs hardware support, so you need a microcontroller that is designed with USB host (or OTG) support. And USB is quite complex, so you're going to use the USB libraries that come with the microcontroller. \$\endgroup\$
    – CL.
    Commented Jan 4, 2020 at 9:22
  • \$\begingroup\$ @CL. the PIC24FJ64GB002 has USB host support, and I'm sure there would be many such MCU's in other lineups like ST, NXP etc. \$\endgroup\$ Commented Jan 4, 2020 at 9:37
  • 1
    \$\begingroup\$ github.com/PaulStoffregen/USBHost_t36 \$\endgroup\$ Commented Jan 4, 2020 at 18:20
  • \$\begingroup\$ @BruceAbbott amazing link, this is a awesome alternative to the PIC24 \$\endgroup\$ Commented Jan 5, 2020 at 11:21

2 Answers 2

1
\$\begingroup\$

I'd recommend taking a look at Vinculum chip by FTDI. It is specifically designed as external host hardware running USB stack so that your MCU doesn't have to do it.

Another, somewhat harder to use, solution is SL811HS from Cypress.

Both are available on convenient breakout boards, like this one for Vinculum or this for Cypress.

I can't find additional info regarding the USB MIDI Host stack on Microchip's website.

What info are you looking for? If you buy that HobbyTronic board all you have to do is download and install their free MIDI host software. Then the board will convert between USB MIDI data and Serial TTL packets, which you can read/write using any MCU of your choice.

UPDATE:

Just out of curiosity, why don't you use some of the off shelf converters with USB host functionality, like Cerebel, Kenton or iConnectMIDI4+? They all can convert USB MIDI to normal serial MIDI, easily connectable to any MCU. Admittedly, they could be pricey, but if you count time you need to make hardware, write software and cost of parts, they quickly begin to look rather on a cheap side.

\$\endgroup\$
6
  • \$\begingroup\$ These seem to be good, however how would these work as a USB MIDI Host, Vinculum seems to have a embedded MCU while the Cypress doesn't. Would extra code be need to be written on them to get the USB MIDI part working? \$\endgroup\$ Commented Jan 4, 2020 at 10:17
  • \$\begingroup\$ Regarding you comment related to Hobbytronic, they provide only "hex" file for their board. I also see that they have discontinued that board, it won't be hard to make it and I was considering making a custom board with the PIC24FJ... however instead of starting the source code from scratch I was hoping that Microchip would have USB MIDI Host related stack. \$\endgroup\$ Commented Jan 4, 2020 at 10:20
  • 1
    \$\begingroup\$ I don't see why Microchip would bother writing such specific thing as USB MIDI host. Don't forget, the "MIDI" part is just a layer on top of actual USB host. The host framework you can find. Writing MIDI device class support is your responsibility, whether you use MCU with built-in USB host or external host such as Vinculum. The HobbyTronic has solved this for you, by providing pre-built firmware. That "hex" file IS the only thing you need, I fail to see a problem here \$\endgroup\$
    – Maple
    Commented Jan 4, 2020 at 10:29
  • \$\begingroup\$ Ok, I guess you are right! Marking this accepted. \$\endgroup\$ Commented Jan 4, 2020 at 10:31
  • \$\begingroup\$ I've updated an answer with a question of my own \$\endgroup\$
    – Maple
    Commented Jan 4, 2020 at 11:31
0
\$\begingroup\$

Another option for the record: MicroChip/Atmel ATSAMD21E18, as used in the Adafruit Trinket M0 and others. Using this project - gdsports/midiuartusbh: MIDI DIN to MIDI USB Host Converter - but substituting a 3.5 mm stereo jack for a 5-pin MIDI port, I've been able to connect an Akai LPK25 (USB MIDI only) to a Korg Nu:Tekt NTS-1 (3.5 mm MIDI) synth.

As implemented, it won't talk to every USB MIDI instrument, as apparently some of them use an internal hub. This will confuse the simple USB host on the ATSAMD21E18.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.