Lab 3: Assembly Programming and Elementary Wiring - University of Florida, EEL 4744 - Prof, Lab Reports of Microprocessors

Lab 3 for the university of florida's eel 4744 course taught by dr. Gugel in the department of electrical and computer engineering. The lab focuses on elementary assembly programming and basic wiring, requiring students to write short assembly code routines for statistical calculations and wire in an led display and switches to the hc6812. Students are expected to have their 68hc12 development board completed and programmed before the lab.

Typology: Lab Reports

Pre 2010

Uploaded on 03/18/2009

koofers-user-aiu
koofers-user-aiu 🇺🇸

4

(1)

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
University of Florida EEL 4744 Dr. Gugel
Department of Electrical and Co mputer Engineering Fall 2008
Page 1/3
9/10/08 - 3:57 PM
Lab #3: Assembly Programming & Elementary Wiring
Purpose
This lab is an exercise in elementary assembly
programming and basic wiring. It requires
students to write short assembly code routines
for statistical calculations on a sample population
and to wire in an LED display and switches to
the HC6812. If you do not have your 68HC12
development board completed and programmed
do so at an earlier lab.
Part I. Program Description
We would like to compute the average grade in
an array of student grade. See below for
details:
1. Assume that your TA will download into your
emulator memory a vector of student test grades.
The starting address for the vector will be
denoted as score_addr and an equate statement
should be used at the top of your program to set
this variable easily to a new address supplied by
your TA.
2. The length or number of elements in the
vector will be stored as a single byte at address
score_vector_len which also will be given to
you in lab.
3. The test scores or elements of the vector will
be unsigned bytes that range from 0 to 100.
4. We would like you to compute the average
score for the array of scores. You may assume
that the sum of all the scores in the score array
will always be less than 16 bits unsigned.
You final eight bit unsigned answer should be
written to an address specified by
score_aver_addr. Use an equate statement to
set this address at the top of your program.
5. As mentioned earlier, your TA will give you
all required input/output addresses in lab. Thus
you should use assembler equate statements for
all constants in your program. You should also
use equate statements to define origins for the
program and data sections. This will enable your
code to be easily moved (re-located) in memory.
6. Create a dummy score vector and length
and test your program at home. Don’t try to
write the code in lab… you won’t have time!
Your TA will also be asking you questions on
how your program works to see if you are the
original author.
Part I. Pre-Lab Work
1. Create a program flow chart for your program.
2. Code each block in your flow chart in 68HC12
assembly.
3. Assemble and simulate your code outside of
lab to verify proper function.
3. Bring the flow chart and program code
(assembly and list files) to the lab via a memory
stick and also as a hard copy.
Part I. In-Lab
1. Your TA will not allow you in unless you
have the pre-lab materials specified above.
2. A vector containing test scores will be given
to you as well as the vector length. Re-assemble
and test your code with this new information.
3. Verify your computed results with your TA.
4. Answer any questions they have regarding
your code & program operation.
Part II. Adding a 4 Bit LED Display in Lab
We would like to connect 4 LEDs in a DIP type
package to Port T of the 6812. This will enable
us to write out binary values for visual
information feedback during program execution.
While this sounds quite elementary, it will turn
out to be an extremely beneficial debug tool
during run-time.
1. Connect Port T (T3:0) using wire-wrap wires
to four series resistors (where the resistance
should be in the range of ~220-680 ohms). It is
suggested that you mount the resistors (DIP
RPACK) in a wire-wrap socket such that the pins
face down in your development board.
pf3

Partial preview of the text

Download Lab 3: Assembly Programming and Elementary Wiring - University of Florida, EEL 4744 - Prof and more Lab Reports Microprocessors in PDF only on Docsity!

Department of Electrical and Computer Engineering Fall 2008 Page 1 / 3 9 / 10 / 08 - 3 : 57 PM

Lab #3: Assembly Programming & Elementary Wiring

