Subversion Repositories svnkaklik

Rev

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

Rev Author Line No. Line
199 kaklik 1
CCS PCM C Compiler, Version 3.245, 27853               10-III-07 23:23
2
 
3
               Filename: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.lst
4
 
5
               ROM used: 194 words (5%)
6
                         Largest free fragment is 2048
7
               RAM used: 6 (3%) at main() level
8
                         7 (4%) worst case
9
               Stack:    1 locations
10
 
11
*
12
0000:  MOVLW  00
13
0001:  MOVWF  0A
14
0002:  GOTO   029
15
0003:  NOP
16
.................... #include ".\camerus.h" 
17
.................... #include <16F873.h> 
18
.................... //////// Standard Header file for the PIC16F873 device //////////////// 
19
.................... #device PIC16F873 
20
.................... #list 
21
....................  
22
.................... #device adc=8 
23
....................  
24
.................... #FUSES NOWDT                 	//No Watch Dog Timer 
25
.................... #FUSES XT                    	//Crystal osc <= 4mhz 
26
.................... #FUSES NOPUT                 	//No Power Up Timer 
27
.................... #FUSES NOPROTECT             	//Code not protected from reading 
28
.................... #FUSES NOBROWNOUT            	//No brownout reset 
29
.................... #FUSES NOLVP                 	//No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O 
30
.................... #FUSES NOCPD                 	//No EE protection 
31
.................... #FUSES NOWRT                 	//Program memory not write protected 
32
.................... #FUSES NODEBUG               	//No Debug mode for ICD 
33
....................  
34
.................... #use delay(clock=4000000) 
35
0004:  MOVLW  26
36
0005:  MOVWF  04
37
0006:  MOVF   00,W
38
0007:  BTFSC  03.2
39
0008:  GOTO   018
40
0009:  MOVLW  01
41
000A:  MOVWF  21
42
000B:  CLRF   20
43
000C:  DECFSZ 20,F
44
000D:  GOTO   00C
45
000E:  DECFSZ 21,F
46
000F:  GOTO   00B
47
0010:  MOVLW  4A
48
0011:  MOVWF  20
49
0012:  DECFSZ 20,F
50
0013:  GOTO   012
51
0014:  NOP
52
0015:  NOP
53
0016:  DECFSZ 00,F
54
0017:  GOTO   009
55
0018:  RETLW  00
56
.................... #use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3,force_HW) 
57
0019:  BCF    14.7
58
001A:  BCF    0C.3
59
001B:  MOVF   26,W
60
001C:  MOVWF  13
61
001D:  MOVLW  02
62
001E:  BTFSC  14.7
63
001F:  GOTO   027
64
0020:  BTFSS  0C.3
65
0021:  GOTO   020
66
0022:  MOVLW  00
67
0023:  BSF    03.5
68
0024:  BTFSC  11.6
69
0025:  MOVLW  01
70
0026:  BCF    03.5
71
0027:  MOVWF  21
72
0028:  RETLW  00
73
*
74
0041:  MOVLW  FF
75
0042:  BCF    03.5
76
0043:  MOVWF  25
77
....................  
78
....................  
79
....................  
80
....................  
81
.................... void main() 
82
.................... { 
83
*
84
0029:  CLRF   04
85
002A:  MOVLW  1F
86
002B:  ANDWF  03,F
87
002C:  BSF    25.3
88
002D:  MOVF   25,W
89
002E:  BSF    03.5
90
002F:  MOVWF  07
91
0030:  BCF    03.5
92
0031:  BSF    25.4
93
0032:  MOVF   25,W
94
0033:  BSF    03.5
95
0034:  MOVWF  07
96
0035:  MOVLW  01
97
0036:  MOVWF  13
98
0037:  MOVLW  28
99
0038:  BCF    03.5
100
0039:  MOVWF  14
101
003A:  BSF    03.5
102
003B:  BCF    14.7
103
003C:  BCF    14.6
104
003D:  BSF    1F.0
105
003E:  BSF    1F.1
106
003F:  BSF    1F.2
107
0040:  BCF    1F.3
108
....................    setup_adc_ports(NO_ANALOGS); 
109
*
110
0044:  BSF    03.5
111
0045:  BSF    1F.0
112
0046:  BSF    1F.1
113
0047:  BSF    1F.2
114
0048:  BCF    1F.3
115
....................    setup_adc(ADC_OFF); 
116
0049:  BCF    03.5
117
004A:  BCF    1F.0
118
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
119
004B:  BSF    03.5
120
004C:  MOVF   01,W
121
004D:  ANDLW  C7
122
004E:  IORLW  08
123
004F:  MOVWF  01
124
....................    setup_timer_1(T1_DISABLED); 
125
0050:  BCF    03.5
126
0051:  CLRF   10
127
....................    setup_timer_2(T2_DISABLED,0,1); 
128
0052:  MOVLW  00
129
0053:  MOVWF  21
130
0054:  MOVWF  12
131
0055:  MOVLW  00
132
0056:  BSF    03.5
133
0057:  MOVWF  12
134
....................  
135
....................    output_high(PIN_C0); 
136
0058:  BCF    03.5
137
0059:  BCF    25.0
138
005A:  MOVF   25,W
139
005B:  BSF    03.5
140
005C:  MOVWF  07
141
005D:  BCF    03.5
142
005E:  BSF    07.0
143
....................    output_low(PIN_C6); 
144
005F:  BCF    25.6
145
0060:  MOVF   25,W
146
0061:  BSF    03.5
147
0062:  MOVWF  07
148
0063:  BCF    03.5
149
0064:  BCF    07.6
150
....................     
151
....................    Delay_ms(200); 
152
0065:  MOVLW  C8
153
0066:  MOVWF  26
154
0067:  CALL   004
155
....................    output_low(PIN_C0); 
156
0068:  BCF    25.0
157
0069:  MOVF   25,W
158
006A:  BSF    03.5
159
006B:  MOVWF  07
160
006C:  BCF    03.5
161
006D:  BCF    07.0
162
....................    Delay_ms(200); 
163
006E:  MOVLW  C8
164
006F:  MOVWF  26
165
0070:  CALL   004
166
....................    output_high(PIN_C0); 
167
0071:  BCF    25.0
168
0072:  MOVF   25,W
169
0073:  BSF    03.5
170
0074:  MOVWF  07
171
0075:  BCF    03.5
172
0076:  BSF    07.0
173
....................  
174
....................    i2c_start();      // Reset 
175
0077:  BSF    03.5
176
0078:  BSF    11.0
177
0079:  BTFSC  11.0
178
007A:  GOTO   079
179
....................    i2c_write(0xC0); 
180
007B:  MOVLW  C0
181
007C:  BCF    03.5
182
007D:  MOVWF  26
183
007E:  CALL   019
184
....................    i2c_write(0x12); 
185
007F:  MOVLW  12
186
0080:  MOVWF  26
187
0081:  CALL   019
188
....................    i2c_write(0x80 | 0x24); 
189
0082:  MOVLW  A4
190
0083:  MOVWF  26
191
0084:  CALL   019
192
....................    i2c_stop(); 
193
0085:  BSF    03.5
194
0086:  BSF    11.2
195
0087:  BTFSC  11.2
196
0088:  GOTO   087
197
....................  
198
.................... // **** Write data => Adr($13) = 0x05 **** 
199
.................... // This will tri-state the Y and UV busses on the OV6620, which 
200
.................... // will allow re-programming of the mega8 to proceed at startup 
201
.................... // if needed. 
202
....................  
203
....................    i2c_start();       
204
0089:  BSF    11.0
205
008A:  BTFSC  11.0
206
008B:  GOTO   08A
207
....................    i2c_write(0xC0); 
208
008C:  MOVLW  C0
209
008D:  BCF    03.5
210
008E:  MOVWF  26
211
008F:  CALL   019
212
....................    i2c_write(0x13); 
213
0090:  MOVLW  13
214
0091:  MOVWF  26
215
0092:  CALL   019
216
....................    i2c_write(0x05); 
217
0093:  MOVLW  05
218
0094:  MOVWF  26
219
0095:  CALL   019
220
....................    i2c_stop(); 
221
0096:  BSF    03.5
222
0097:  BSF    11.2
223
0098:  BTFSC  11.2
224
0099:  GOTO   098
225
....................     
226
....................    Delay_ms(250); 
227
009A:  MOVLW  FA
228
009B:  BCF    03.5
229
009C:  MOVWF  26
230
009D:  CALL   004
231
....................  
232
.................... //**** Write data => Adr($3F) = 0x42 **** 
233
.................... // This will turn on the external clock for the mega8 to use. 
234
....................  
235
....................    i2c_start();      
236
009E:  BSF    03.5
237
009F:  BSF    11.0
238
00A0:  BTFSC  11.0
239
00A1:  GOTO   0A0
240
....................    i2c_write(0xC0); 
241
00A2:  MOVLW  C0
242
00A3:  BCF    03.5
243
00A4:  MOVWF  26
244
00A5:  CALL   019
245
....................    i2c_write(0x3F); 
246
00A6:  MOVLW  3F
247
00A7:  MOVWF  26
248
00A8:  CALL   019
249
....................    i2c_write(0x42); 
250
00A9:  MOVLW  42
251
00AA:  MOVWF  26
252
00AB:  CALL   019
253
....................    i2c_stop(); 
254
00AC:  BSF    03.5
255
00AD:  BSF    11.2
256
00AE:  BTFSC  11.2
257
00AF:  GOTO   0AE
258
....................     
259
.................... // Wait for a short amount of time for the external clock 
260
.................... // to stabilize    
261
....................  
262
....................    Delay_ms(250); 
263
00B0:  MOVLW  FA
264
00B1:  BCF    03.5
265
00B2:  MOVWF  26
266
00B3:  CALL   004
267
....................  
268
....................  
269
....................    output_low(PIN_C0); 
270
00B4:  BCF    25.0
271
00B5:  MOVF   25,W
272
00B6:  BSF    03.5
273
00B7:  MOVWF  07
274
00B8:  BCF    03.5
275
00B9:  BCF    07.0
276
....................     
277
.................... // turn on the mega8 by releasing the reset line 
278
....................    output_high(PIN_C6); 
279
00BA:  BCF    25.6
280
00BB:  MOVF   25,W
281
00BC:  BSF    03.5
282
00BD:  MOVWF  07
283
00BE:  BCF    03.5
284
00BF:  BSF    07.6
285
....................  
286
....................    while(true); 
287
00C0:  GOTO   0C0
288
.................... } 
289
00C1:  SLEEP
290
 
291
Configuration Fuses:
292
   Word  1: 3F39   XT NOWDT NOPUT NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG