Rev 410 | Blame | Compare with Previous | Last modification | View Log | Download
CCS PCM C Compiler, Version 3.245, 27853 22-IV-07 16:12
Filename: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.lst
ROM used: 194 words (5%)
Largest free fragment is 2048
RAM used: 6 (3%) at main() level
7 (4%) worst case
Stack: 1 locations
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 029
0003: NOP
.................... #include ".\camerus.h"
.................... #include <16F873.h>
.................... //////// Standard Header file for the PIC16F873 device ////////////////
.................... #device PIC16F873
.................... #list
....................
.................... #device adc=8
....................
.................... #FUSES NOWDT //No Watch Dog Timer
.................... #FUSES XT //Crystal osc <= 4mhz
.................... #FUSES NOPUT //No Power Up Timer
.................... #FUSES NOPROTECT //Code not protected from reading
.................... #FUSES NOBROWNOUT //No brownout reset
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
.................... #FUSES NOCPD //No EE protection
.................... #FUSES NOWRT //Program memory not write protected
.................... #FUSES NODEBUG //No Debug mode for ICD
....................
.................... #use delay(clock=4000000)
0004: MOVLW 26
0005: MOVWF 04
0006: MOVF 00,W
0007: BTFSC 03.2
0008: GOTO 018
0009: MOVLW 01
000A: MOVWF 21
000B: CLRF 20
000C: DECFSZ 20,F
000D: GOTO 00C
000E: DECFSZ 21,F
000F: GOTO 00B
0010: MOVLW 4A
0011: MOVWF 20
0012: DECFSZ 20,F
0013: GOTO 012
0014: NOP
0015: NOP
0016: DECFSZ 00,F
0017: GOTO 009
0018: RETLW 00
.................... #use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3,force_HW)
0019: BCF 14.7
001A: BCF 0C.3
001B: MOVF 26,W
001C: MOVWF 13
001D: MOVLW 02
001E: BTFSC 14.7
001F: GOTO 027
0020: BTFSS 0C.3
0021: GOTO 020
0022: MOVLW 00
0023: BSF 03.5
0024: BTFSC 11.6
0025: MOVLW 01
0026: BCF 03.5
0027: MOVWF 21
0028: RETLW 00
*
0041: MOVLW FF
0042: BCF 03.5
0043: MOVWF 25
....................
....................
....................
.................... #define CAMERA_ADR 0xC4
....................
....................
.................... void main()
.................... {
*
0029: CLRF 04
002A: MOVLW 1F
002B: ANDWF 03,F
002C: BSF 25.3
002D: MOVF 25,W
002E: BSF 03.5
002F: MOVWF 07
0030: BCF 03.5
0031: BSF 25.4
0032: MOVF 25,W
0033: BSF 03.5
0034: MOVWF 07
0035: MOVLW 01
0036: MOVWF 13
0037: MOVLW 28
0038: BCF 03.5
0039: MOVWF 14
003A: BSF 03.5
003B: BCF 14.7
003C: BCF 14.6
003D: BSF 1F.0
003E: BSF 1F.1
003F: BSF 1F.2
0040: BCF 1F.3
.................... setup_adc_ports(NO_ANALOGS);
*
0044: BSF 03.5
0045: BSF 1F.0
0046: BSF 1F.1
0047: BSF 1F.2
0048: BCF 1F.3
.................... setup_adc(ADC_OFF);
0049: BCF 03.5
004A: BCF 1F.0
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
004B: BSF 03.5
004C: MOVF 01,W
004D: ANDLW C7
004E: IORLW 08
004F: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
0050: BCF 03.5
0051: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
0052: MOVLW 00
0053: MOVWF 21
0054: MOVWF 12
0055: MOVLW 00
0056: BSF 03.5
0057: MOVWF 12
....................
.................... output_high(PIN_C0);
0058: BCF 03.5
0059: BCF 25.0
005A: MOVF 25,W
005B: BSF 03.5
005C: MOVWF 07
005D: BCF 03.5
005E: BSF 07.0
.................... output_low(PIN_C6);
005F: BCF 25.6
0060: MOVF 25,W
0061: BSF 03.5
0062: MOVWF 07
0063: BCF 03.5
0064: BCF 07.6
....................
.................... Delay_ms(200);
0065: MOVLW C8
0066: MOVWF 26
0067: CALL 004
.................... output_low(PIN_C0);
0068: BCF 25.0
0069: MOVF 25,W
006A: BSF 03.5
006B: MOVWF 07
006C: BCF 03.5
006D: BCF 07.0
.................... Delay_ms(200);
006E: MOVLW C8
006F: MOVWF 26
0070: CALL 004
.................... output_high(PIN_C0);
0071: BCF 25.0
0072: MOVF 25,W
0073: BSF 03.5
0074: MOVWF 07
0075: BCF 03.5
0076: BSF 07.0
....................
.................... i2c_start(); // Reset
0077: BSF 03.5
0078: BSF 11.0
0079: BTFSC 11.0
007A: GOTO 079
.................... i2c_write(CAMERA_ADR);
007B: MOVLW C4
007C: BCF 03.5
007D: MOVWF 26
007E: CALL 019
.................... i2c_write(0x12);
007F: MOVLW 12
0080: MOVWF 26
0081: CALL 019
.................... i2c_write(0x80 | 0x24);
0082: MOVLW A4
0083: MOVWF 26
0084: CALL 019
.................... i2c_stop();
0085: BSF 03.5
0086: BSF 11.2
0087: BTFSC 11.2
0088: GOTO 087
....................
.................... // **** Write data => Adr($13) = 0x05 ****
.................... // This will tri-state the Y and UV busses on the OV6620, which
.................... // will allow re-programming of the atmega8 to proceed at startup
.................... // if needed.
....................
.................... i2c_start();
0089: BSF 11.0
008A: BTFSC 11.0
008B: GOTO 08A
.................... i2c_write(CAMERA_ADR);
008C: MOVLW C4
008D: BCF 03.5
008E: MOVWF 26
008F: CALL 019
.................... i2c_write(0x13);
0090: MOVLW 13
0091: MOVWF 26
0092: CALL 019
.................... i2c_write(0x05);
0093: MOVLW 05
0094: MOVWF 26
0095: CALL 019
.................... i2c_stop();
0096: BSF 03.5
0097: BSF 11.2
0098: BTFSC 11.2
0099: GOTO 098
....................
.................... Delay_ms(250);
009A: MOVLW FA
009B: BCF 03.5
009C: MOVWF 26
009D: CALL 004
....................
.................... //**** Write data => Adr($3F) = 0x42 ****
.................... // This will turn on the external clock for the atmega8 to use.
....................
.................... i2c_start();
009E: BSF 03.5
009F: BSF 11.0
00A0: BTFSC 11.0
00A1: GOTO 0A0
.................... i2c_write(CAMERA_ADR);
00A2: MOVLW C4
00A3: BCF 03.5
00A4: MOVWF 26
00A5: CALL 019
.................... i2c_write(0x3F);
00A6: MOVLW 3F
00A7: MOVWF 26
00A8: CALL 019
.................... i2c_write(0x42);
00A9: MOVLW 42
00AA: MOVWF 26
00AB: CALL 019
.................... i2c_stop();
00AC: BSF 03.5
00AD: BSF 11.2
00AE: BTFSC 11.2
00AF: GOTO 0AE
....................
.................... // Wait for a short amount of time for the external clock
.................... // to stabilize
....................
.................... Delay_ms(250);
00B0: MOVLW FA
00B1: BCF 03.5
00B2: MOVWF 26
00B3: CALL 004
....................
....................
.................... output_low(PIN_C0);
00B4: BCF 25.0
00B5: MOVF 25,W
00B6: BSF 03.5
00B7: MOVWF 07
00B8: BCF 03.5
00B9: BCF 07.0
....................
.................... // turn on the mega8 by releasing the reset line
.................... output_high(PIN_C6);
00BA: BCF 25.6
00BB: MOVF 25,W
00BC: BSF 03.5
00BD: MOVWF 07
00BE: BCF 03.5
00BF: BSF 07.6
....................
.................... while(true);
00C0: GOTO 0C0
.................... }
00C1: SLEEP
Configuration Fuses:
Word 1: 3F39 XT NOWDT NOPUT NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG