PICs and midi timing

CasioRZ1 at aol.com CasioRZ1 at aol.com
Mon Jun 26 18:55:31 CEST 2000


Hello all,

I tried posting this yesterday but haven't seen it show up.  My apologies if 
it's a duplicate post...

I'm building a digital scanning keyboard of sorts (my first PIC project!), 
and have the keyboard scanning bit all coded up and going.  Unfortunately, I 
can't seem to make it "talk" over midi.  I'd be really grateful for any 
wisdom that you all would be so kind as to impart :-)  

I'm using a Scenix SX mc at 40 Mhz.  I assigned the prescaler to the RTCC at 
a 1/128 ratio, which should divide the clock down as far as the RTCC is 
concerned to 312500<?>

MIDI goes at 31.25k (right?), so I figured that if I changed the state of the 
output pin every 10 RTCC counts I could send MIDI.  I measured the pin on/off 
states to be 32us long per data bit, which is (I think) what they should be? 

Am I going about this the wrong way?  Will this method even work?  Did I 
screw up the math somewhere?  If you know, please let me know... I've been 
going at this for a few days now and am getting kinda frustrated.  If it 
would be helpful to see my code, lemme know and I'll e-mail it to you or post 
it somwhere.  I realize that there is probably code for this somewhere on the 
web already, but I'd kinda like to work through it rather (with your kinda 
assistance, of course) than just copy it :-)

TIA!

Derek



More information about the Synth-diy mailing list