EE 308
Homework #10
Due March 27, 1996

  1. The following questions concern timing on the 68HC11 bus. Refer to the Expansion Bus Timing section of the M68HC11 E Series Technical Data Manual and the Bus Timing section of the MC6821 Data Sheet.
    1. What are the Data Delay Time, Read times for the 6821, 68A21, and 68B21. Compare these times to the appropriate time for the 68HC11 bus. Which of the three chips are compatible with the 68HC11 based on this specification?
    2. What are the Data Hold Time, Read times for the 6821, 68A21, and 68B21. Compare these times to the appropriate time for the 68HC11 bus. Which of the three chips are compatible with the 68HC11 based on this specification?
    3. What are the Data Setup Time, Write times for the 6821, 68A21, and 68B21. Compare these times to the appropriate time for the 68HC11 bus. Which of the three chips are compatible with the 68HC11 based on this specification?
    4. What are the Data Hold Time, Write times for the 6821, 68A21, and 68B21. Compare these times to the appropriate time for the 68HC11 bus. Which of the three chips are compatible with the 68HC11 based on this specification?

  2. The following questions ask you how to set up the MC6821 PIA:
    1. Fill in the blanks of the following C code:

                 EXP_CRB = ________   /* Set up CB2 as general purpose output line */
                 EXP_CRB = ________   /* Bring CB2 low */
                 EXP_CRB = ________   /* Bring CB2 high */
      

    2. Fill in the blanks of the following C code:

                 EXP_CRA = ________   /* Set up CA2 as an input, IRQA2 bit set on
                                       * rising edge of CA2, IRQA line goes low
                                       * on rising edge of CA2 */
      

  3. The figure below shows two HC11s connected via 6821 PIA Ports A and B.

    1. Write some C code which will set up the PIA ports on the master HC11 so that:
      • The master PIA Port B is an output.
      • The master CB1 is an input, active on the falling edge, with interrupt disabled.
      • The master CB2 is an output, goes low on a write to PIA Port B, and goes back high on the next E clock.

    2. Write some C code which will set up the PIA ports on the master HC11 so that:
      • The master PIA Port A is an input.
      • The master CA1 is an input, active on the falling edge, with interrupt enabled.
      • The master CA2 is an output, goes low on a read from PIA Port A, and goes back high on the next E clock.

    3. Write some C code for the master HC11 which will set up Timer Input Capture 1 so that an interrupt will be generated on the falling edge of the input to TIC1.

    4. Write a TIC1 interrupt service routine for the master which will read the master's Port E, write that data to its PIA Port B, and wait for an acknowledgment from the slave that the data has been received.

    5. Write an IRQ interrupt service routine for the master which will read the master's PIA Port A, and write that data to the PC display. The following line of C code will do the writing to the display, when reg is an unsigned short, and data is an unsigned char:

               printf("Slave register 0x%x = 0x%x\n",reg,data);
      

    6. Write some C code which will set up the PIA ports on the slave HC11 so that:
      • The slave PIA Port B is an output.
      • The slave CB1 is an input, active on the falling edge, with interrupt disabled.
      • The slave CB2 is an output, goes low on a write to PIA Port B, and goes back high on the next E clock.

    7. Write some C code which will set up the PIA ports on the slave HC11 so that:
      • The slave PIA Port A is an input.
      • The slave CA1 is an input, active on the falling edge, with interrupt enabled.
      • The slave CA2 is an output, goes low on a read from PIA Port A, and goes back high on the next E clock.

    8. Write an IRQ interrupt service routine for the slave which will read the slave's PIA Port A, add 0x1000 to it, find the value in the corresponding register, send that value to its PIA Port B, and wait for the master to acknowledge that it has received the data.



Bill Rison, <rison@ee.nmt.edu >