Subversion Repositories svnkaklik

Rev

Go to most recent revision | Details | Last modification | View Log

Rev Author Line No. Line
2 kaklik 1
CCS PCW C Compiler, Version 3.110, 15448
2
 
3
               Filename: d:\@kaklik\programy\pic_c\robot\solarni_robot\dalsi_verze\main.LST
4
 
5
               ROM used: 141 (14%)
6
                         Largest free fragment is 883
7
               RAM used: 3 (4%) at main() level
8
                         4 (6%) worst case
9
               Stack:    1 locations
10
 
11
*
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
14
0002:  GOTO   048
15
0003:  NOP
16
....................  /* Program pro ovladani slunecniho robota */  
17
.................... /* (chodi se zapojenim Dark Walker rev.3  */  
18
.................... /* $Header: /programy/PIC_C/robot/solarni_robot/dalsi_verze/main.c 7     14.05.03 23:21 Kaklik $ */  
19
....................   
20
.................... #include "D:\@Kaklik\programy\PIC_C\robot\solarni_robot\dalsi_verze\main.h" 
21
....................  #include <16F84.h> 
22
....................  //////// Standard Header file for the PIC16F84 device ////////////////  
23
.................... #device PIC16F84  
24
.................... #list  
25
....................  
26
.................... #use delay(clock=32768)  
27
*
28
001B:  MOVLW  10
29
001C:  MOVWF  04
30
001D:  MOVF   00,W
31
001E:  BTFSC  03.2
32
001F:  GOTO   028
33
0020:  GOTO   026
34
0021:  NOP
35
0022:  NOP
36
0023:  NOP
37
0024:  NOP
38
0025:  NOP
39
0026:  DECFSZ 00,F
40
0027:  GOTO   021
41
0028:  GOTO   083 (RETURN)
42
.................... #fuses LP,PUT,NOWDT  
43
....................   
44
....................  
45
....................   
46
.................... #define LED       PIN_B3   // LED  
47
.................... #define ON_TIME   75       // Cas sepnuti rele  
48
.................... #define meridlo   PIN_B2   // Napetovy supervisor  
49
.................... #define RESET     PIN_B0   // Pridrzeni RESETu  
50
....................   
51
.................... void rele1()   // Sepnuti prvniho rele  
52
.................... {  
53
....................    output_low(PIN_A1);  
54
*
55
0004:  BSF    03.5
56
0005:  BCF    05.1
57
0006:  BCF    03.5
58
0007:  BCF    05.1
59
....................    output_low(PIN_B4);  
60
0008:  BSF    03.5
61
0009:  BCF    06.4
62
000A:  BCF    03.5
63
000B:  BCF    06.4
64
....................    delay_ms(ON_TIME);  
65
000C:  MOVLW  C7
66
000D:  MOVWF  0C
67
000E:  DECFSZ 0C,F
68
000F:  GOTO   00E
69
0010:  NOP
70
0011:  NOP
71
....................    output_high(PIN_A1);  
72
0012:  BSF    03.5
73
0013:  BCF    05.1
74
0014:  BCF    03.5
75
0015:  BSF    05.1
76
....................    output_high(PIN_B4);  
77
0016:  BSF    03.5
78
0017:  BCF    06.4
79
0018:  BCF    03.5
80
0019:  BSF    06.4
81
001A:  GOTO   07E (RETURN)
82
.................... }  
83
....................   
84
.................... void motor()   // Sepnuti motoru  
85
.................... {  
86
....................    output_low(pin_A2);  
87
*
88
0029:  BSF    03.5
89
002A:  BCF    05.2
90
002B:  BCF    03.5
91
002C:  BCF    05.2
92
....................    output_low(pin_B1);  
93
002D:  BSF    03.5
94
002E:  BCF    06.1
95
002F:  BCF    03.5
96
0030:  BCF    06.1
97
....................    output_low(PIN_A4);  
98
0031:  BSF    03.5
99
0032:  BCF    05.4
100
0033:  BCF    03.5
101
0034:  BCF    05.4
102
....................    delay_ms(ON_TIME);  
103
0035:  MOVLW  C7
104
0036:  MOVWF  0C
105
0037:  DECFSZ 0C,F
106
0038:  GOTO   037
107
0039:  NOP
108
003A:  NOP
109
....................    output_high(pin_A2);  
110
003B:  BSF    03.5
111
003C:  BCF    05.2
112
003D:  BCF    03.5
113
003E:  BSF    05.2
114
....................    output_high(pin_B1);  
115
003F:  BSF    03.5
116
0040:  BCF    06.1
117
0041:  BCF    03.5
118
0042:  BSF    06.1
119
....................    output_high(PIN_A4);  
120
0043:  BSF    03.5
121
0044:  BCF    05.4
122
0045:  BCF    03.5
123
0046:  BSF    05.4
124
0047:  GOTO   088 (RETURN)
125
.................... }  
126
....................   
127
....................   
128
.................... void main()  
129
.................... {  
130
0048:  CLRF   04
131
0049:  MOVLW  1F
132
004A:  ANDWF  03,F
133
....................   
134
....................    setup_counters(RTCC_INTERNAL,WDT_18MS);  
135
004B:  MOVLW  08
136
004C:  MOVWF  0C
137
004D:  BTFSS  0C.3
138
004E:  GOTO   057
139
004F:  MOVLW  07
140
0050:  CLRF   01
141
0051:  MOVLW  81
142
0052:  MOVWF  04
143
0053:  MOVF   00,W
144
0054:  ANDLW  C0
145
0055:  IORLW  0F
146
0056:  MOVWF  00
147
0057:  CLRWDT
148
0058:  MOVLW  81
149
0059:  MOVWF  04
150
005A:  MOVF   00,W
151
005B:  ANDLW  C0
152
005C:  IORWF  0C,W
153
005D:  MOVWF  00
154
....................   
155
....................    output_high(RESET);  
156
005E:  BSF    03.5
157
005F:  BCF    06.0
158
0060:  BCF    03.5
159
0061:  BSF    06.0
160
....................   
161
....................    port_b_pullups (true);  
162
0062:  BSF    03.5
163
0063:  BCF    01.7
164
....................   
165
....................    output_high(LED);  
166
0064:  BCF    06.3
167
0065:  BCF    03.5
168
0066:  BSF    06.3
169
....................    delay_ms(ON_TIME);  
170
0067:  MOVLW  C7
171
0068:  MOVWF  0C
172
0069:  DECFSZ 0C,F
173
006A:  GOTO   069
174
006B:  NOP
175
006C:  NOP
176
....................    output_low(LED);  
177
006D:  BSF    03.5
178
006E:  BCF    06.3
179
006F:  BCF    03.5
180
0070:  BCF    06.3
181
....................   
182
....................      if (!input(pin_B5))  
183
0071:  BSF    03.5
184
0072:  BSF    06.5
185
0073:  BCF    03.5
186
0074:  BTFSC  06.5
187
0075:  GOTO   07A
188
....................      {  
189
....................          port_b_pullups (false);  
190
0076:  BSF    03.5
191
0077:  BSF    01.7
192
....................          goto chyba;  
193
0078:  GOTO   086
194
0079:  BCF    03.5
195
....................      }  
196
....................   
197
....................    port_b_pullups (false);  
198
007A:  BSF    03.5
199
007B:  BSF    01.7
200
....................    rele1();  
201
007C:  BCF    03.5
202
007D:  GOTO   004
203
....................   
204
....................    delay_ms(28000);  
205
007E:  MOVLW  70
206
007F:  MOVWF  0F
207
0080:  MOVLW  FA
208
0081:  MOVWF  10
209
0082:  GOTO   01B
210
0083:  DECFSZ 0F,F
211
0084:  GOTO   080
212
0085:  BSF    03.5
213
....................   
214
.................... chyba:  
215
....................    motor();  
216
0086:  BCF    03.5
217
0087:  GOTO   029
218
....................    output_low(RESET);  
219
0088:  BSF    03.5
220
0089:  BCF    06.0
221
008A:  BCF    03.5
222
008B:  BCF    06.0
223
.................... }  
224
....................  
225
008C:  SLEEP