Sample Design Report |
Contents Writing Exercises Writing Courses
|
This web page presents a sample design report [Herwald, 1999] written in a microprocessor design course at Virginia Tech. Note that instructors of other design courses may have different expectations as far as the format (layout and typography) and style (structure, language, and illustration) of design reports in their classes. Note that in this report, carets (>) are given to reveal the line spacings in the report's format (in an actual report, these carets would not appear). Moreover, in this report, the actual appendices are not complete. In an actual report, these appendices would be complete, and each would begin on a separate page. In the actual report, the following typeface sizes were used: 14-point type for the title, 12-point type for the subheadings and text, and 10-point type for the figure captions.
|
Assembler release TER_2.0 version 2.09 (c) Motorola (free ware) 0001 ;************************************************** 0002 ; Temp_Monitor: This program implements a temperature 0003 ; measurement and display system. The A/D system is 0004 ; used to read an analog temperature. The value is 0005 ; scaled to Farenheit, and displayed on an LED bar 0006 ; display. If the temperature is above 90 or below 0007 ; 20, a message is transmitted over the serial link. 0008 ; Programmer: JMB 0009 ;************************************************* 0010 0011 ; Define some I/O registers 0012 1004 PORTB EQU $1004 0013 102b BAUD EQU $102B 0014 102c SCCR1 EQU $102C 0015 102d SCCR2 EQU $102D 0016 102e SCSR EQU $102E 0017 102f SCDR EQU $102F 0018 1030 ADCTL EQU $1030 0019 1031 ADR1 EQU $1031 0020 1032 ADR2 EQU $1032 0021 1033 ADR3 EQU $1033 0022 1034 ADR4 EQU $1034 0023 1039 OPTION EQU $1039 0024 0025 ; Define some constants 0026 005a UPPER_LIMIT EQU 90 ; upper temperature limit 0027 0014 LOWER_LIMIT EQU 20 ; lower temperature limit 0028 0002 HOT EQU 2 ; flag value indicating 0029 ; temperature UPPER_LIMIT 0030 0001 COLD EQU 1 ; flag value indicating 0031 ; temperature < LOWER_LIMIT 0032 0000 OK EQU 0 ; flag value indicating 0033 ; temperature is within limits 0034 000d CR EQU $0D ; ASCII code for carraige return 0035 000a LF EQU $0A ; ASCII code for line feed 0036 0037 ; Variables 0038 0100 ORG $100 ; place in RAM area 0039 0100 TEMP rmb 1 ; current temperature 0040 0101 FLAG rmb 1 ; flag indicating system state 0041 ; (HOT, COLD, or OK) 0042 0043 b600 ORG $B600 ; EEPROM area 0044 ;*************************************************** 0045 ; Temp_Monitor: This routine initializes the system, and 0046 ; then enters an endless loop. In this loop, it reads 0047 ; the current temperature, updates the LEDs, and then 0048 ; sends a message to the serial link, if necessary. 0049 ; Input: none 0050 ; Output: none 0051 ; Registers/variables modified: ACCA, ACCB, CCR, TEMP, FLAG 0052 ;**************************************************** 0053 Temp_Monitor: 0054 b600 8e 01 ff lds #$1FF ; initialize stack pointer 0055 b603 bd b6 11 jsr Startup ; initialize A/D and SCI, 0056 ; initialize RAM variables 0057 Main: 0058 b606 bd b6 1d jsr GetTemp ; get current temperature 0059 b609 bd b6 29 jsr SetDisp ; update LED display 0060 b60c bd b6 3c jsr CheckLimits ; check upper and lower limits 0061 b60f 20 f5 bra Main ; repeat 0062 0063 0064 0065 ;**************************************************** 0066 ; Startup: This routine initializes the system. It calls 0067 ; other routines to initialize the A/D system and the 0068 ; SCI system. It also initializes the FLAG variable. 0069 ; Input: none 0070 ; Output: none 0071 ; Registers/variables modified: ACCA, IX, CCR, FLAG 0072 ;**************************************************** 0073 Startup: 0074 b611 bd b6 7c jsr InitAD ; power up the A/D system 0075 b614 bd b6 a2 jsr InitSCI ; initialize the serial interface 0076 0077 b617 86 00 ldaa #OK ; initialize FLAG 0078 b619 b7 01 01 staa FLAG 0079 0080 b61c 39 rts 0081 0082 ;**************************************************** 0083 ; GetTemp: This routine gets the current temperature. 0084 ; It reads the A/D value, converts it to Farenheit, 0085 ; and stores the result in TEMP. An A/D value of $00 0086 ; corresponds to 0 degrees, and $FF (actually $100) 0087 ; is 110 degrees, so the A/D value is multiplied by 0088 ; 110 to convert to temperature. 0089 ; Input: none 0090 ; Output: New temperature stored in TEMP 0091 ; Registers/variables modified: ACCA, ACCB, CCR, TEMP 0092 ;**************************************************** 0093 GetTemp: 0094 b61d b6 10 31 ldaa ADR1 ; read A/D value 0095 b620 c6 6e ldab #110 ; multiply by 110 0096 b622 3d mul ; to get temperature 0097 b623 89 00 adca #$00 ; round to 8 bits 0098 0099 b625 b7 01 00 staa TEMP ; store new temperature 0100 0101 b628 39 rts 0102 0103 ;**************************************************** 0104 ; SetDisp: This routine updates the LEDs to display 0105 ; the current temperature. The LEDs are arranged as a 0106 ; bar display with a range of 20 - 90 degrees, in 10 0107 ; degree steps. This routine determines how many of the 0108 ; LEDs should be turned on based on the current temperature. 0109 ; Input: TEMP variable 0110 ; Output: none 0111 ; Registers/variables modified: ACCA, ACCB, CCR 0112 ;**************************************************** 0113 SetDisp: 0114 b629 c6 00 ldab #$00 ; all LEDs off initially 0115 b62b b6 01 00 ldaa TEMP ; get current temperature 0116 0117 SD_Loop: 0118 b62e 81 14 cmpa #20 ; is value 20? 0119 b630 25 06 blo Update_LEDs ; branch if not 0120 b632 58 lslb ; else, turn on next LED 0121 b633 5c incb 0122 b634 80 0a suba #10 ; value = value - 10 0123 b636 20 f6 bra SD_Loop ; repeat 0124 0125 Update_LEDs: 0126 b638 f7 10 04 stab PORTB ; update the LEDs 0127 0128 b63b 39 rts 0129 0130 ;**************************************************** 0131 ; CheckLimits: This routine checks to see if the current 0132 ; temperature is within the upper and lower limits. If 0133 ; not, then a warning message is transmitted over the 0134 ; serial link. 0135 ; Input: TEMP, FLAG 0136 ; Output: none 0137 ; Register/variables modified: ACCA, ACCB, IX, CCR 0138 ;**************************************************** 0139 CheckLimits: 0140 b63c b6 01 00 ldaa TEMP ; get current temperature 0141 b63f 81 5a cmpa #UPPER_LIMIT ; temp upper limit? 0142 b641 23 12 bls Check_Lower ; branch if not 0143 b643 c6 02 ldab #HOT ; have we already sent a 0144 ; warning for this? 0145 b645 f1 01 01 cmpb FLAG ; (i.e., is FLAG == HOT?) 0146 b648 27 31 beq CL_Exit ; branch if so (don't repeat 0147 ; warning message) 0148 b64a f7 01 01 stab FLAG ; update flag 0149 b64d ce b6 e2 ldx #HOT_MSG ; send "hot" warning message 0150 b650 bd b6 c5 jsr SendMsg 0151 b653 20 26 bra CL_Exit ; and exit 0152 0153 Check_Lower: 0154 b655 81 14 cmpa #LOWER_LIMIT ; temp $102F
Last updated 3/00 http://www.me.vt.edu/writing/ http://ae3.cen.uiuc.edu/writing/ All materials at this web site are the intellectual property of the editors and authors. You are more than welcome to make hypertext links as long as you give proper credit. If you have comments, suggestions, or questions, please direct them to one of the editors. |