PSIM Midi code
2004-04-09 by djbrow54
I wanted to have MIDI functionality in a MOTM format so I had a Schaeffer panel made. I also added the four CV potentiometers and decided to add room for the Speakjet as well. I'm still waiting for the panel but I've made a temporary to hold the PCB and MIDI connectors. I've uploaded a copy of the Schaeffer file and a jpg image at: http://home.earthlink.net/~dabr/synths/PSIM I've got some basic MIDI in and out code running. I decided to start with polled I/O until I got everything working and then migrate the code to interrupts. Anyone else made progress with peek and poke of the registers? I've found all sorts of funny stuff. For example a) Even though the status registers are bytes, I have to handle them as words. If I do bytes, setting a byte variable clobbers the next variable. The manual doesn't specify but it seems like peek and poke ignore the variable size and just assume words. b) None of the variable modifiers seem to work. If I try to test a bit using .bit6 then the result is 32 bits and mostly '1's. This doesn't make any sense. The only way I could get it to work was to 'and' the status word with constant and test that. Debug statements seem to take enough time that I got over run errors on input. The only way I could validate proper input was to transmit it to another MIDI device and scope the waveforms. Right now I have a simple input filter that strips away the 'FE' status bytes. My initial try of interrupts resulted in having to upgrade to version 7.2 to even get it to compile. A quick first pass at interrupts indicated that reading the data from the RDR didn't reset the interrupt so I was immediately interrupted again. I'll be working on this next. Dave