EE 308
Final Exam
May 7, 1996

Name:
You may use any of the Motorola data books. No calculators allowed. Show all work. Partial credit will be given. No credit will be given if an answer appears with no supporting work.

  1. Do the following arithmetic:

    A716 = 2
    A716 = 10 (assuming A716 is unsigned)
    A716 = 10 (assuming A716 is signed)

    Do the following operations on eight-bit numbers. Indicate the eight-bit answer, and whether a carry and/or overflow was generated:

  2. The following table shows the values of an HC11's registers and some of its memory. Fill in the blanks in the next tables at the end of instruction execution.

  3. The following table shows the values of an HC11's registers and some of its memory. Assume the Real Time Interrupt is enabled, and a Real Time Interrupt is pending. Fill in the blanks in the next tables as the HC11 proceeds.

  4. The following problem concerns clear flags.
    1. How do you clear the Timer Output Compare 2 (TOC2) flag? Write some C code which will do this.
    2. How do you clear the SCI Receive Data Register Full (RDRF) flag? Write some C code which will do this.
    3. How do you clear the 6821 IRQB1 flag? Write some C code which will do this.
    4. How do you clear the SPIF flag? Write some C code which will do this.
    5. How do you clear the AD Conversion Complete (CCF) flag? Write some C code which will do this.

  5. Consider the following program fragment:

          .area   CODE (ABS)
          .org    0x2000
          lds     #0x01ff
          ldaa    #0x00
          inca
          staa    0x1004
    

    1. How many bytes of memory does the code fragment occupy?
    2. How many E-clock cycles will it take to execute the four instructions of the code fragment?
    3. How many microseconds will it take the fragment to execute on an HC11 with a 2 MHz E-clock?
    4. Complete the following table showing what's on the address, data and control bus for each E-clock cycle:

  6. Here are some questions about various sub-systems on the HC11. For all questions, assume the HC11 has a 2 MHz E-clock.
    1. At reset, what is the smallest time interval the HC11 can measure?
    2. You can change this smallest time interval. What are the possible values, how do change the interval, and what special consideration do you need to observe when making the change?
    3. Briefly explain the concept of the output compare function.
    4. Briefly explain the concept of the timer overflow interrupt.
    5. What is the basic difference between the Serial Peripheral Interface (SPI) and the Serical Communications Interface (SCI)?
    6. How long does it take the A/D converter to make a sequence of four conversions?
    7. An HC11 has VRL = 1V and \verbVRH = 3V. The input on Pin 3 of Port E is 2.4 V. What will be in the A/D result register after a conversion?

  7. The following problem deals with interrupts:
    1. List at least six things you need to do in your program to use interrupts properly.
      i)
      ii)
      iii)
      iv)
      v)
      vi)
    2. Explain what happens to the stack, stack pointer and condition code register when an interrupt is generated. Assume SP = 0x01ff at the time of the interrupt.
    3. You want to capture the time of a falling edge on Timer Input Capture 3.
      1. Which pin on the HC11 will you connect your input line to?
      2. Write a function setup_tic3() which will set up TIC3 to generate an interrupt on the falling edge.
      3. Write an interrupt service routine tic3_isr() which will save the time of the falling edge in a global variable called tic3_time.

  8. The following figure shows some external hardware connected to an HC11 in expanded mode:

    1. Explain the function of the HC11's Port B and Port C in expanded mode.
    2. What range of addresses access the User EPROM, CS_EPROM?
    3. What range of addresses access the Super I/O chip, CS_SUPER?
    4. How many registers does the Super I/O chipt have?
    5. Write a C #define which will access Register 3 of the Super I/O chip:
             #define SUPER_REG3 = ___________________________________
      

  9. The following is a timing diagram for the Super I/O chip of the previous problem. For each of the timing values below, explain in words what the timing parameter means, determine the corresponding time an HC11 with a 2 MHz E-clock, which circled number(s) from the HC11 Technical Reference Manual gave you the time, and state whether the Super I/O chip is compatible with the HC11 based on the time.

    1. tDSW
      Description:
      
      HC11 Time: _____________   Circled Number: _________  Compatible? ________
      
    2. tDHW
      Description:
      
      HC11 Time: _____________   Circled Number: _________  Compatible? ________
      
    3. tAS
      Description:
      
      HC11 Time: _____________   Circled Number: _________  Compatible? ________
      
    4. tAH
      Description:
      
      HC11 Time: _____________   Circled Number: _________  Compatible? ________