91.305 home
syllabus html pdf
assignment 1 html pdf
rev'd short syll. txt
lecture 3 notes txt
data sheets html
uml305dev html pdf
parts list pdf
assembly html pdf
assignment 2a html pdf
assignment 2b html pdf
assignment 3
  main html pdf
  java setup html
  files zip
bootloader html
assignment 4 html pdf
assignment 5
  main html pdf
  files zip
  reading pdf
assignment 6 html pdf
invokevirtual pdf
assignment 7 html pdf
IA-32 manual pdf
assignment 8 html pdf
assignment 9 pdf
review html pdf
resources data IKonboard software

Assignment 5: Memory-Mapped Address Decoding
due Wed Oct 23


An 8-bit output latch is to be mapped into the HC11’s address space. Any HC11 memory writes to the address range 0x5000 to 0x5FFF (inclusive) should cause the data byte written from the HC11 onto the data bus (Port C) to be captured by the latch.


The circuit above illustrates the method. A block of combinational logic (to be designed by you) accepts as input the 4 higher -order address bits (from the HC11 Port B), the E clock, and the R/~W signal. The combinational logic should decode these signals and produce a negative-true enable signal when:

  • the high four bits of the address are 0x5, and
  • the E clock is high (it’s a positive-true signal), and
  • the R/~W is write (i.e., as a negative-true signal, it is 0).

Your combo logic circuit should generate a true signal (0 output) when all of these conditions are satisfied, and a false signal (1 output) otherwise.

Wire your circuit’s output to the clock input of HC574 latch chip as illustrated. Connect the HC11 PORTC data bus to the inputs of the HC574. Wire the latch’s outputs to LEDs. Make sure to wire the latch’s pin 1 output control enable to ground!

Test Code

The test program expanddemo.s is provided to help you test your design. When bootloaded into the HC11, the code puts the HC11 into expanded mode (enabling the address bus, data bus, and R/~W signals), and then writes sequential numbers 0, 1, 2, etc. to address 0x5000. In between each memory write, the piezo line is toggled, producing a click. There is about a half-second pause between each memory write/piezo click.

When you attempt to bring up your circuit, make sure you have Port A 4 (pin 4 of the HC11) connected to the piezo! You should then hear a continuous click...click...click... while the expanddemo.s program is running. Make sure you hear the clicking! If you don’t, the program isn’t running and your design has no chance of working!

Let’s take a look at the expanddemo.s program:
;;; expanddemo.s
;;; puts HC11 in expanded mode,
;;; writes sequentially increasing values to address 0x5000,
;;; and delays and clicks on PA4 between each write
;;; Fred G. Martin / UML CS 2002

PORTA=  0x1000
HPRIO=  0x103c                  ; highest priority bit int and misc reg

        ldaa HPRIO              ; read the reg
        oraa #0x20              ; set MDA bit -> expanded mode
        staa HPRIO              ; write it back

        clrb                    ; init b at 0
        stab 0x5000             ; write b to target
        incb                    ; inc it for next time

        ldaa PORTA
        eora #0x10              ; toggle piezo bit (click)
        staa PORTA

        ldy #0                  ; delay for 65k loops
delay:  dey
        bne delay

        bra loop                ; again
After the definitions of the PORTA and HPRIO registers, the first three lines of code set the MDA bit (bit 5) in the HPRIO register. This puts the HC11 into expanded mode. From this point forward, and memory accesses outside of either the internal RAM (0x0000 to 0x01FF) or the register bank (0x1000 to 0x103F) are accomplished using PORTB, PORTC, the R/~W line, and the address strobe (AS) signals.

Next, accumulator B is used as a counter, and is cleared to zero to begin. The core of the program follows. Accumulator B is written to address 0x5000. This causes an external memory access using the HC11 lines just mentioned. Accumulator B is incremented for next time.

Next the piezo line is toggled, causing a click. This is done by loading the A accumulator from PORTA, exclusive-OR’ing the piezo pin, and storing back.

Next, a long delay loop (about a 1/2 second) is executed using register Y as a 16-bit counter down from 0 and back again.

This process repeats ad infinitum.

To Turn In:

1. Draw a schematic diagram of your circuit that decodes the address from the HC11. Make sure your schematic includes:

  • The HC11 chip itself, which signals from it you are using, and the pin numbers of those signals. Inside the box for the HC11, you should have the names of the signals (e.g., A15); outside the box, you shoudl have the pin number (e.g., 8).

  • Logic level diagrams for other chips that you are using. E.g., if you use an inverter, draw the diagram for an inverter, not the 14-pin box that the inverter lives in.

  • The 74HC574 latch. Show all signals on the ’HC574 chip, including the fact that its outputs are wired to LEDs so you can see their state. (In effect, reproduce the drawing of the ’HC574 from this handout.)

2. Also include a brief written explanation of your circuit.

3. After your circuit is working, download the file mystery5000.rel to your HC11.
Describe the pattern of lights that you see when running this file.

Last modified: Friday, 18-Oct-2002 22:44:43 EDT by