DaveC3, your code has been a great help so far.
Unfortunately, I didn't manage to get it working.
I suppose there is something wrong with my fuse settings.
Do you mind to give me your config settings?
(I stripped most of your code in the body, but the PIC isn't recognised as a MIDI device.)
Bookmarks