ECE 371 Lab 6 -- 8253 Programmabe Timer Experiment

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.
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)
DURING LAB:
1.  Set the necessary jumper on the Stanton Board.
2.  Verify that your program works. Be sure that your TA see your program working.
3.  Use the CRO to display the output waveform from the 8253.

POST-LAB:
1.  Write a report summarizing the hardware involved.
2.  Include a listing of you well-documented software.

MUSICAL SCALE

Musical Note
Frequency (Hz)
Key
C
262
1
C#
277
2
D
294
3
D#
311
4
E
330
5
F
349
6
F#
369
7
G
392
8
G#
415
9
A
440
A
A#
466
B
B
495
C

HINTS:

No hints are yet available.