Objective: In this problem you are required to write a code which performs the following tasks (see the flow chart).
Procedure: Read the following program constrains carefully
- All the input values must be saved in the program memory (PM). You can start from any location. Assume the number of inputs is limited to 10. The last value will be 0xFF, indicating the end of the data (0xFF is not counted in the summation calculation).
- Assume all inputs are unsigned and larger than zero.
- Assume the average has no remainder.
- You must use TALPTR to copy the data from the program memory (PM) into data memory (DM).
- Your MAIN program must only contain function calls, as shown in the flowchart - otherwise you will not receive any grades!
- You must use subroutines (CALL) or Macros to perform each function.
- The DELAY functions can be anything as long as the displayed values are readable.
- Assume the SUM is always less than 99d
- Use LEDs connected to one of the IO ports to display the results.
- All displayed values must be in BCD form. As an example, if the AVG is 0xA then your AVG should be displayed as 0x10 on the IO port.
What to submit:
- Submit your own flowchart of the overall program; similar to what we have here.
- Submit a copy of one of your functions (subroutines). The subroutine must have Purpose, Input, Output, and proper comments, as well a a flowchart. Bad flowcharts will receive no grades! Use a professional software.
Please discuss any questions you have over PIAZZA. You MUST be able to display the program at the beginning of the class. |
|