I've got a nice little project using a Mega2560 where MIDI messages are sent to a couple of HC-O6 Serial Bluetooth modules by some instruments I'm making, picked up on Serial1 and Serial2, the messages are then pumped through to a MIDI connector using Serial3.
A USB MIDI cable is then connected the the MIDI connector 'run by' Serial3. (I'm writing the data out myself using Serial3.write, not using a wrapper library.)
It works perfectly if the Arduino is drawing power from the PC that the USB MIDI cable is also connected to, but when I use an external power source it doesn't. Flashing lights and things tell me that the sketch is still running, and I can switch to USB power while it's running and it'll work quite happily again.
Curiously, if I connect the GND on the Arduino to USB GND, while the Arduino is on external power, it's happy again.
I'm not attempting to pull power from the MIDI.
I've continuity checked the GND and other lines to the MIDI connector - they're OK.
As documented on many sites for this MIDI/Arduino connecting technique there's a 220 ohm resistor between pin 5 (Serial3 TX) and pin 4 (VCC) of the MIDI connector. Pin 2 is connected to GND.
Has anyone else experienced this and overcome it somehow please? I need to have the Arduino powered by a battery pack.
Thanks in advance.