Assembly Programming and Elementary Wiring - Lab #3 | EEL 4744, Lab Reports of Microprocessors

Material Type: Lab; Professor: Li; Class: MICROPROCESSOR APPLIC; Subject: ENGINEERING: ELECTRICAL; University: University of Florida; Term: Unknown 1989;

Typology: Lab Reports

Pre 2010

Uploaded on 03/18/2009

koofers-user-iej-1
koofers-user-iej-1 🇺🇸

10 documents

1 / 3

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
University of Florid a EEL 4744
Department of Electrical and Computer Engineering
Page 1/3
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 samp le population
and to wire in an LED display and sw itches 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 convert an array of student
grades to ASCII letter grades. 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 create a new vector of
ASCII letter grades that correspond to the vector
of test scores. For example if the firs t element in
the scores vector is from 90-100 then store the
ASCII equivalent of ‘A’ in memory. Here is the
breakdown for the grade computation :
100-90 score => store ASCII ‘A’
89 - 80 score => store ASCII ‘B’
79 - 70 score => store ASCII ‘C’
69 - 60 score => store ASCII ‘D’
59 - 0 score => store ASCII ‘F’
Thus if the second score in the vector is 73, you
would store a ‘C’ in the second memory location
of the new vector and repeat for all scores as
required by score_vector_len. The starting
address for this new vector will be called
grade_addr and will again be given to you in lab.
You should create an equate for 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
these constants in your program. You should also
use equate statemen ts to define origins for the
program and data s ections. 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 qu estions on
how your progra m 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 s imulate your code outside of
lab to verify proper function.
3. Bring the flow chart and program code
(assembly and list files) to the lab on diskette
and also on hard copy.
Part I. In-Lab
1. Your TA will no t allow you in unless you
have the pre-lab m aterials specified above.
2. A vector contain ing 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 r egarding
your code & program operation.
Part II. Adding a 4 Bit LED Disp lay 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 bin ary values for visu al
information feedback during program execution.
pf3

Partial preview of the text

Download Assembly Programming and Elementary Wiring - Lab #3 | EEL 4744 and more Lab Reports Microprocessors in PDF only on Docsity!

Department of Electrical and Computer Engineering Page 1 / 3

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 convert an array of student grades to ASCII letter grades. 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 create a new vector of ASCII letter grades that correspond to the vector of test scores. For example if the first element in the scores vector is from 90-100 then store the ASCII equivalent of ‘A’ in memory. Here is the breakdown for the grade computation: 100 - 90 score => store ASCII ‘A’ 89 - 80 score => store ASCII ‘B’ 79 - 70 score => store ASCII ‘C’ 69 - 60 score => store ASCII ‘D’ 59 - 0 score => store ASCII ‘F’ Thus if the second score in the vector is 73, you would store a ‘C’ in the second memory location of the new vector and repeat for all scores as required by score_vector_len. The starting address for this new vector will be called grade_addr and will again be given to you in lab. You should create an equate for this address at the top of your program.
    1. As mentioned earlier, your TA will give you all required input/output addresses in lab. Thus you should use assembler equate statements for these 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.
    2. 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
    3. Create a program flow chart for your program.
    4. Code each block in your flow chart in 68HC assembly.
    5. Assemble and simulate your code outside of lab to verify proper function.
    6. Bring the flow chart and program code (assembly and list files) to the lab on diskette and also on hard copy. Part I. In-Lab
    7. Your TA will not allow you in unless you have the pre-lab materials specified above.
    8. 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.
    9. Verify your computed results with your TA.
    10. 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.

Department of Electrical and Computer Engineering Page 2 / 3

Lab #3: Assembly Programming & Elementary Wiring

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. 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
  2. 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.
  3. 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 (U4). 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.
  4. 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.
  5. Connect the other side of the four DIP switches to GND.
  6. 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.
  7. Connect the common node of the RPACK to +5V. For clarification purposes, see the diagram that follows:

DIP

RPACK

T3 T2 T1 T

DIP

LEDs

+5V

SIP

RPACK

DIP

Switches

T

T

T

T