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.
- 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:
- 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.
- 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.
- The following problem concerns clear flags.
- How do you clear the Timer Output Compare 2 (TOC2) flag? Write some C
code which will do this.
- How do you clear the SCI Receive Data Register Full (RDRF) flag? Write
some C code which will do this.
- How do you clear the 6821 IRQB1 flag? Write some C
code which will do this.
- How do you clear the SPIF flag? Write some C
code which will do this.
- How do you clear the AD Conversion Complete (CCF) flag? Write some C
code which will do this.
- Consider the following program fragment:
.area CODE (ABS)
.org 0x2000
lds #0x01ff
ldaa #0x00
inca
staa 0x1004
- How many bytes of memory does the code fragment occupy?
- How many E-clock cycles will it take to execute the four instructions of
the code fragment?
- How many microseconds will it take the fragment to execute on an HC11
with a 2 MHz E-clock?
- Complete the following table showing what's on the address, data and
control bus for each E-clock cycle:
- Here are some questions about various sub-systems on the HC11. For all
questions, assume the HC11 has a 2 MHz E-clock.
- At reset, what is the smallest time interval the HC11 can measure?
- 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?
- Briefly explain the concept of the output compare function.
- Briefly explain the concept of the timer overflow interrupt.
- What is the basic difference between the Serial Peripheral Interface
(SPI) and the Serical Communications Interface (SCI)?
- How long does it take the A/D converter to make a sequence of four
conversions?
- An HC11 has
VRL = 1V and \verb
VRH = 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?
- The following problem deals with interrupts:
- List at least six things you need to do in your program to use
interrupts properly.
i)
ii)
iii)
iv)
v)
vi)
- 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.
- You want to capture the time of a falling edge on Timer Input Capture 3.
- Which pin on the HC11 will you connect your input line to?
- Write a function
setup_tic3()
which will set up TIC3 to generate
an interrupt on the falling edge.
- Write an interrupt service routine
tic3_isr()
which will save the
time of the falling edge in a global variable called tic3_time
.
- The following figure shows some external hardware connected to an HC11
in expanded mode:
- Explain the function of the HC11's Port B and Port C in expanded mode.
- What range of addresses access the User EPROM,
CS_EPROM
?
- What range of addresses access the Super I/O chip,
CS_SUPER
?
- How many registers does the Super I/O chipt have?
- Write a C
#define
which will access Register 3 of the Super I/O
chip:
#define SUPER_REG3 = ___________________________________
- 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.
-
tDSW
Description:
HC11 Time: _____________ Circled Number: _________ Compatible? ________
-
tDHW
Description:
HC11 Time: _____________ Circled Number: _________ Compatible? ________
-
tAS
Description:
HC11 Time: _____________ Circled Number: _________ Compatible? ________
-
tAH
Description:
HC11 Time: _____________ Circled Number: _________ Compatible? ________