PDA

View Full Version : Midi, Interrupts and Pic better than SX28?



Lajko
- 26th September 2008, 06:18
Being a long time programmer with assembler an other languages for Z80, 68705, SX and others, I am at a point of deciding on a platform for a new project.

The project is midi keyboard scanners and pipe magnet drivers for pipe organs.
Using software in a processor for a serial out is OK as you can scan a keyboard then send the midi out and timing for scanning is not important(just do it as fast as possible). It doesn't matter if the processor is doing serial out in software. Input, being asynchronous is a bigger problem. You can't waste processor time waiting for input and then risking missing a byte while the processor is working on driving pipe magnet drivers or doing timing for reitterating the magnets.

Software serial input is too much of a burden. With Z80's for midi input I used an 8251 serial chip that did all the work and generated an interrupt.

As one deciding if I should invest and switch to the PIC processor (as opposed to SX-28 or Z80) for this project on the receiving end, is the PIC with a uart a good choice? Does it easily implement interrupts from the serial input? (Pic Basic Pro?) I've searched the forums and haven't seen much except for post from a few years ago.

If the PIC can do serial input and generate an interrupt on a received character then that is what would work for me. My other choice is to use an SX-28 as the main cpu and use an 8251 or program another SX-28 programmed only for serial input to generate an interrupt to the main SX-28. It just doesn't make sense to burden the main processor with doing software loops for serial input when it has so many other things it needs to do.

Please understand I am a "new-bie" to the PIC deciding if I should use the PIC for this.

Suggestions and advice will be appreciated.

Price is not really an issue, as an SX or two and a PIC are about the same. A buck or two difference doesn't matter. Development systems neither, as about $700 for all the PIC stuff doesn't matter even though I have all the SX development tools. Speed in completing the project is most important. I have a couple organs that need upgrades to play orchestra bells by Christmas.

Thanks in advance for ant advice or links to sample code for midi and the PIC with serial interrupts.

Bruce
- 26th September 2008, 06:28
MeLabs has several examples of USART interrupts here: http://www.melabs.com/resources/samples.htm

Try the search utility here. There should be several threads on MIDI.

Lajko
- 27th September 2008, 00:26
Thank you. The examples there for the X1 do pretty much what is needed. I can replace the main loop with my own code to drive the organ magnets. So I guess I'll go and order the $699 bundle and get started.