> > Hi PICsters! > > I'm new to the PICLIST, so bear with me... > I'm considering to build a MIDI (Musical Instrument Digital Interface) master > keyboard using a PIC 16F84 (or other re-programmable PIC device). I foresee > problems with the following issues: > > 1) I need to develop MIDI send code (which *should* be quite similar to a > serial interface, but is different on baud rate - some 33.1 kbps or so - and > probably on protocol). Quick rundown on MIDI: Physical: ioslated current loop. The MIDI OUT port drives an LED on the MIDI IN port. DataLink: 8 bits, no parity, 31250 BPS (because it's easily derivable from microprocessor data clocks 31250*16 = 500000 for example) Network: Packet based, up to 16 channels per link, includes note on, note off, pedal controller, and arbitrary data via SYSEX messages. > I already found some good MIDI links in the PICLIST, > but some of you might already have developed MPASM MIDI send code, or at least > can point me in the right direction? All you really need to implement is the Physical and DataLink, using all the normal MIDI stuff for the network. Physical MIDIOUT is nothing more than a PIC data pin tied to a low value resistor. I've used anywhere from 180 to 270 ohms with good success. Use standard serial I/O except tune the bit rate to 31250. MIDI runs fine on standard UARTS. > > 2) I need to scan about 100+ keys, which is going to be tough with a 16F84, > but could be feasible when using two 8-bit shift registers, which results in > 16*8=128 keys being scanned when using PORTB as input and e.g. RA0 for driving > the shift regs. Is this a possible approach, or should I go for a 28- or even > 40-pin device (are there any re-programmable (Flash or EEPROM) 28- or 40-pin > devices, where I can use one of those inexpensive PIC programmers like Ludi, > NOPPP, COM84, etc.)? So you can get the keys in a 16x8 matrix? Then the two shift register method may be doable. Are you going to be able to space the keys so that adjacent keys are on different columns? No on any Flash or EEPROM PICs in a larger than 18 pin package. MIDI stuff is on my agenda at some point. I'd like a simple portable PIC based MIDI sequencer with multiple MIDIOUT and MIDIIN ports... BAJ