EE 308
Homework #10
Due March 31, 1996
- Write the master program to implement Lab 10. This program
needs to be typed. Be sure to do the following:
- Set up PIA Port A as an input. Program the PIA so an interrupt is
generated on the falling edge of CA1.
- Set up PIA Port B as an output. Program the PIA so that CB2 is an output,
no interrupt is generated on CB1, and CB2 operates in the pulse handshaking
mode.
- Write an interrupt service routine which will be executed when the button
is pushed. In this ISR you should read PIA Port A, send the data to PIA Port
B, and wait until an acknowledgement is received from the slave.
- Write the slave program to implement Lab 10. This program
needs to be typed. Be sure to do the following:
- Set up PIA Port A as an input. Program the PIA so an interrupt is
generated on the falling edge of CA1, CA2 is an output, and CA2 operates in
the pulse handshaking mode.
- Set up PIA Port B as an output.
- Define four global variables each of which will hold the value for one of
the four patterns (in the case of the T-Bird, it will hold the index value of
the T-Bird table). Initialize these to 0.
- Define a global array for the T-Bird table. Declare the array to be on
type const, and initialize it when your define it.
- Define a global variable which will hold the pattern to implement on the
LEDs. Initialize this to 0.
- In your IRQ interrupt service routine, update the pattern global variable
(described above) to indicate which pattern to display. Also in this ISR,
change the update rate as told by the master.
- In your RTI interrupt service routine, look at the pattern global variable
to determine which pattern to display, and update the global variable for that
pattern.
- Make sure you do not remain in either of the interrupt service routines
for very long. Neither of the routines should use while,
for or do loops.
- Look at the 6821 data sheet. Determine the values of the times
described in Part 5 (except for (a)).
Bill Rison,
<rison@ee.nmt.edu >