Lab #11 (04/18/02)
    Programming the Kit Display
    © D. Thiébaut


    SMITH COLLEGE     CSC270  Lab #11

    Experiment #1: Programming the Kit's display.

    Figure 1: leftmost 7-segment digit. The U23 circuit is a 74LS259.

      As we saw in class, the circuits that drive the 7-segment displays are 74LS259 circuits, and contain 8 D-flipflops. Each one has an address associated with it:

                 Leftmost display digit:  0C16Fh
                          second digit:   0C15Fh
                          third digit:    0C14Fh
                          fourth digit:   0C13Fh
                          fifth digit:    0C12Fh
                 rightmost display digit: 0C11Fh
      
      Note that we do not know for sure which LED these addresses correspond to, yet...

    Checking the segments

      As we saw in class, there should be a jumper, or two posts on the mother board of the kit allowing us to clear the flipflops all at once. This will/should turn all the LEDs ON at once.

      Look for two posts labeled ST1 and ST2 on the board, and connect them temporarily with a wire. Do you observe all the segments turning on?

    First programming task: Blinking LED

      Your next task is to write a small program that will turn one of the LED segments of the first LED block ON and OFF. We will start with Address 0C16Fh.

      The idea is to store a 1 (01h) at that address, wait about 1/10th of a second, then store 0 (00h), wait 1/10th of a second and repeat. The result is an LED blinking at a rate of 1/0.1s = 10 Hz.

      Which LED responds to Address 0C16Fh? _______________

      Modify your program and use Address 0C16Eh instead of 0C16Fh. Do not modify anything else. What LED does the program activate now?

      Continue on decrementing the addresses and figure out the assignment of addresses to LEDs:

                  Address of LED a:  ___________
                  Address of LED b:  ___________
                  Address of LED c:  ___________
                  Address of LED d:  ___________
                  Address of LED e:  ___________
                  Address of LED f:  ___________
                  Address of LED g:  ___________
                  Address of LED DP: ___________
      

    Next programming task: Displaying 3 on the leftmost digit

      Your next task is to write a program that starts with an 8-bit binary pattern in Acca representing the display of the decimal 3 on the leftmost 7-segment display. The program then stores this pattern, one bit at a time, on all 8 segments (Hints: look up the rotate and shift instructions).

      Be efficient and use the Index register to hold the address of the LEDs!

      Also, use a procedure to display the contents of Acca on a 7-segment digit. Here is the skeleton and specification of such procedure:

                  ;------------------------------------------
                  ;OUTPUT: takes the pattern stored in Acca
                  ;        and stores in on the 7 segment
                  ;        display whose address is passed in
                  ;        the X register.
                  ;------------------------------------------
                  Output:   ...
                            ...
                            ...
                            RTS
           
      
      With this procedure, displaying a character should be a fairly simple task. Look at the following example (which might or might not work with your procedure, depending on how you coded it):
                            LDAA     # 5Bh       ;pattern for digit '5'
                            LDX      # 0C158h    ;address of second digit
                            JSR      Output      ;output pattern on digit
      

    Name that task: Displaying your name on the digits

      Now that you have your output procedure working, write a program that uses it to output your name on the display. You may shorten your name if you wish!

    Final Task: Mystery Program

      (Try this program out and describe what it does. After trying it, translate it into assembly and include it in your lab report.
      It starts at address 0010: CE C1 68 86 7E BD 00 3B CE C1 58 86 1D BD 00 3B CE C1 48 86 15 BD 00 3B CE C1 38 86 11 BD 00 3B CE C1 28 86 06 BD 00 3B 7E 00 10 C6 08 A7 00 08 46 5A C1 00 26 F7 39
      )