The three input ports are connected through photocouplers. This is a Midi specification requirement.
The three output ports are just connected through a resistor.
Since, input works and output doesn't, it makes sens to think the issue may be linked to powering isolation...
Here is a basic schema (inspired by Tom Scarff's, who does midi breakout boards for Arduino)
I have connected an oscilloscope on pins 4 & 5 of the midi out ports.
Actually i see midi messages as square spikes (histogram like) in both case (usb to PC / usb to wall socket)
So the program (and Andy's library) are out of cause.
There are two differences i noted on the oscillosccope:
The "no signal" voltage is different, usb to PC: 1.5v, usb to wall: 2.v
This difference could be enough to disturb any device connected through midi ? I guess it may. Some voltage comparator could decide that below 1.8v is 'low', above 3.2v is 'high' but wouldn't know how to interpret 2v ?
I have measued the VU on the mbed, it is also a little different: 4.9v when connected to PC, 5.1v on wall adaptor.
The AC is very noisy when connected to wall
I can see square waveforms of about 0.2v range at several kilohertz frequencies. It looks like the power line is conveying other communication signals... Maybe i should try to insert some kind of filtering. I have made myself an usb filter with a big 3000µF capacitor and an inductor salvaged from an ATX power module(*). I will try to insert it between the adapter and the mbed this evening. More to come.
(*) I made this some weeks ago to solve analog input noise on the mbed. Values on the analog input where jumping all around the spectrum until i managed to filter the usb noise... Compared to the Arduino, the mbed is very sensible to external noises. There is some room for improvement there ;)
Todays' epilogue
I know i could have used a standard power adaptor connected to vin. But:
- i need the usb connector on my box to be able to download a new filter definition text file.
- the box, wich is a size of a cigarette box, is already stuffed (the six midi connectors take up 80% of the space). The meb and my midi shield are snugged into the 9V battery compartment. There is no much space left to add a power socket... (i will try to take a real picture of it).
Hello,
Problem overview
I have a finished mbed project working fine as long as the USB is connected to a PC.
This project uses the 3 UARTs on p9/p10, p13/p14 & p28/p27 as Midi ports; 3 ins & 3 outs.
When the mbed is powered through an USB adapter, the input serials seems to work (program blinks leds 1 to 3 on each byte input on ports 1 to 3 ). But nothing is output.
Project description
In short, the box is a kind of midi merger/router/convertor. It can recognize certain Midi messages and then drop, transform messages types or parameters ranges and route to any outputs. The actual processing is defined in a separate text file easily editable and just copied to the mbed.
Program description
What the program does in short:
Here are the MODSERIAL method i call around the program:
Nothing fancy, no interupt.
Final thoughts
I first suspected a faulty adapter and i have tried two different power adaptors (500ma and 1A) and an usb hub (1A) without success. I don't think its a power problem, the 5V required by the Midi ports is not drawing amps.
I now suspect some serial initializatin might fail when the USB tx and rx arn't connected and that would have some side effects in the other UARTs initialization... But it is just a wild guess from a novice in electronics (albeit professional developper).
Is there any recommendation for using mbed serial ports while using an independant power supply connected to its usb port ?
Thank you for your time and your suggestions.
Bernard