OBJECTIVE:
Implement a multi-tone generator (electronic organ) using the 8253 timer
on the Stanton Trainer board. Twelve of the keys on the Stanton keyboard
will serve as the keyboard for your electronic organ. (A table of the frequencies
for the desired tones and their key assignments is included below.)
You can use part of the software from the Lab
5 to scan the keyboard on the Stanton board.
EQUIPMENT NECESSARY:
| Stanton Trainer |
PRE-LAB:
1. Study the schematics of the Stanton
Trainer in the Course Notes to determine which jumpers need to be set.
Make this selesction so that bit 0 of Port C of the Stanton's 8255 is connected
to the Gate input of Counter 0 of the 8253. Also, select the proper
jumper to connect the input of the audio amplifier to the output of Timer
0 of the 8253.
2. Also based on a study of the Stanton's schematics, determine the frequency of the Clock input to the 8253's Counter 0.
3. Write software to do the following:
A. Initialize the 8253 and the 8255 for the proper modes of operation.DURING LAB:
B. Scan the keyboard to determine when one of the hex keys 1 to C is hit.
C. When a key is found to be hit, cause the 8253 (Counter 0) to generate a square wave of the proper frequency. (See the Musical Scale table provided below. You need to load a starting value into Counter 0, based on the information in the table.) The tone should continue as long as the key is depressed, however when released (or no key is pressed), no tone should be present. (The tone can be turned off by removing the Gate signal from Counter 0.) After a key is released, continue scanning the keypad to check for new tones to be played.
D. Continue the above, until a key on the PC's keyboard is hit (remember the kbhit() procedure)
POST-LAB:
1. Write a report summarizing the hardware involved.
2. Include a listing of you well-documented software.
MUSICAL SCALE
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
HINTS:
No hints are yet available.