229 |
toman |
1 |
CCS PCM C Compiler, Version 4.058s, 42064 04-V-08 15:14 |
|
|
2 |
|
|
|
3 |
Filename: C:\RS\Prog\off\off.lst |
|
|
4 |
|
|
|
5 |
ROM used: 91 words (1%) |
|
|
6 |
Largest free fragment is 2048 |
|
|
7 |
RAM used: 7 (2%) at main() level |
|
|
8 |
7 (2%) worst case |
|
|
9 |
Stack: 0 locations |
|
|
10 |
|
|
|
11 |
* |
|
|
12 |
0000: MOVLW 00 |
|
|
13 |
0001: MOVWF 0A |
|
|
14 |
0002: GOTO 004 |
|
|
15 |
0003: NOP |
|
|
16 |
.................... #include "C:\RS\Prog\off\off.h" |
|
|
17 |
.................... #include <16F873A.h> |
|
|
18 |
.................... //////// Standard Header file for the PIC16F873A device //////////////// |
|
|
19 |
.................... #device PIC16F877A |
|
|
20 |
.................... #list |
|
|
21 |
.................... |
|
|
22 |
.................... #device adc=8 |
|
|
23 |
.................... |
|
|
24 |
.................... #FUSES NOWDT //No Watch Dog Timer |
|
|
25 |
.................... #FUSES HS //High speed Osc (> 4mhz) |
|
|
26 |
.................... #FUSES NOPUT //No Power Up Timer |
|
|
27 |
.................... #FUSES NOPROTECT //Code not protected from reading |
|
|
28 |
.................... #FUSES NODEBUG //No Debug mode for ICD |
|
|
29 |
.................... #FUSES BROWNOUT //Reset when brownout detected |
|
|
30 |
.................... #FUSES LVP //Low Voltage Programming on B3(PIC16) or B5(PIC18) |
|
|
31 |
.................... #FUSES NOCPD //No EE protection |
|
|
32 |
.................... #FUSES NOWRT //Program memory not write protected |
|
|
33 |
.................... |
|
|
34 |
.................... #use delay(clock=20000000,RESTART_WDT) |
|
|
35 |
.................... #use rs232(baud=1200,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) |
|
|
36 |
.................... |
|
|
37 |
.................... |
|
|
38 |
.................... |
|
|
39 |
.................... void main() |
|
|
40 |
.................... { |
|
|
41 |
0004: CLRF 04 |
|
|
42 |
0005: BCF 03.7 |
|
|
43 |
0006: MOVLW 1F |
|
|
44 |
0007: ANDWF 03,F |
|
|
45 |
0008: MOVLW FF |
|
|
46 |
0009: BSF 03.5 |
|
|
47 |
000A: MOVWF 19 |
|
|
48 |
000B: MOVLW A2 |
|
|
49 |
000C: MOVWF 18 |
|
|
50 |
000D: MOVLW 90 |
|
|
51 |
000E: BCF 03.5 |
|
|
52 |
000F: MOVWF 18 |
|
|
53 |
0010: BSF 03.5 |
|
|
54 |
0011: BSF 1F.0 |
|
|
55 |
0012: BSF 1F.1 |
|
|
56 |
0013: BSF 1F.2 |
|
|
57 |
0014: BCF 1F.3 |
|
|
58 |
0015: MOVLW 07 |
|
|
59 |
0016: MOVWF 1C |
|
|
60 |
.................... |
|
|
61 |
.................... port_b_pullups(TRUE); |
|
|
62 |
* |
|
|
63 |
001A: BSF 03.5 |
|
|
64 |
001B: BCF 01.7 |
|
|
65 |
.................... setup_adc_ports(NO_ANALOGS); |
|
|
66 |
001C: BSF 1F.0 |
|
|
67 |
001D: BSF 1F.1 |
|
|
68 |
001E: BSF 1F.2 |
|
|
69 |
001F: BCF 1F.3 |
|
|
70 |
.................... setup_adc(ADC_OFF); |
|
|
71 |
0020: BCF 03.5 |
|
|
72 |
0021: BCF 1F.0 |
|
|
73 |
.................... setup_spi(SPI_SS_DISABLED); |
|
|
74 |
* |
|
|
75 |
0017: MOVLW FF |
|
|
76 |
0018: BCF 03.5 |
|
|
77 |
0019: MOVWF 20 |
|
|
78 |
* |
|
|
79 |
0022: BCF 14.5 |
|
|
80 |
0023: BCF 20.5 |
|
|
81 |
0024: MOVF 20,W |
|
|
82 |
0025: BSF 03.5 |
|
|
83 |
0026: MOVWF 07 |
|
|
84 |
0027: BCF 03.5 |
|
|
85 |
0028: BSF 20.4 |
|
|
86 |
0029: MOVF 20,W |
|
|
87 |
002A: BSF 03.5 |
|
|
88 |
002B: MOVWF 07 |
|
|
89 |
002C: BCF 03.5 |
|
|
90 |
002D: BCF 20.3 |
|
|
91 |
002E: MOVF 20,W |
|
|
92 |
002F: BSF 03.5 |
|
|
93 |
0030: MOVWF 07 |
|
|
94 |
0031: MOVLW 01 |
|
|
95 |
0032: BCF 03.5 |
|
|
96 |
0033: MOVWF 14 |
|
|
97 |
0034: MOVLW 00 |
|
|
98 |
0035: BSF 03.5 |
|
|
99 |
0036: MOVWF 14 |
|
|
100 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
|
|
101 |
0037: MOVF 01,W |
|
|
102 |
0038: ANDLW C7 |
|
|
103 |
0039: IORLW 08 |
|
|
104 |
003A: MOVWF 01 |
|
|
105 |
.................... setup_timer_1(T1_DISABLED); |
|
|
106 |
003B: BCF 03.5 |
|
|
107 |
003C: CLRF 10 |
|
|
108 |
.................... setup_timer_2(T2_DISABLED,0,1); |
|
|
109 |
003D: MOVLW 00 |
|
|
110 |
003E: MOVWF 78 |
|
|
111 |
003F: MOVWF 12 |
|
|
112 |
0040: MOVLW 00 |
|
|
113 |
0041: BSF 03.5 |
|
|
114 |
0042: MOVWF 12 |
|
|
115 |
.................... setup_comparator(NC_NC_NC_NC); |
|
|
116 |
0043: MOVLW 07 |
|
|
117 |
0044: MOVWF 1C |
|
|
118 |
0045: MOVF 05,W |
|
|
119 |
0046: CLRWDT |
|
|
120 |
0047: MOVLW 10 |
|
|
121 |
0048: MOVWF 77 |
|
|
122 |
0049: DECFSZ 77,F |
|
|
123 |
004A: GOTO 049 |
|
|
124 |
004B: MOVF 1C,W |
|
|
125 |
004C: BCF 03.5 |
|
|
126 |
004D: BCF 0D.6 |
|
|
127 |
.................... setup_vref(FALSE); |
|
|
128 |
004E: BSF 03.5 |
|
|
129 |
004F: CLRF 1D |
|
|
130 |
.................... |
|
|
131 |
.................... while(TRUE) |
|
|
132 |
.................... { |
|
|
133 |
.................... if(input(PIN_B0)) |
|
|
134 |
0050: BSF 06.0 |
|
|
135 |
0051: BCF 03.5 |
|
|
136 |
0052: BTFSS 06.0 |
|
|
137 |
0053: GOTO 058 |
|
|
138 |
.................... printf("A"); |
|
|
139 |
0054: MOVLW 41 |
|
|
140 |
0055: BTFSS 0C.4 |
|
|
141 |
0056: GOTO 055 |
|
|
142 |
0057: MOVWF 19 |
|
|
143 |
.................... } |
|
|
144 |
0058: BSF 03.5 |
|
|
145 |
0059: GOTO 050 |
|
|
146 |
.................... |
|
|
147 |
.................... } |
|
|
148 |
005A: SLEEP |
|
|
149 |
|
|
|
150 |
Configuration Fuses: |
|
|
151 |
Word 1: 3FFA HS NOWDT NOPUT NODEBUG NOPROTECT BROWNOUT LVP NOCPD NOWRT |