MIDI with Lumps
The Dark force of dance
batzman at all-electric.com
Sat Mar 27 03:32:11 CET 1999
Y-ellow Y'all.
Out of interest, it would seem that the problem with doing MIDI isn't down
to the Opto after all. It must be the spaghetti I refer to lovingly as
source code. True, the original pull up was way too high but it's got to be
down to my code now.
I hooked up a MIDI out port. Surprisingly easy to do. Because the ATMEL
chips can drive LEDs directly, all I had to do is hook a couple of 220 ohm
resistors and a socket to the TXD port. By sending out exactly what I put
into it, and monitoring it with MIDI monitor software on another computer,
I get exactly the numbers I should. Which pretty much proves that.
It's not the clock speed
It's not the timer set wrong
and!
It's not the Opto.
So that only leaves my crappy software. I'll have to re-write it. You see I
was trying to be smart. What I figured was that instead of dealing with
each byte as they came in, I could stuff them all in a buffer, wait till
there was 3 or more bytes in the buffer and then go hunting for a #B0H.
Finding a B0 would then mean that there would be 2 more bytes containing
data and they could all be processed at the same time. Well that's the
theory. And for that matter, on the simulator it works just fine. But
there's only so much you can simulate. I don't know why the software
doesn't work but when outputting data at certain points within the routine
I get less than predictable results. At one stage I get the entire 3 byte
MIDI message spat back at me where there should only be a single #B0h.
I thought this approach would be the most efficient use of CPU cycles. Even
though the processor is running at twice the speed of the original INTEL
part, it has to spit out data from a software generated serial port to
control the rest of the system. So I was hoping to save as many machine
cycles as possible. I failed. I can't predict what is happening in there
using the simulator and I can't see what's happening in there in the
real-world so it's back to the drawing board on this one.
But on the bright side. I know I can talk the chips and I know I am set up
to receive and send MIDI. Now all I have to know is that I can write some
half decent code.
And if that's not bad enough, I've still go the I2C (Serial EEPROM)and
front panel interfaces to write yet. :(
Thanks everyone, for all the help and encouragement so far.
Be absolutely Icebox.
_ __ _
| "_ \ | | batzman at all-electric.com / aek at all-electric.com
| |_)/ __ _| |_ ____ ALL ELECTRIC KITCHEN
| _ \ / _` | __|___ | The Elementary Urban sanity CD
| |_) | (_| | |_ / / out now on Transmission Communications
|_,__/ \__,_|\__|/ /
/ ,__ http://www.all-electric.com
Goodfortune |_____|
More information about the Synth-diy
mailing list