You are on page 1of 2

University of Florida Real Time DSP Applications Dr.

Gugel
Department of ECE Spring 2018
Page 1/2
Lab #3: Advanced Assembly Programming & Adding SRAM
Purpose

The purpose of this lab is to further strengthen the student's assembly programming skills with the introduction
of the stack and floating point instructions (FPU). In addition, students will learn how to interface a 256K x 16
SRAM to the DSP.

Part I. Writing FPU Assembly – Simple Vector Statistics

You will be given a vector containing several floating point numbers. Your task is to write a routine that finds
the largest number, smallest number and computes the average for the vector. You may assume that the total
number of numbers in the vector is known before hand and therefore can be stored as an inverted constant.
Otherwise, you would need to create a routine to divide by N where N is the vector length. 1/N is much easier
to create via the assembler.

1. The three floating point solutions should be stored in the data section with labels Min_Num, Max_Num and
Ave_Num. These initially should be set to zero. The 1/N value should then follow these variables in your data
section. Your TA will then give you the starting address and data values for the vector that will be used in
computing these three simple statistics.

2. All code should be easily relocate-able in memory. You should write THREE separate subroutines for each of
the statistical computations and then call these from your main program. The vector start address and length
should be passed to each subroutine via the stack and then the computed solution should be returned via AL
and/or AH.

3. No values should be hard coded in your program other than the vector values given to you by your TA.
Everything should be easily relocate-able.

Note: Your code should be original and not match any examples on our web site or a classmate’s code.
Copied Code will result in a zero for lab!

Part II. Interfacing Memory to the DSP

Interface the volatile memory 256K x 16 SRAM to your DSP. See Dr. Gugel or our TA for a discussion of
where the device should be placed on the DSP board.

1. Check the part number on the memory chip/breakout board you received in lab. Find your part's data sheet
at Digikey or elsewhere online. Print out the pertinent pages of this data sheet. i.e. device pin-out, timing
diagrams, suggested wiring circuits, etc.

2. Memory Map Placement - We would like to use either Zone 6 or Zone 7 in the DSP memory map for
placement of this new external SRAM. If we just use -xCS6 or -xCS7 directly as the chip enable on our
SRAM, how many images of the SRAM will we have in our DSP memory range? Pick an image in the
memory map that allows us to ‘glue-lessly' interface the SRAM.

3. SRAM Signal Connection - Match up control signals from the DSP's timing diagram to those in the SRAM's
timing diagram for connection to -OE, -CE and R/-W on the SRAM. Data lines from the DSP will go to data
lines on the SRAM. Address lines on the DSP will be used the address inputs on the SRAM. ~CE on the
SRAM should be connected directly to a Zone chip select for simplicity in wiring.
University of Florida Real Time DSP Applications Dr. Gugel
Department of ECE Spring 2018
Page 2/2
Lab #3: Advanced Assembly Programming & Adding SRAM
4. Before powering your board up, make sure no data bits are grounded or tied to +3.3V before powering on
the board. Use your multi-meter and check all signals wired to headers. Wiring mistakes at this point can
destroy your DSP ($$)!

5. SRAM Software Testing - Once you think you have your memory functional, create the following SRAM
Memory tests:

Test1. Write $AA to all locations in SRAM and then read all locations and check if $AA is present. If this
passes write an $AA to your LED display, else send $EE and place the first error data value and address in
memory for future viewing.

Test 2. Write $55 to all locations and then read all locations to see if $55 is present. If it passes, then send $55
to your display, else write $EE and put the first error data value and address in memory for viewing.

Test3. Write $0000 to the first memory location, next write $0001 to the next location and then $0002 to the
next and so on to all remaining memory locations. Read them back and verify no errors are found. If no errors
are found, display $00 else display $EE and again store the first defective address and data value.

Note: Our TA will check Tests1 & 2 by manually placing an erroneous value into memory using the debugger.

Hint: Write your main program such that if waits for a switch toggle to begin writing to RAM as well as to begin
reading from RAM.

Part I. Pre-Lab & In-Lab Requirements

1. Flow chart & LST file printed out as hard copy. Your code should also be emailed to your TA before lab.

2. Ask your TA for the following variable values: orig_addr, orig_len, sorted_addr Assemble your program with
these new values and have your TA place a vector in memory for testing/sign-off.

Part II. Pre-Lab/In-Lab Requirements:

1. Email your TA the source files for your SRAM test code.
2. Show your TA a hand drawn wiring diagram for the SRAM and decode circuit with pin numbers.
3. Verify to your TA that your SRAM is functional by running all the required memory tests.

Lab Point Break-down


In-Lab Quiz (30 minutes) 20%
Part I Pre-lab Materials 10%
Functional Part I In-Lab 20%
Part II Pre-Lab Materials 10%
Functional Part II In-Lab 20%