Subversion Repositories svnkaklik

Rev

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

Rev Author Line No. Line
251 kaklik 1
CCS PCM C Compiler, Version 3.245, 27853               22-IV-07 16:12
199 kaklik 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
....................  
251 kaklik 80
.................... #define  CAMERA_ADR   0xC4 
199 kaklik 81
....................  
251 kaklik 82
....................  
199 kaklik 83
.................... void main() 
84
.................... { 
85
*
86
0029:  CLRF   04
87
002A:  MOVLW  1F
88
002B:  ANDWF  03,F
89
002C:  BSF    25.3
90
002D:  MOVF   25,W
91
002E:  BSF    03.5
92
002F:  MOVWF  07
93
0030:  BCF    03.5
94
0031:  BSF    25.4
95
0032:  MOVF   25,W
96
0033:  BSF    03.5
97
0034:  MOVWF  07
98
0035:  MOVLW  01
99
0036:  MOVWF  13
100
0037:  MOVLW  28
101
0038:  BCF    03.5
102
0039:  MOVWF  14
103
003A:  BSF    03.5
104
003B:  BCF    14.7
105
003C:  BCF    14.6
106
003D:  BSF    1F.0
107
003E:  BSF    1F.1
108
003F:  BSF    1F.2
109
0040:  BCF    1F.3
110
....................    setup_adc_ports(NO_ANALOGS); 
111
*
112
0044:  BSF    03.5
113
0045:  BSF    1F.0
114
0046:  BSF    1F.1
115
0047:  BSF    1F.2
116
0048:  BCF    1F.3
117
....................    setup_adc(ADC_OFF); 
118
0049:  BCF    03.5
119
004A:  BCF    1F.0
120
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
121
004B:  BSF    03.5
122
004C:  MOVF   01,W
123
004D:  ANDLW  C7
124
004E:  IORLW  08
125
004F:  MOVWF  01
126
....................    setup_timer_1(T1_DISABLED); 
127
0050:  BCF    03.5
128
0051:  CLRF   10
129
....................    setup_timer_2(T2_DISABLED,0,1); 
130
0052:  MOVLW  00
131
0053:  MOVWF  21
132
0054:  MOVWF  12
133
0055:  MOVLW  00
134
0056:  BSF    03.5
135
0057:  MOVWF  12
136
....................  
137
....................    output_high(PIN_C0); 
138
0058:  BCF    03.5
139
0059:  BCF    25.0
140
005A:  MOVF   25,W
141
005B:  BSF    03.5
142
005C:  MOVWF  07
143
005D:  BCF    03.5
144
005E:  BSF    07.0
145
....................    output_low(PIN_C6); 
146
005F:  BCF    25.6
147
0060:  MOVF   25,W
148
0061:  BSF    03.5
149
0062:  MOVWF  07
150
0063:  BCF    03.5
151
0064:  BCF    07.6
251 kaklik 152
....................  
199 kaklik 153
....................    Delay_ms(200); 
154
0065:  MOVLW  C8
155
0066:  MOVWF  26
156
0067:  CALL   004
157
....................    output_low(PIN_C0); 
158
0068:  BCF    25.0
159
0069:  MOVF   25,W
160
006A:  BSF    03.5
161
006B:  MOVWF  07
162
006C:  BCF    03.5
163
006D:  BCF    07.0
164
....................    Delay_ms(200); 
165
006E:  MOVLW  C8
166
006F:  MOVWF  26
167
0070:  CALL   004
168
....................    output_high(PIN_C0); 
169
0071:  BCF    25.0
170
0072:  MOVF   25,W
171
0073:  BSF    03.5
172
0074:  MOVWF  07
173
0075:  BCF    03.5
174
0076:  BSF    07.0
175
....................  
176
....................    i2c_start();      // Reset 
177
0077:  BSF    03.5
178
0078:  BSF    11.0
179
0079:  BTFSC  11.0
180
007A:  GOTO   079
251 kaklik 181
....................    i2c_write(CAMERA_ADR); 
182
007B:  MOVLW  C4
199 kaklik 183
007C:  BCF    03.5
184
007D:  MOVWF  26
185
007E:  CALL   019
186
....................    i2c_write(0x12); 
187
007F:  MOVLW  12
188
0080:  MOVWF  26
189
0081:  CALL   019
190
....................    i2c_write(0x80 | 0x24); 
191
0082:  MOVLW  A4
192
0083:  MOVWF  26
193
0084:  CALL   019
194
....................    i2c_stop(); 
195
0085:  BSF    03.5
196
0086:  BSF    11.2
197
0087:  BTFSC  11.2
198
0088:  GOTO   087
199
....................  
200
.................... // **** Write data => Adr($13) = 0x05 **** 
201
.................... // This will tri-state the Y and UV busses on the OV6620, which 
251 kaklik 202
.................... // will allow re-programming of the atmega8 to proceed at startup 
199 kaklik 203
.................... // if needed. 
204
....................  
251 kaklik 205
....................    i2c_start(); 
199 kaklik 206
0089:  BSF    11.0
207
008A:  BTFSC  11.0
208
008B:  GOTO   08A
251 kaklik 209
....................    i2c_write(CAMERA_ADR); 
210
008C:  MOVLW  C4
199 kaklik 211
008D:  BCF    03.5
212
008E:  MOVWF  26
213
008F:  CALL   019
214
....................    i2c_write(0x13); 
215
0090:  MOVLW  13
216
0091:  MOVWF  26
217
0092:  CALL   019
218
....................    i2c_write(0x05); 
219
0093:  MOVLW  05
220
0094:  MOVWF  26
221
0095:  CALL   019
222
....................    i2c_stop(); 
223
0096:  BSF    03.5
224
0097:  BSF    11.2
225
0098:  BTFSC  11.2
226
0099:  GOTO   098
251 kaklik 227
....................  
199 kaklik 228
....................    Delay_ms(250); 
229
009A:  MOVLW  FA
230
009B:  BCF    03.5
231
009C:  MOVWF  26
232
009D:  CALL   004
233
....................  
234
.................... //**** Write data => Adr($3F) = 0x42 **** 
251 kaklik 235
.................... // This will turn on the external clock for the atmega8 to use. 
199 kaklik 236
....................  
251 kaklik 237
....................    i2c_start(); 
199 kaklik 238
009E:  BSF    03.5
239
009F:  BSF    11.0
240
00A0:  BTFSC  11.0
241
00A1:  GOTO   0A0
251 kaklik 242
....................    i2c_write(CAMERA_ADR); 
243
00A2:  MOVLW  C4
199 kaklik 244
00A3:  BCF    03.5
245
00A4:  MOVWF  26
246
00A5:  CALL   019
247
....................    i2c_write(0x3F); 
248
00A6:  MOVLW  3F
249
00A7:  MOVWF  26
250
00A8:  CALL   019
251
....................    i2c_write(0x42); 
252
00A9:  MOVLW  42
253
00AA:  MOVWF  26
254
00AB:  CALL   019
255
....................    i2c_stop(); 
256
00AC:  BSF    03.5
257
00AD:  BSF    11.2
258
00AE:  BTFSC  11.2
259
00AF:  GOTO   0AE
251 kaklik 260
....................  
199 kaklik 261
.................... // Wait for a short amount of time for the external clock 
251 kaklik 262
.................... // to stabilize 
199 kaklik 263
....................  
264
....................    Delay_ms(250); 
265
00B0:  MOVLW  FA
266
00B1:  BCF    03.5
267
00B2:  MOVWF  26
268
00B3:  CALL   004
269
....................  
270
....................  
271
....................    output_low(PIN_C0); 
272
00B4:  BCF    25.0
273
00B5:  MOVF   25,W
274
00B6:  BSF    03.5
275
00B7:  MOVWF  07
276
00B8:  BCF    03.5
277
00B9:  BCF    07.0
251 kaklik 278
....................  
199 kaklik 279
.................... // turn on the mega8 by releasing the reset line 
280
....................    output_high(PIN_C6); 
281
00BA:  BCF    25.6
282
00BB:  MOVF   25,W
283
00BC:  BSF    03.5
284
00BD:  MOVWF  07
285
00BE:  BCF    03.5
286
00BF:  BSF    07.6
287
....................  
288
....................    while(true); 
289
00C0:  GOTO   0C0
290
.................... } 
291
00C1:  SLEEP
292
 
293
Configuration Fuses:
294
   Word  1: 3F39   XT NOWDT NOPUT NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG