I'm trying to program the SAM2695 and send it notes that are coming from an organ pedal using a keyboard scan modul PEDSCAN.
The module has a three pin outlet going to the classical DIN plug (2 - GND, 4 and 5 wired). When I connect this module to my MacbookPro I can monitor the codes that are coming out of the module using the PocketMIDI application. The codes coming out there are exclusively:
90 25 40
80 25 40
90 25 40
80 25 40
90 27 40
80 27 40
90 27 40
80 27 40
These come from two test buttons that are connected to the keyboard scanner and simulate the notes 37 and 39 (a D and an E), and they show a note on, note off action, with vv (velocity) constantly set to 40h. All fine.
Now I would like to pass these codes through an Arduino Nanos' SoftwareSerial Port and the codes I'm receiving are being garbled by something I cannot find out at the moment. As said, in the Midi Monitor PocketMIDI all is fine and correct.
As soon as I disconnect (I understand that connecting both, the adapter and my hardware could bend the signal to unwanted levels) and connect the following converter circuit, the trouble begins.
Often the Data bytes are garbled (40 becomes FF etc.). Is the optocoupler circuit wrong?