Midi Keyboard Circuit

Above you can see a picture of my midi circuit. To view a larger picture click on the picture above. I have also made the schematic available along with the bill of material.

My circuit design can be divided into five subsystems: (1) the 8031 microcontroller, (2) the memory, (3) the keyboard and switch interface, (4) the midi and RS232 interface, (5) the power supply.

(1) The 8031 microcontroller subsystem is the heart of the design. It consists of the 8031 and the crystall and reset circuitry. The 8031 runs the progam in the memory chips. The crystall circuitry controls have fast the 8031 runs. The reset circuit gives the ability to restart the program without shutting off power.

(2) The memory subsystem consists of 2 eeproms (U3 and U4), a latch, a quad nand, and a switch and a couple of jumpers. Eeprom U3 contains the midi keyboard software. Eeprom U4 contains monitor software. This gives me the ability to reprogam my midi keyboard without having to remove any chips. By throwing switch SW1 I am able to boot the 8031 from U4. And with jumprer JP1 in the write position I can reprogram U3 using my RS232 connection to my serial port on my computer.

(3) The keyboard and switch interface consists of the 74HCT154 for the keyboard and the 74HCT138 for the switches. Although I have 2 rotary switches, 3 push buttons, and 2 SPST switches wired to the switch interface, at the present time I am only using rotary switch RSW1. It is being used to change the starting octave of the keyboard. I plan to eventually use the other switches, but I have not encorporated them into my software yet. This is the reason that I made my software upgradeable without removing chips.

(4) The midi and RS232 interfaces can not be used at the same time. When switch SW2 is set to midi interface the output from the 8031 only needs go through a couple reistors before being sent outh the midi cable. However, when using the RS232 interface a MAX232 is used to interface between the computer and the 8031. This interface besides giving me the ability to program one of the eeproms, also gives me the ability to debug the midi software by inserting output strings into the code during testing.

(5) The power supply circuitry consists of a 7805 and a bunch of capacitors. For power I use an old power supply for a cordless drill that has long since died. Its output is 8VDC. The 7805 converts this to the 5VDC that all of the chips in the circuit require. There is a 470 f capacitor at the 7805 and a 10 nf capacitor at the power input for every chip. This ensures that there is no dip in voltage for all of the chips to run correctly.

Here is what the board looks like connected to the keyboard.