About 5 years ago I built a Pi midi interface around a PIC microcontroller, using I2C to communicate with a user-space Python program on the Pi, running Wheezy. This was working fine until a month or two ago.
Last Summer I built a Mk II version using a PIC with more pins to allow me to include functionality for an intelligent Pi power button. I also added a socket for a DS1307 RTC on the same I2C bus.
I can still play midi files, but if I try to record a performance the midi packets as received by the Python program are scrambled after the first few.
I get exactly the same with 2 different midi instruments, with both the Mk I and Mk II midi interfaces and with several different Raspberry Pis, and I've tried a privious version of the Python program. Unfortunately I'm not sure exactly when it broke or the sequence of things I've tried otherwise I might have the answer.
I did have a short to ground in the midi-in plug on the MK II. Midi is a robust current source so unlikely I could have blown the midi out port on both instruments. But on one of the instruments I set local echo off and plugged in a midi loopback cable which worked, so eliminating that as a possibility.
But I'm wondering if the RTC is to blame, maybe not playing well with my Python program using the same I2C bus, as getting the RTC to work under Wheezy was probably the last thing I did. It doesn't seem likely as I still get the fault with a Wheezy system that has never had an RTC configured and hasn't actually been updated for a long time, as well as with a Jessie system.
Any constructive ideas welcome.