This is gonna be a short article of a method I’m using to debug my Arduino UNO program that implements MIDI-in serially (digital pin 0 “RX”).
If you’re reading this you probably had the same problem I had: You want to transfer debug info trough USB at the same time you receive MIDI messages and you find out the Serial Monitor in Arduino software doesn’t support MIDI baud rates (32150 bauds). I read somewhere that it has to do with Java not allowing this speed.
The easiest solution would be to try all your code in a more complete Arduino, like the Mega which has more than one serial port, and use different baud rates for debug and MIDI. But in case you need for some reason to work with a UNO, here’s my solution.
I use the PuTTY terminal software. Configure it with the COM serial port you’re using to program your Arduino, and the following options, like this:
The “Implicit CR for every LF” option basically means it will do a carriage return even if the ‘\r’ character is not present in a string, which oftenly is not and just ‘\n’ suffices. You should save the session for convenience, and double click on it when you open PuTTY to jump right to the terminal and connect to the Arduino.
This is the wiring of the circuit. Notice the push button. This is a normally closed push button (push to open circuit). You must break the connection to the opto-isolator when you’re programming your device, or the MIDI interface will “win”, sort of speak, over the USB-to-Serial chip that is trying to upload the new program, because it uses Pin 0 and 1 (RX and TX) for that. It’ll win because it’s a 470Ω resistor to +5V versus a 1kΩ (internal) to the USB interface.
I made a simple program to test it (very ugly code), you can download the Arduino sources here:
You can see the screenshot to the right on how it will look on PuTTY.
I’ve used an Akai MPD-16 as MIDI controller.
- Hold the normally closed push button
- Upload with Arduino software
- Release the push button
- Open PuTTY
- Load the previously configured session by double clicking on it
- Test and read your debug stuff
- Fix something in the code
- Close PuTTY (so that Arduino can use the serial port)
- Go to step 1
I hope you find this useful!