Why does my MCU work better when powered to Vcc and PA1=D2 instead of Vcc and GND?

I'm making a MIDI processor, with its power coming ... directly from the MIDI signal itself, as done by the author of this page (see "Powered by MIDI" paragraph): it works well with a 100µF cap. I have assembled several units with no problem at all, perfectly working.

I'm using a ATtiny4313 and usually it's wired this way:

• VCC (pin 20) => + of the 100 µF cap
• GND (pin 10) => GND of MIDI sockets
• RX/D0 (pin 2) => MIDI IN (with the usual MIDI IN schematics involving an optocoupler and resistors)
• TX/D1 (pin 3) => MIDI OUT (with the usual MIDI OUT schematics too)

However on new units I'm currently assembling I noticed that it is not working very well (sometimes the MIDI signal is ok, sometimes it's not ok, and some notes are stuck, some are dropped).

Then, instead of the previous connection, I tried this way:

• VCC (pin 20) => + of the 100 µF cap
• PA1/D2 (pin 4) => GND of MIDI sockets
• RX/D0 (pin 2) => MIDI IN (with the usual MIDI IN schematics involving an optocoupler and resistors)
• TX/D1 (pin 3) => MIDI OUT (with the usual MIDI OUT schematics too)
• and nothing connected to GND of the ATtiny!

And miracuously, everything works perfectly, the MIDI signal is perfect, no lost or stuck note! I tried it during a long time and it's perfect like this.

Question: What could be the reason of this thing: the MCU works better when powered on VCC (pin 20) and PA1/D2 (pin 4), instead of VCC and GND?

PS: In my code, I did nothing with pin #4, no digitalWrite, no pinMode. The only thing present in my code relative to a pin is pinMode(7, INPUT_PULLUP);, because I might add a push button later.

PS2: I thought it would be a oscillator problem with the internal oscillator a little bit too much "off" and that adding a crystal would solve it, but then why would doing PA1/D2 (pin 4) ==> GND solve everything perfectly well, even without a crystal?

PS3: I read a few parts of the ATtiny 4313 datasheet without any clue about this mysterious situation, i.e. power it in an uncommon way and it works 100%!

• Please draw a schematic. Powering microcontrollers via data pins is very suspicious. Also if you are not aware MIDI devices are not meant to be powered from MIDI, that is not how a MIDI IN device should work according to MIDI examples, it only works if the MIDI out device is also made according to MIDI examples. So if you make a weird device, and connect it to device that is also weird, it just does not have to work.. – Justme Dec 5 '19 at 21:09
• You are decoupling with a 100µF cap? Electrolytic? Is there some smaller ceramic somewhere? – dim lost faith in SE Dec 5 '19 at 21:10
• @dim Just an electrolytic 100µF cap, no smaller ceramic. I might try to add a smaller ceramic, but again this wouldn't explain it works perfectly well when PA1/D2 (pin 4) is connected to GND instead of pin 10. What a mystery! – Basj Dec 5 '19 at 21:12
• @Justme Many very well-known-in-every-studio and perfectly-working MIDI processors are powered via MIDI only, see for example this one from a good brand: thomann.de/gb/midi_solutions_merger_v2.htm – Basj Dec 5 '19 at 21:14
• @Basj reviews are product marketing garbage, of course the ones with "does not work for me" reviews get deleted or not submitted anyway. The cheap chinese USB to MIDI interfaces that have no optoisolator tend to work quite poorly. – Justme Dec 5 '19 at 21:24