Hi,
Im testing the Arduino for usage as MIDI OUT device, I have an "Arduino UNO" and "Arduino DUE". The "DUE" is the final target for this development (due to the better resution of A/D that shall be the input for the controll of the MIDI), however the "UNO" has been used for desperate testing.
The test setup is a MIDI cable (5PIN DIN soldered, middle pin connected to arduino.GND, no. 2 pin to arduino.TX (via 220Ohm resistor), no 4. pin to arduino.+5V (vi a 220Ohm as well) - just as here http://www.arduino.cc/en/Tutorial/Midi), these all running into a MIDI IN of a M-AUDIO MIDI2USB device, the PC running the MIDI Synth software (SynthFont).
When I run the simple (example) sketch (see code below) on UNO (middle pin to GND, no. 2 to 5V, no. 4 to arduino pin no. 1 TX), it works like a charm. It took me a while before I cleared some cold solders in my cables, but I finally got it and anxiously but successfully tested this also against my YAMAHA TYROS3 MIDI IN.
BUT, when the very same setup is just pinned to the DUE (5DIN middle -> due.GND, 5DIN no 2. via 220ohm to due.+5V; 5DIN no. 4 via 220Ohm to due.1 TX0) and the same code is used, the L+Tx LEDs on Arduino blink as expected, but the M-AUDIO device even does not signal the MIDI_IN activity (it has a special LED that blinks whenever the device receives data).
In computer, I can see not only the COM port activity (not that of the M-AUDIO, but of the Arduino), but also when using a better COM port monitor (HTerm), I see the MIDI data being correctly send, but the PINs connected to the MIDI2USB seem dead. Using an oscillosocope I can see no activity on the pins (in compare to what I see on the Arduino Uno TX pin).
What could I have overlooked?
Note: Just for the sake of completness - when the borad is being programmed, I pull the TX pin out during the upload, since because the TX0 is the very same port as being used for communication of the IDE, the MIDI2USB wents berserk and has to be reseted it it gets this communication as well.
/*
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/Midi
*/
void setup() {
Serial.begin(31250);
pinMode (13,OUTPUT);
}
void loop() {
for (int note = 0x1E; note < 0x5A; note ++) {
noteOn(0x90, note, 0x7F);
digitalWrite (13, LOW);
delay(100);
noteOn(0x90, note, 0x00);
digitalWrite (13, HIGH);
delay(100);
}
}
void noteOn(int cmd, int pitch, int velocity) {
Serial.write(cmd);
Serial.write(pitch);
Serial.write(velocity);
}

