Go Down

Topic: [RESOLVED] Issues with USBMIDI, Arduino Pro Micro and Program Change (Read 793 times) previous topic - next topic

zlot

[EDIT] Issue is resolved, see last post.

Hello world, 1st post here :)

I'm currently having issues while creating an open-source patch selector for a Zoom MS-70CDR guitar pedal (with accepts MIDI commands thru its USB port), based on an Arduino Pro Micro board (SparkFun).
The goal is to have the Arduino send Program Change (PC) commands by using this library.

I've been stuck for several days : the Zoom MS-70 does not respond to any of the Arduino's PC commands, however I've tried debugging other configurations with those results:

- Arduino connected to macOS machine thru USB. The MIDI Monitor app receives the PC commands without any issues, so the Arduino does send the right commands to my macOS machine.

- Zoom connected to macOS machine thru USB. I use the sendmidi CLI to send PC commands without issues, and the Zoom devices responds correctly (the MIDI Monitor app also sees the commands with the exact same hex bytes that are sent by the Arduino). Weird thing: if I send the program change as raw bytes (ie. '0xc0 0x02') but without having done a 'program change' (ie. 'pc 2') before, that will not work. Sending raw bytes after a 'program change' command will work.

- Zoom connected to macOS machine thru USB. I use the zoom-ms-utility web app to send PC commands without issues, and the Zoom devices responds correctly (the MIDI Monitor app also sees the commands with the exact same hex bytes that are sent by the Arduino).

So... it's weird. Arduino sends the right commands to the macbook, and the Zoom reacts correctly to the commands sent by the macbook. But the Zoom does not react to the same commands, when sent by the Arduino :(


The MIDI code used in my project (source here) is:

Code: [Select]
midiEventPacket_t pak = {0x0c, 0xc0 | 0, _currentPatchNumber, 0x00};
MidiUSB.sendMIDI(pak);
MidiUSB.flush();


Regarding the wiring between the Arduino (microUSB) and the Zoom (miniUSB): I'm using a modified USB cable, since there's no Vcc output from the Arduino's microUSB port (when I'm powering it thru its Vcc *pin*). So the wiring between the devices looks like:
- Arduino ground -> Zoom ground (miniUSB)
- Arduino Vcc -> Zoom Vcc (miniUSB)
- Arduino microUSB D+ -> Zoom D+ (miniUSB)
- Arduino microUSB D- -> Zoom D- (miniUSB)

Any help would be greatly appreciated, thanks :)

PieterP

USB has two roles, host and device. Both the Arduino and the Zoom are USB devices, you cannot connect them together, you can only connect a device to a host, not to another device.

You'll need a microcontroller that can act as a host, such as a Teensy, or use a USB host shield.

Pieter

zlot

USB has two roles, host and device. Both the Arduino and the Zoom are USB devices, you cannot connect them together, you can only connect a device to a host, not to another device.

You'll need a microcontroller that can act as a host, such as a Teensy, or use a USB host shield.

Pieter
Hi Pieter, and thanks for your reply.
I've been thinking about this possibility over the last few days, so that's bad news for me (but I least I now know what the issue is :)
So thank you again !

zlot

This issue has been resolved by using a USB Host Shield, as suggested by Pieter. Kudos to you !
I've cleaned up the code, which is now available here.

Go Up