Purpose This lab is an exercise in elementary assembly programming and basic wiring. It requires students to write short assembly code routines for statistical calculations on a sample population and to wire in an LED display and switches to the HC6812. If you do not have your 68HC development board completed and programmed do so at an earlier lab. Part I. Program Description We would like to compute the average grade in an array of student grade. See below for details:

  1. Assume that your TA will download into your emulator memory a vector of student test grades. The starting address for the vector will be denoted as score_addr and an equate statement should be used at the top of your program to set this variable easily to a new address supplied by your TA.
  2. The length or number of elements in the vector will be stored as a single byte at address score_vector_len which also will be given to you in lab.
  3. The test scores or elements of the vector will be unsigned bytes that range from 0 to 100.
  4. We would like you to compute the average score for the array of scores. You may assume that the sum of all the scores in the score array will always be less than 16 bits unsigned. You final eight bit unsigned answer should be written to an address specified by score_aver_addr. Use an equate statement to set this address at the top of your program.
  5. As mentioned earlier, your TA will give you all required input/output addresses in lab. Thus you should use assembler equate statements for all constants in your program. You should also use equate statements to define origins for the program and data sections. This will enable your code to be easily moved (re-located) in memory.
  6. Create a dummy score vector and length and test your program at home. Don’t try to write the code in lab… you won’t have time! Your TA will also be asking you questions on how your program works to see if you are the original author. Part I. Pre-Lab Work
    1. Create a program flow chart for your program.
    2. Code each block in your flow chart in 68HC assembly.
    3. Assemble and simulate your code outside of lab to verify proper function.
    4. Bring the flow chart and program code (assembly and list files) to the lab via a memory stick and also as a hard copy. Part I. In-Lab
    5. Your TA will not allow you in unless you have the pre-lab materials specified above.
    6. A vector containing test scores will be given to you as well as the vector length. Re-assemble and test your code with this new information.
    7. Verify your computed results with your TA.
    8. Answer any questions they have regarding your code & program operation. Part II. Adding a 4 Bit LED Display in Lab We would like to connect 4 LEDs in a DIP type package to Port T of the 6812. This will enable us to write out binary values for visual information feedback during program execution. While this sounds quite elementary, it will turn out to be an extremely beneficial debug tool during run-time.
    9. Connect Port T (T3:0) using wire-wrap wires to four series resistors (where the resistance should be in the range of ~220-680 ohms). It is suggested that you mount the resistors (DIP RPACK) in a wire-wrap socket such that the pins face down in your development board.

Department of Electrical and Computer Engineering Fall 2008 Page 2 / 3 9 / 10 / 08 - 3 : 57 PM

Lab #3: Assembly Programming & Elementary Wiring

Note: The Port T header is defined as follows: header pin1 => T header pin3 => T header pin5 => T header pin7 => T header pin9 => GND header pin2 => T header pin4 => T header pin6 => T header pin8 => T header pin10 => GND

  1. Connect the other side of the series DIP resistor to the Anode of an LED in the LED DIP package as shown below. Note: LSB should be rightmost LED.
  2. Once your binary display is connected write "1s" to DDRT (Data Direction Register Port T @ $00AF) for bits DDRT3:0 using the Monitor's Memory Modify (MM) command. This configures Port T's lower four bits as outputs. Note: Consult the online 6812 documentation for more information.
    1. Using the Monitor again, write out a value to Port T ($00AE) and check if the proper LEDs light. Note: If the proper LEDs do not light, check your wiring. If you find no errors, check the voltages at the actual 6812 Port T pins on the device (U1). Pin definitions for the 68HC12B can again be found in our online documentation. Part III. Adding an Input Switch in Lab We will now add a 4 bit DIP switch (using a 8 SPST switch DIP package) to Port T. This will enable us to manually input information to the 6812 while it is executing code.
    2. Connect 4 DIP switches to pins 8, 6, 4, 2 of the Port T header. Note1: The DIP switch should be placed in a socket on top of the board with the wire-wrap pins facing down. Note2: The rightmost switch from the top view should be connected to the T4 of Port T.
    3. Connect the other side of the four DIP switches to GND.
    4. Connect a SIP pull-up RPACK to the side of the 4 switches that are connected to Port T. Place the SIP RPACK in half of a DIP wire-wrap socket for easy connection.
    5. Connect the common node of the RPACK to +5V. For clarification purposes, see the diagram that follows:
    6. Using the Monitor (MD command) read in the value of your switches. If you do not see the correct value, check your wiring. If your wiring is okay, check the voltages on the corresponding

DIP

RPACK

T3 T2 T1 T

DIP

LEDs

+5V

SIP

RPACK

DIP

Switches

T

T

T

T