22.09.2015 Views

of Microprocessors

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

Musical-Applications-of-Microprocessors-2ed-Chamberlin-H-1987

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

302 MUSICAL ApPLICATIONS OF MICROPROCESSORS<br />

with the analog keyboard, it is best to connect the digital keyboard to the<br />

host computer's interrupt system so that fast response is retained without<br />

tying up the music-synthesis program by constantly looking for keyboard<br />

events.<br />

Hardware Configuration<br />

The hardware configuration <strong>of</strong> the interface is relatively simple as can<br />

be seen in the simplified schematic <strong>of</strong> Fig. 9-4. First, <strong>of</strong> course, is the 6502<br />

microprocessor, which could be easily replaced with a 6503 (28 pins and 4K<br />

addressing range) for absolute minimum space and cost requirements.<br />

Program storage is provided by a single type 2708 erasable programmable<br />

read-only memory (EPROM), which holds lK bytes (2716- or 2732-type 5-V<br />

only EPROMS can be used by simply grounding their additional address<br />

lines). A type 6532 "combination" chip supplies 128 bytes <strong>of</strong> RAM, 16 bits<br />

<strong>of</strong>1/0, and an interval timer that will be used to determine the "time <strong>of</strong> day"<br />

that keys are pressed. The RAM will be used to hold information about the<br />

state <strong>of</strong> each key, as a queue for events waiting to be accepted by the host, and<br />

for general temporary storage.<br />

Auxillary logic will be required to decode addresses, latch the 32-bit<br />

output, and to actually connect to the 61 keys on the keyboard. The latter is<br />

accomplished with a 61-input digital multiplexor as in Fig. 9-5. The<br />

keyboard appears to the microprocessor as 128 memory locations at addresses<br />

0400-047F16. The first 64 addresses, 0400-043F, select a key and the upper<br />

keyboard bus, while 0440-047F select the same keys but the lower keyboard<br />

bus. The data read from this pseudomemory have bit 7 (the sign bit) <strong>of</strong>f if the<br />

selected key is contacting the selecwd bus and on otherwise. The other bits are<br />

forced to be zero, which is required for proper operation <strong>of</strong> the keyboard<br />

program to be described. Addressing the keyboard like memory makes key<br />

scanning much faster than it would otherwise be. A complete memory map is<br />

shown below:<br />

Hex address range<br />

0000-007F<br />

0080-00FF<br />

0100-03FF<br />

0400-043F<br />

0440-047F<br />

0480-07FF<br />

0800-0BFF<br />

OCOO-OFFF<br />

100o-FFFF<br />

Device addressed<br />

128 bytes RAM in 6532<br />

I/O ports and timer in 6532<br />

OOOO-OOFF repeated three times<br />

Music keyboard upper bus<br />

Music keyboard lower bus<br />

0400-047F repeated seven times<br />

Unassigned, available for expansion<br />

1K bytes EPROM 2708 type<br />

OOO-OFFF repeated 15 times<br />

Note that since address decoding is incomplete a variety <strong>of</strong> addresses<br />

will refer to the same device. In particular, the EPROM can be reached by<br />

addresses between FCOO and FFFF, which include the interrupt vectors. The

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!