UNC Charlotte, ECGR 4892/6185/8185, Spring 2005: Lab 7(?)
System Profiling
Learning Objectives
General Information
The general steps for this lab are:
1.  Add the included profiler.h and profiler.c to your last Lab assignment.
2.  Get the new code to compile with your existing code.  (Remember to check for overlaps!)  Load onto the board.
3.  Write your lab report.
4.  Demonstrate for the professor and turn in your report and files.
Prelab Activity
None.
Laboratory Assignments
Embedded systems are meant to be small and fast.  How small and fast is your code?  Well, you are about to find out!  Add the included profiler.* files to your last lab project and let it tell you where it spent most of it’s time.
1.  The profiler will start a non-standard timer that “samples” the address that was about to be executed directly prior to the profiling interrupt.  These samples are accumulated for statistical reasons.
2.  If the button below the red LED is pressed, the accumulated stats will be displayed on the SKP LCD screen, as well as sent out a 9600,N,8,1 serial communication.
3.  After reporting it’s findings, the statistics will be cleared.
Steps
1. Modify the main.c file and include the appropriate files. Include commenting along the way.
2. Build your program slowly, testing along the way. Perform compiles and solve each
requirement one at a time. Make sure comments are written as you progress.
3. Continue to build and test the program until all of the requirements have been met. Did we mention you should write your comments as you progress, not at the end?
4. If you run into problems, use the break point functionality of KD30 to step through the code until you find the problem. (the same with the MSP430 tools)
5. Once all the requirements have been met, ensure that everything works.
6. Finish lab write-up and demonstrate for the professor.
7. Submit your report, C code (*.c) and .map files on a floppy disk, CD ROM, or email.
Requirements
Req. 1 – Get the included profiler.* files to compile with your last laboratory assignment.  Modifying the profiler in case of conflicts.
Req. 2 – Verify the location of the return address from the Profile IRQ.
Req. 3 – Verify the visual and serial communications of the profiler summary.
Req. 4 – Use the profiler report to highlight bottlenecks in your code and suggest improvements.
Lab Report
Include in your lab report observations and procedure like the following:
The general learning objectives of this lab were . . .
Pre-lab question answers
The general steps needed to complete this lab were . . .
Some detailed steps to complete this lab were . . . .
1. Step one
2. Step two
3. . . . .
Code generated for this lab…
Some important observations while completing/testing this lab were . . .
In this lab we learned . . . .
Send the code the .map file, and the report to the TA via email.