I am having trouble getting a Raspberry Pi and a Teensy 3.2 to talk MIDI to each other. Well actually it works fine when I connect the raspberry pi to Serial1 or Serial2 via a full midi circuit (optocoupler on both Tx and Rx in both directions). But Serial3 seems to give me trouble. This port is connected directly as shown in the image above) I am losing data along the way. I should be receiving messages of 153 bytes, but half the time they are shorter.
Because I have ready made PCB's for my project, it is difficult to swap uart ports. I am trying to determine where I should be looking. Because most solutions require messing up my board.
1) Is Serial3 (UART) different from serial1 and serial2 when it comes to sending midi data? Could it be that serial 3 is suffering from data loss, because the loop time is getting too long?
2) Because both the Teensy 3.2 and the RPi work at 3.3 volts, I have the Tx en Rx of both units connected directly. Is this OK or do I need some sort of buffer in between?
Any suggestions are welcome.