UNO + Olimex Midi Shield (Resolved)

Sorry, none from me. It looks like the problem is between systems and I don't have any experience with your other stuff.

question: just a simple sketch to use pinMode to turn on D1 and D7 (led on Olimex board) at the same time and off at the same time : yields strange result: the LEDs are never on at the same time.

shown in video here

Hard to tell if it is strange without seeing any code.

int pinS = 1;  //Serial out pin
int pinF = 7;  //Flag out pin
int pinU = 13;  //Flag out pin
 
void setup()
{
  pinMode(pinS, OUTPUT);
  pinMode(pinF, OUTPUT);
  pinMode(pinU, OUTPUT);
}
 
void loop()
{
  digitalWrite(pinS, HIGH);
  digitalWrite(pinF, HIGH);
  digitalWrite(pinU, HIGH);
  delay(2000);
  digitalWrite(pinS, LOW);
  digitalWrite(pinF, LOW);
  digitalWrite(pinU, LOW);
  delay(2000);
}

sorry, it's been a long week fighting with this thing.

Hold the phone, another generous member here messaged me, and it turns out my LED is a "blinking LED". So this isn't so strange after all.

update: new, correct type of led inserted into pins 4 & 5 = rapid fast blinks. All this seems to say data is being sent. This seems to indicate the issue is the MIDI/USB cable (Roland UM1)?

What if the mA range that is req'd for MIDI to work, isn't being reached? According to this

http://www.personal.kent.edu/~sbirch/Music_Production/MP-II/MIDI/midi_physical_layer.htm

It has to be 5mA to work. If I slow down the baud rate enough, would I be able to detect if it's hitting 5mA to 0mA?

And for those still reading this saga: check out oxmidi project. could be useful.

Olimex finally contacted me and they weren't much help unfortunately. They test these boards by connecting them to each other and sending MIDI back & forth. I don't believe they even test these on MIDI devices! grrr

You can try sending a stream of 0 bytes out the port to measure the current. 0 is defined as 5 mA according to the article.

does that mean that the 'rest-state' of MIDI should be 5mA?

Not sure what you mean by the 'rest state', but the '0' or 'off' signal is 5mA (which is not 'off' at all, but that is the way the hardware standard is defined), sort of inverse logic. I am sure there are good electrical/comms reasons to define it that way, but I don't know whatthey are.

On Olimex board, 7.3 mA on D1 & 5v supply:

4.5mA on MIDI OUT DIN pins 4 &5.

this is with my meter set on 2m. Doesn't that seem low? The running sketch is sending a midi note on and off.

note: I could very well be reading my meter incorrectly. I'm still learning

edit: I updated the readings after I realized the meter should be on 2m

The current on the LED pins will depend on the LED and the resistors you have put in the circuit, so you can calculate based on theory and see if it is close.

The current on D1 should be the MIDI serial interface.

D1 = 7.6mA (probes on D1 and 5v power supply)

The MIDI OUT DIN pins 4,5 = 4.5mA (is as high as it goes).

This is without the led inserted into the MIDI DIN. I guess my thought is that, according to what I've read, MIDI operates on 5mA to 0mA. The MIDI OUT spec only shows 220ohm resistors on pins 4,5 respectively. So where am I losing .5mA or how can I ramp up the mA? be gentle.

The current should drive an optocoupler (effectively a LED), so in my opinion the 0.5mA is not going to make a big difference to how the LED lights up in the coupler.

Have you checked that the opposite (ie, sending 0xff continuous) gives a current that is at least close to 0mA? That couls also be a problem as the LED would stay at lkeast partially lit.

One other thing that may be worth doing is cheking the specs on the Roland cable to see what is expected there. You may have done this already but there is not info on these posts.

The LED isn't hooked up to the MIDI OUT. And also, there's no octocupler on the MIDI out spec. I have the board set to send MIDI OUT, so its coming from the board, going through my MIDI/USB cable and into my pc.

There isn't really a lot of info on my MIDI/USB cable from Roland. I've used a USB analyzer app that monitors incoming data and nothing registers when I send data through the cable. The cable works fine with other MIDI devices though. BUT, if the cable needs the 5mA to register start bits, I'd say it's not getting it. I don't know if other midi devices absolutely need that 5mA to operate or not.

The LED isn't hooked up to the MIDI OUT

If it follows the standard your MIDI OUT is connected to an optocoupler on the MIDI IN side. There should be something in the middle of the cable you have that is MIDI to USB converter. So it is driving that optocoupler.

I just looked up your cable type and assume it is this one Roland - Global.

This cable has indicators on the cable to indicate IN and OUT traffic on the cable?

yes, that's the cable. I don't know what is inside the UM1 cable. I misunderstood what you wrote earlier. Yes, each MIDI IN should have an octocupler.

Tomorrow will be the last day I mess around with this. I'm going to test some simple 'send midi notes' with a real synth (not my pc). I done this before, but what the hell do I have to lose. There's got to be something very wrong with what I'm doing or else its the hardware I have is bad. There's plenty of examples of people doing a lot more with Arduino & MIDI.

Thursday, I will return the two boards for a refund. I may decide to go with a different arduino board. The UNO's limitation on serial ports wasn't something I considered when I purchased it. I wouldn't mind trying the Rugged Circuits MIDI shield. If it works, it will be a huge step forward!

Fair enough. It must be frustrating.

It is not hard to make your own if you have a soldering iron. I made one that works pretty well. If you are interested, go to the libraries in my footer, look at the midi library and in the main library header file is a reference to a site that has a good circuit that you can build as is or onto a shield.

Good luck.

I did an interesting experiment:

I ran this app, which lets you connect a serial port on your pc to the MIDI device.

https://code.google.com/p/oxmidi/

With a normal usb cable plugged into the UNO, I only get data to show up in the monitor when running code that uses serialwrite. When using the MIDI library, I get nothing. Also, even when I do get data in this monitor, the notes are really wrong. I dunno, could be the app.