I'm trying to read MIDI notes using an ATtiny85 via SoftwareSerial; so far, I've got no success at all.
- The ATtiny is using the internal clock, 8Mhz, 5V.
- The MIDI keyboard sends clean note on/off messages (tested with a MIDI monitor).
- I've tried several test programs, particularly Nick Gammon's, as described here.
- I've followed Nick's schematics to build the connector, and I can confirm his program works with an Arduino, but not with the ATtiny.
- I calibrated the Tiny with OSCCAL - still no luck.
- As far as I can tell,
midiSerial.available()
is always 0, in every program I've tried. - SoftwareSerial works fine for the purpose of MIDI out.
That's as far as I've got. I'd appreciate any pointers, especially if anyone else could try Nick's code and see if it works.
EDIT
There was an issue with my local version of SoftwareSerial. I had commented out code so that I could use pin change interrupts in my MIDI out program, but those interrupts are essential for MIDI input. Once I uncommented the code, all the programs I tested worked, so it is indeed possible to receive MIDI using an ATtiny.
That said, I've tried four keyboards as inputs and only one has worked so far, a Korg 01/W proX. The same happens when I load the MIDI code directly in the Arduino, so based on the answers below I will try a different optocoupler, and post my results here for the sake of improving on the answer.
Here's the schematics I was talking about:
SoftwareSerial
. – slash-dev Nov 3 '17 at 13:22