CMPE 401 - Computer Interfacing

Assignment #2

Due: In the CMPE 401 assignment box at 15:45 on Wednesday, Oct. 20, 2004


  1. The Motorola 68000 processors provide 14 different addressing modes. Three of those modes (immediate data, program counter relative with displacement, and program counter relative with displacement and index) cannot be used to specify a destination operand. Briefly explain how each of these addressing modes is used, and explain why this restriction against destination operands is present in each mode.

  2. The vast majority of modern computer systems use memory-mapped input/output interfaces. What do we mean by "memory-mapped" in this context? What do you think are the major advantages of memory-mapping? Can you think of any disadvantages of memory-mapping? (An alternative to memory mapping is to use a separate I/O bus that comes directly off of the CPU.)

  3. Go to the website of Freescale Semiconductor (the new name of Motorola Semiconductor) and determine what peripheral functions are provided in the MC68331 and MC68340 microcontrollers in addition to the embedded CPU32 microprocessor. Do not just give the acronym abbeviations of the peripheral subsystems: spell out the subsystem names and give a brief description of each.

  4. Consult the on-line documentation or the course textbook, and then briefly explain how the MOVEP instruction works. Why was such an instruction included in the 68000 instruction set? Illustrate your answer with a short example in assembly language.

  5. Consult the on-line documentation or the course textbook, and then briefly explain how the CHK and CHK2 instructions work. Illustrate your answer with a short example in assembly language. You do not have to provide the exception handling routines.

  6. Small microcomputers can usually get by with autovectored interrupts and do not require user interrupts. Briefly explain the difference between autovectored and user interrupts. What would be the advantage of using only autovectored interrupts in a small microcomputer? How is autovectoring forced in the lab microcomputer?

  7. Briefly describe how the two (A and B side) quadruple receiver buffers work in the MC68681 DUART. What happens when a single character is received when the receiver buffers start out empty? Be sure to specify how the status register bits change in this case. Assume that error status is in character (not block) mode. Assume that all interrupt modes have been disabled in the DUART. What happens when four characters are received in a quick burst (too fast for the CPU to respond) into an empty receiver? What happens if the quick burst contains five rather than four characters?

  8. Write an assembly language program that initializes a DUART for normal duplex serial communications as follows: The A port is to use busy waiting, so interrupts are to be disabled for that side. The characters are to contain 7 data bits, odd parity, and one stop bit. The baud rate is to be 4800 in both directions. Receiver error status is to apply to all characters in the receiver FIFO. The CTS handshake input is to automatically disable/enable the A side transmitter. The RTS handshake output is to go inactive automatically when the receiver FIFO is full.
    The B port is to use interrupts in both the transmit and receiver directions. Receiver interrupts are to be caused whenever one character is received. The characters are to contain 8 data bits, no parity, and two stop bits. The baud rate is to be 9600 in both directions. Receiver error status is to apply to character that was just received. The RTS handshake output to be controlled by software, not controlled automatically by the DUART hardware. The CTS input is to have no automatic effect on the transmitter.
    Be sure to reset the receiver and transmitter circuits on both sides by issuing the appropriate commands to the command registers.