MIDI out with the Parallax/Ubicom SX-28
Simple program to send MIDI messages w/the SX family @ 50 MHz

Without further adieu, here's the code.  Yes, I know that's all you're here for... you could at least have bought me flowers or gotten me drunk.  Pigs.

Midi with a ubicon SX @50MHz.

You may have to modify the formatting some, and you'll have to save it as a .src file.   All that this program does is send middle C at maximum volume on channel one, then it loops indefinitely doing nothing, which is a pretty accurate metaphor for my life.

As you'll probably notice, I'm using the RTCC counter to time the MIDI bit length; this is for MIDI output buffering.  The way that I'd implement it is to make a table (buffer) where midi notes are stored, and send MIDI until the buffer is empty.  Using RTCC as the timer will allow me to re-check whatever midi input (buttons, ADCs, etc.) might have changed while sending bits, and re-load that into the buffer; care must me taken, however, that the data check doesn't take longer than the RTCC countup to 0x63 (w/the prescaling set by the !OPTION register... it's actually an eternity by SX time).  This should make it easy to check inputs while sending data, thereby assuring no data is lost.

 I've never actually needed to use the RTCC mid-bit check, as previous experiments with the forementioned code were satisfactory- no dropped data that I could detect.   

If you use this in a project I'd like to hear about it!  asmidius{at}gmail(dot)com