louarnold
Joined: 13 May 2010 Posts: 42 Location: Ottawa, Canada
|
|
Posted: Mon Jun 28, 2010 7:07 pm |
|
|
Wayne_ wrote: | Could you post the .lst file for your routine.
Cheers. | Here it is.
Code: | CCS PCM C Compiler, Version 3.170b, 16412
ROM used: 216 (11%)
Largest free fragment is 1832
RAM used: 15 (9%) at main() level
23 (13%) worst case
Stack: 1 locations
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 081
0003: NOP
.................... //Lab13B V7 Calculation of execution time.
.................... #include <16f877A.h>
.................... //////// Standard Header file for the PIC16F877A device ////////////////
.................... #device PIC16F877A
.................... #list
....................
.................... //#device ICD=TRUE
.................... #fuses HS, NOLVP, NOWDT, PUT
.................... #fuses NODEBUG
.................... //#fuses BROWNOUT
.................... #use delay (clock = 20000000)
.................... #use rs232 (baud=9600, xmit=PIN_C6, rcv=PIN_C7,ERRORS)
*
008A: CLRF 20
008B: MOVLW 81
008C: BSF 03.5
008D: MOVWF 19
008E: MOVLW 26
008F: MOVWF 18
0090: MOVLW 90
0091: BCF 03.5
0092: MOVWF 18
....................
.................... void main ()
.................... {
*
0081: CLRF 04
0082: MOVLW 1F
0083: ANDWF 03,F
0084: MOVLW 06
0085: BSF 03.5
0086: MOVWF 1F
0087: MOVLW 07
0088: BCF 03.5
0089: MOVWF 1F
.................... long time;
.................... long a,b,c; //was int a,b,c;
.................... b=0;
*
0093: CLRF 26
0094: CLRF 25
.................... c=0;
0095: CLRF 28
0096: CLRF 27
.................... //Set Timer1 as Timer mode from instruction clock.
.................... setup_timer_1(T1_INTERNAL | T1_DIV_BY_1);
0097: MOVLW 85
0098: MOVWF 10
.................... set_timer1(0); //Start the timer at value 0
0099: CLRF 0F
009A: CLRF 0E
.................... a=b*c; //Calculate time to execute this
009B: MOVF 26,W
009C: MOVWF 2A
009D: MOVF 25,W
009E: MOVWF 29
009F: MOVF 28,W
00A0: MOVWF 2C
00A1: MOVF 27,W
00A2: MOVWF 2B
00A3: GOTO 014
00A4: MOVF 79,W
00A5: MOVWF 24
00A6: MOVF 78,W
00A7: MOVWF 23
.................... time=get_timer1(); //Get the # of clock ticks.
00A8: MOVF 0F,W
00A9: MOVWF 7A
00AA: MOVF 0E,W
00AB: MOVWF 77
00AC: MOVF 0F,W
00AD: SUBWF 7A,W
00AE: BTFSS 03.2
00AF: GOTO 0A8
00B0: MOVF 77,W
00B1: MOVWF 21
00B2: MOVF 7A,W
00B3: MOVWF 22
.................... time-=2; //Subtract overhead
00B4: MOVLW 02
00B5: SUBWF 21,F
00B6: MOVLW 00
00B7: BTFSS 03.0
00B8: MOVLW 01
00B9: SUBWF 22,F
.................... printf("Ticks=%lu\n\r",time); //Ticks to do a=b*c
00BA: CLRF 29
00BB: MOVF 29,W
00BC: CALL 004
00BD: INCF 29,F
00BE: MOVWF 77
00BF: MOVF 77,W
00C0: BTFSS 0C.4
00C1: GOTO 0C0
00C2: MOVWF 19
00C3: MOVLW 06
00C4: SUBWF 29,W
00C5: BTFSS 03.2
00C6: GOTO 0BB
00C7: MOVLW 10
00C8: MOVWF 04
00C9: MOVF 22,W
00CA: MOVWF 2B
00CB: MOVF 21,W
00CC: MOVWF 2A
00CD: GOTO 029
00CE: MOVLW 0A
00CF: BTFSS 0C.4
00D0: GOTO 0CF
00D1: MOVWF 19
00D2: MOVLW 0D
00D3: BTFSS 0C.4
00D4: GOTO 0D3
00D5: MOVWF 19
.................... while(1){};
00D6: GOTO 0D6
.................... }
....................
00D7: SLEEP
Configuration Fuses:
Word 1: 3F72 HS NOWDT PUT NODEBUG NOPROTECT BROWNOUT NOLVP NOCPD NOWRT
|
|
|