alf45tar / PedalinoMini

Wireless and Bluetooth MIDI Foot Controller
GNU General Public License v3.0
479 stars 84 forks source link

DIN Legacy MIDI workaround #456

Open aFunkyBass opened 1 year ago

aFunkyBass commented 1 year ago

I'm writing this post to help anyone who could encounter problems getting the Legacy MIDI to work.

I've built my second Pedalinomini controller and I had some problems getting the MIDI DIN to work powering up the system with a 5V external adaptor. Powering the ESP32 via the USB cable Legacy MIDI was working. That puzzled me a lot!

After monitoring all the levels signal on the MIDI pins with an hoscilloscope, I've realized that the probem was the difference in voltage on the pins. On the schematics the connections are like so: MIDI out schematics

Now, the previous schematics is taken from the original MIDI specs which was based on 5v logic devices. Being the ESP a 3.3v unit, you have a signal of about 3.3v on pin 5 and a signal of around 5v on pin 4 (not considering the drop down introduced by the resitors). This difference is probably enough to steadily turn on the opto-isolator LED on the receiver, making the communication void. This didn't happen powering it up via the USB plug, because of the voltage drop down introduced by the ESP internal regulator, in fact I had a signal on pin 4 of about 4.5v.

I solved the problem converting the MIDI out to 3.3v logic using the following schematics taken from www.midi.org

Screen_Shot_2020-07-18_at_12 20 08_PM

Use the table to get the correct resistors value and feed pin 4 with 3.3v, and you should be good to go. :)