Rev 1431 Rev 1435
Line 1... Line 1...
1 CCS PCH C Compiler, Version 4.090, 47914 20-I-10 01:41 1 CCS PCH C Compiler, Version 4.090, 47914 23-I-10 18:55
2   2  
3 Filename: D:\MLAB\Designs\STOPWATCH02A\SW\test\main.lst 3 Filename: D:\MLAB\Designs\STOPWATCH02A\SW\test\main.lst
4   4  
5 ROM used: 376 bytes (1%) 5 ROM used: 370 bytes (1%)
6 Largest free fragment is 32388 6 Largest free fragment is 32394
7 RAM used: 24 (1%) at main() level 7 RAM used: 25 (1%) at main() level
8 25 (1%) worst case 8 26 (1%) worst case
9 Stack: 2 worst case (1 in main + 1 for interrupts) 9 Stack: 2 worst case (1 in main + 1 for interrupts)
10   10  
11 * 11 *
12 0000: GOTO 00EE 12 0000: GOTO 00D0
13 * 13 *
14 0008: MOVWF 05 14 0008: MOVWF 05
15 000A: MOVFF FD8,06 15 000A: MOVFF FD8,06
16 000E: MOVFF FE0,07 16 000E: MOVFF FE0,07
17 0012: MOVLB 0 17 0012: MOVLB 0
Line 30... Line 30...
30 0044: MOVFF 03,12 30 0044: MOVFF 03,12
31 0048: MOVFF 04,13 31 0048: MOVFF 04,13
32 004C: BTFSS FF2.5 32 004C: BTFSS FF2.5
33 004E: GOTO 0058 33 004E: GOTO 0058
34 0052: BTFSC FF2.2 34 0052: BTFSC FF2.2
35 0054: GOTO 00AA 35 0054: GOTO 009E
36 0058: BTFSS FF2.3 -  
37 005A: GOTO 0064 -  
38 005E: BTFSC FF2.0 -  
39 0060: GOTO 00B4 -  
40 0064: MOVFF 0F,00 36 0058: MOVFF 0F,00
41 0068: MOVFF 10,01 37 005C: MOVFF 10,01
42 006C: MOVFF 11,02 38 0060: MOVFF 11,02
43 0070: MOVFF 12,03 39 0064: MOVFF 12,03
44 0074: MOVFF 13,04 40 0068: MOVFF 13,04
45 0078: MOVFF 0D,FE9 41 006C: MOVFF 0D,FE9
46 007C: MOVFF 08,FEA 42 0070: MOVFF 08,FEA
47 0080: BSF 08.7 43 0074: BSF 08.7
48 0082: MOVFF 09,FE1 44 0076: MOVFF 09,FE1
49 0086: MOVFF 0A,FE2 45 007A: MOVFF 0A,FE2
50 008A: MOVFF 0B,FD9 46 007E: MOVFF 0B,FD9
51 008E: MOVFF 0C,FDA 47 0082: MOVFF 0C,FDA
52 0092: MOVFF 14,FF3 48 0086: MOVFF 14,FF3
53 0096: MOVFF 15,FF4 49 008A: MOVFF 15,FF4
54 009A: MOVFF 16,FFA 50 008E: MOVFF 16,FFA
55 009E: MOVF 05,W 51 0092: MOVF 05,W
56 00A0: MOVFF 07,FE0 52 0094: MOVFF 07,FE0
57 00A4: MOVFF 06,FD8 53 0098: MOVFF 06,FD8
58 00A8: RETFIE 0 54 009C: RETFIE 0
59 .................... #include "D:\MLAB\Designs\STOPWATCH02A\SW\test\main.h" 55 .................... #include "D:\MLAB\Designs\STOPWATCH02A\SW\test\main.h"
60 .................... #include <18F4550.h> 56 .................... #include <18F4550.h>
61 .................... //////// Standard Header file for the PIC18F4550 device //////////////// 57 .................... //////// Standard Header file for the PIC18F4550 device ////////////////
62 .................... #device PIC18F4550 58 .................... #device PIC18F4550
63 .................... #list 59 .................... #list
Line 94... Line 90...
94 .................... #FUSES NOVREGEN //USB voltage regulator enabled 90 .................... #FUSES NOVREGEN //USB voltage regulator enabled
95 .................... #FUSES NOICPRT //ICPRT enabled 91 .................... #FUSES NOICPRT //ICPRT enabled
96 .................... 92 ....................
97 .................... #use delay(clock=8000000) 93 .................... #use delay(clock=8000000)
98 * 94 *
99 00C6: CLRF FEA 95 00A8: CLRF FEA
100 00C8: MOVLW 18 96 00AA: MOVLW 19
101 00CA: MOVWF FE9 97 00AC: MOVWF FE9
102 00CC: MOVF FEF,W 98 00AE: MOVF FEF,W
103 00CE: BZ 00EA 99 00B0: BZ 00CC
104 00D0: MOVLW 02 100 00B2: MOVLW 02
105 00D2: MOVWF 01 101 00B4: MOVWF 01
106 00D4: CLRF 00 102 00B6: CLRF 00
107 00D6: DECFSZ 00,F 103 00B8: DECFSZ 00,F
108 00D8: BRA 00D6 104 00BA: BRA 00B8
109 00DA: DECFSZ 01,F 105 00BC: DECFSZ 01,F
110 00DC: BRA 00D4 106 00BE: BRA 00B6
111 00DE: MOVLW 97 107 00C0: MOVLW 97
112 00E0: MOVWF 00 108 00C2: MOVWF 00
113 00E2: DECFSZ 00,F 109 00C4: DECFSZ 00,F
114 00E4: BRA 00E2 110 00C6: BRA 00C4
115 00E6: DECFSZ FEF,F 111 00C8: DECFSZ FEF,F
116 00E8: BRA 00D0 112 00CA: BRA 00B2
117 00EA: GOTO 0178 (RETURN) 113 00CC: GOTO 015C (RETURN)
118 .................... #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) 114 .................... #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
119 .................... 115 ....................
120 .................... 116 ....................
121 .................... 117 ....................
122 .................... #define LED1 PIN_A1 118 .................... #define LED1 PIN_A1
Line 125... Line 121...
125 .................... #int_TIMER0 121 .................... #int_TIMER0
126 .................... void TIMER0_isr(void) 122 .................... void TIMER0_isr(void)
127 .................... { 123 .................... {
128 .................... Output_low(LED2); 124 .................... Output_low(LED2);
129 * 125 *
130 00AA: BCF F92.2 126 009E: BCF F92.2
131 00AC: BCF F89.2 127 00A0: BCF F89.2
132 .................... } 128 .................... }
133 .................... 129 ....................
134 00AE: BCF FF2.2 -  
135 00B0: GOTO 0064 -  
136 .................... #int_RB 130 .................... /*#int_RB
137 .................... void RB_isr(void) 131 .................... void RB_isr(void)
138 .................... { 132 .................... {
139 .................... output_high(LED2); 133 .................... output_high(LED2);
140 00B4: BCF F92.2 -  
141 00B6: BSF F89.2 -  
142 .................... output_toggle(PIN_B2); -  
143 00B8: BCF F93.2 -  
144 00BA: BTG F8A.2 -  
145 .................... input_b(); -  
146 00BC: MOVLW FF -  
147 00BE: MOVWF F93 -  
148 .................... } 134 .................... }*/
149 .................... 135 ....................
150 .................... 136 ....................
151 00C0: BCF FF2.0 137 00A2: BCF FF2.2
152 00C2: GOTO 0064 138 00A4: GOTO 0058
153 .................... void main() 139 .................... void main()
154 .................... { 140 .................... {
155 * 141 *
156 00EE: CLRF FF8 142 00D0: CLRF FF8
157 00F0: BCF FD0.7 143 00D2: BCF FD0.7
158 00F2: BSF 08.7 144 00D4: BSF 08.7
159 00F4: CLRF FEA 145 00D6: CLRF FEA
160 00F6: CLRF FE9 146 00D8: CLRF FE9
161 00F8: MOVLW 70 147 00DA: MOVLW 70
162 00FA: MOVWF FD3 148 00DC: MOVWF FD3
163 00FC: MOVF FD3,W 149 00DE: MOVF FD3,W
164 00FE: BCF FB8.3 150 00E0: BCF FB8.3
165 0100: MOVLW 0C 151 00E2: MOVLW 0C
166 0102: MOVWF FAF 152 00E4: MOVWF FAF
167 0104: MOVLW A2 153 00E6: MOVLW A2
168 0106: MOVWF FAC 154 00E8: MOVWF FAC
169 0108: MOVLW 90 155 00EA: MOVLW 90
170 010A: MOVWF FAB 156 00EC: MOVWF FAB
171 010C: MOVF FC1,W 157 00EE: MOVF FC1,W
172 010E: ANDLW C0 158 00F0: ANDLW C0
173 0110: IORLW 0F 159 00F2: IORLW 0F
174 0112: MOVWF FC1 160 00F4: MOVWF FC1
175 0114: MOVLW 07 161 00F6: MOVLW 07
176 0116: MOVWF FB4 162 00F8: MOVWF FB4
-   163 .................... unsigned int8 last;
-   164 ....................
177 .................... setup_adc_ports(NO_ANALOGS|VSS_VDD); 165 .................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
178 0118: MOVF FC1,W 166 00FA: MOVF FC1,W
179 011A: ANDLW C0 167 00FC: ANDLW C0
180 011C: IORLW 0F 168 00FE: IORLW 0F
181 011E: MOVWF FC1 169 0100: MOVWF FC1
182 .................... setup_adc(ADC_OFF); 170 .................... setup_adc(ADC_OFF);
183 0120: BCF FC2.0 171 0102: BCF FC2.0
184 .................... setup_psp(PSP_DISABLED); 172 .................... setup_psp(PSP_DISABLED);
185 0122: BCF FB0.4 173 0104: BCF FB0.4
186 .................... setup_spi(SPI_SS_DISABLED); 174 .................... setup_spi(SPI_SS_DISABLED);
187 0124: BCF FC6.5 175 0106: BCF FC6.5
188 0126: BCF F94.7 176 0108: BCF F94.7
189 0128: BSF F93.0 177 010A: BSF F93.0
190 012A: BCF F93.1 178 010C: BCF F93.1
191 012C: MOVLW 01 179 010E: MOVLW 01
192 012E: MOVWF FC6 180 0110: MOVWF FC6
193 0130: MOVLW 00 181 0112: MOVLW 00
194 0132: MOVWF FC7 182 0114: MOVWF FC7
195 .................... setup_wdt(WDT_OFF); 183 .................... setup_wdt(WDT_OFF);
196 0134: BCF FD1.0 184 0116: BCF FD1.0
197 .................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_4); 185 .................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_4);
198 0136: MOVLW 81 186 0118: MOVLW 81
199 0138: MOVWF FD5 187 011A: MOVWF FD5
200 .................... setup_timer_1(T1_DISABLED); 188 .................... setup_timer_1(T1_DISABLED);
201 013A: CLRF FCD 189 011C: CLRF FCD
202 .................... setup_timer_2(T2_DISABLED,0,1); 190 .................... setup_timer_2(T2_DISABLED,0,1);
203 013C: MOVLW 00 191 011E: MOVLW 00
204 013E: MOVWF FCA 192 0120: MOVWF FCA
205 0140: MOVLW 00 193 0122: MOVLW 00
206 0142: MOVWF FCB 194 0124: MOVWF FCB
207 .................... setup_timer_3(T3_EXTERNAL|T3_DIV_BY_8); 195 .................... setup_timer_3(T3_EXTERNAL|T3_DIV_BY_8);
208 0144: MOVLW B7 196 0126: MOVLW B7
209 0146: MOVWF FB1 197 0128: MOVWF FB1
210 .................... setup_comparator(NC_NC_NC_NC); 198 .................... setup_comparator(NC_NC_NC_NC);
211 0148: MOVLW 07 199 012A: MOVLW 07
212 014A: MOVWF FB4 200 012C: MOVWF FB4
213 014C: MOVF F92,W 201 012E: MOVF F92,W
214 014E: MOVWF F92 202 0130: MOVWF F92
215 0150: MOVLW 06 203 0132: MOVLW 06
216 0152: MOVWF 00 204 0134: MOVWF 00
217 0154: DECFSZ 00,F 205 0136: DECFSZ 00,F
218 0156: BRA 0154 206 0138: BRA 0136
219 0158: NOP 207 013A: NOP
220 015A: MOVF FB4,W 208 013C: MOVF FB4,W
221 015C: BCF FA1.6 209 013E: BCF FA1.6
222 .................... setup_vref(FALSE); 210 .................... setup_vref(FALSE);
223 015E: CLRF FB5 211 0140: CLRF FB5
224 .................... 212 ....................
225 .................... set_tris_b(0xFF); -  
226 0160: MOVLW FF -  
227 0162: MOVWF F93 -  
228 .................... port_b_pullups(TRUE); 213 .................... port_b_pullups(TRUE);
229 0164: BCF FF1.7 214 0142: BCF FF1.7
230 .................... 215 ....................
231 .................... enable_interrupts(INT_TIMER0); 216 .................... enable_interrupts(INT_TIMER0);
232 0166: BSF FF2.5 217 0144: BSF FF2.5
233 .................... enable_interrupts(INT_RB); 218 .................... // enable_interrupts(INT_RB);
234 0168: BSF FF2.3 -  
235 .................... enable_interrupts(GLOBAL); 219 .................... enable_interrupts(GLOBAL);
236 016A: MOVLW C0 220 0146: MOVLW C0
237 016C: IORWF FF2,F 221 0148: IORWF FF2,F
238 .................... 222 ....................
-   223 .................... last=input_b();
-   224 014A: MOVLW FF
-   225 014C: MOVWF F93
-   226 014E: MOVFF F81,18
-   227 ....................
239 .................... while(true) 228 .................... while(true)
240 .................... { 229 .................... {
241 .................... Output_toggle(LED1); 230 .................... Output_toggle(LED1);
242 016E: BCF F92.1 231 0152: BCF F92.1
243 0170: BTG F89.1 232 0154: BTG F89.1
244 .................... Delay_ms(100); 233 .................... Delay_ms(100);
245 0172: MOVLW 64 234 0156: MOVLW 64
246 0174: MOVWF 18 235 0158: MOVWF 19
247 0176: BRA 00C6 236 015A: BRA 00A8
-   237 .................... if(last!=Input_b()) output_high(LED2);
-   238 015C: MOVLW FF
-   239 015E: MOVWF F93
-   240 0160: MOVF F81,W
-   241 0162: SUBWF 18,W
-   242 0164: BZ 016A
-   243 0166: BCF F92.2
-   244 0168: BSF F89.2
-   245 .................... last=input_b();
-   246 016A: MOVLW FF
-   247 016C: MOVWF F93
-   248 016E: MOVFF F81,18
248 .................... } 249 .................... }
249 0178: BRA 016E 250 0172: BRA 0152
250 .................... } 251 .................... }
251 017A: SLEEP 252 0174: SLEEP
252   253  
253 Configuration Fuses: 254 Configuration Fuses:
254 Word 1: C83F INTRC_IO IESO FCMEN PLL12 CPUDIV4 USBDIV 255 Word 1: C83F INTRC_IO IESO FCMEN PLL12 CPUDIV4 USBDIV
255 Word 2: 0E19 NOBROWNOUT WDT128 NOWDT BORV20 NOPUT NOVREGEN 256 Word 2: 0E19 NOBROWNOUT WDT128 NOWDT BORV20 NOPUT NOVREGEN
256 Word 3: 8700 PBADEN CCP2C1 MCLR LPT1OSC 257 Word 3: 8700 PBADEN CCP2C1 MCLR LPT1OSC