Subversion Repositories svnkaklik

Compare Revisions

No changes between revisions

Ignore whitespace Rev 410 → Rev 659

/programy/C/PIC/PICcam/873/camerus.BAK
0,0 → 1,62
#include ".\camerus.h"
 
#define CAMERA_ADR 0xC0
 
 
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
 
output_high(PIN_C0);
output_low(PIN_C6);
 
Delay_ms(200);
output_low(PIN_C0);
Delay_ms(200);
output_high(PIN_C0);
 
i2c_start(); // Reset
i2c_write(CAMERA_ADR);
i2c_write(0x12);
i2c_write(0x80 | 0x24);
i2c_stop();
 
// **** 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();
i2c_write(CAMERA_ADR);
i2c_write(0x13);
i2c_write(0x05);
i2c_stop();
 
Delay_ms(250);
 
//**** Write data => Adr($3F) = 0x42 ****
// This will turn on the external clock for the atmega8 to use.
 
i2c_start();
i2c_write(CAMERA_ADR);
i2c_write(0x3F);
i2c_write(0x42);
i2c_stop();
 
// Wait for a short amount of time for the external clock
// to stabilize
 
Delay_ms(250);
 
 
output_low(PIN_C0);
 
// turn on the mega8 by releasing the reset line
output_high(PIN_C6);
 
while(true);
}
/programy/C/PIC/PICcam/873/camerus.c
0,0 → 1,62
#include ".\camerus.h"
 
#define CAMERA_ADR 0xC4
 
 
void main()
{
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
 
output_high(PIN_C0);
output_low(PIN_C6);
 
Delay_ms(200);
output_low(PIN_C0);
Delay_ms(200);
output_high(PIN_C0);
 
i2c_start(); // Reset
i2c_write(CAMERA_ADR);
i2c_write(0x12);
i2c_write(0x80 | 0x24);
i2c_stop();
 
// **** 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();
i2c_write(CAMERA_ADR);
i2c_write(0x13);
i2c_write(0x05);
i2c_stop();
 
Delay_ms(250);
 
//**** Write data => Adr($3F) = 0x42 ****
// This will turn on the external clock for the atmega8 to use.
 
i2c_start();
i2c_write(CAMERA_ADR);
i2c_write(0x3F);
i2c_write(0x42);
i2c_stop();
 
// Wait for a short amount of time for the external clock
// to stabilize
 
Delay_ms(250);
 
 
output_low(PIN_C0);
 
// turn on the mega8 by releasing the reset line
output_high(PIN_C6);
 
while(true);
}
/programy/C/PIC/PICcam/873/camerus.cof
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/programy/C/PIC/PICcam/873/camerus.hex
0,0 → 1,28
:1000000000308A00292800002630840000080319E7
:1000100018280130A100A001A00B0C28A10B0B286F
:100020004A30A000A00B122800000000800B092815
:10003000003494138C11260893000230941B272857
:100040008C1D202800308316111B01308312A10063
:10005000003484011F308305A51525088316870009
:100060008312251625088316870001309300283057
:10007000831294008316941314131F149F141F15D6
:100080009F11FF308312A50083161F149F141F15A4
:100090009F1183121F1083160108C7390838810089
:1000A000831290010030A10092000030831692006C
:1000B0008312251025088316870083120714251341
:1000C00025088316870083120713C830A600042072
:1000D000251025088316870083120710C830A60054
:1000E0000420251025088316870083120714831621
:1000F000111411187928C4308312A6001920123067
:10010000A6001920A430A600192083161115111974
:100110008728111411188A28C4308312A6001920C8
:100120001330A60019200530A600192083161115DA
:1001300011199828FA308312A6000420831611148E
:100140001118A028C4308312A60019203F30A60041
:1001500019204230A6001920831611151119AE2856
:10016000FA308312A6000420251025088316870084
:10017000831207102513250883168700831207179B
:04018000C028630030
:02400E00393F38
:00000001FF
;PIC16F873
/programy/C/PIC/PICcam/873/camerus.lst
0,0 → 1,294
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
/programy/C/PIC/PICcam/873/camerus.sta
0,0 → 1,30
 
ROM used: 194 (5%)
194 (5%) including unused fragments
 
1 Average locations per line
6 Average locations per statement
 
RAM used: 6 (3%) at main() level
7 (4%) worst case
 
Lines Stmts % Files
----- ----- --- -----
63 32 100 D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c
17 0 0 D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.h
244 0 0 C:\Program Files\PICC\devices\16F873.h
----- -----
648 64 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 11 1 @delay_ms1
0 16 8 1 @I2C_WRITEU_1_59_60_4000000
0 153 79 0 main
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-007FF 190 1854
00800-00FFF 0 2048
 
/programy/C/PIC/PICcam/873/camerus.PJT
0,0 → 1,40
[PROJECT]
Target=camerus.HEX
Development_Mode=
Processor=0x873F
ToolSuite=CCS
 
[Directories]
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\Dr
Library=
LinkerScript=
 
[Target Data]
FileList=D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[camerus.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=camerus.c
 
[Windows]
0=0000 camerus.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c
2=
3=C:\Program Files\PICC\devices\16F873.h
4=
[Units]
Count=1
1=D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c (main)
/programy/C/PIC/PICcam/873/camerus.err
0,0 → 1,2
No Errors
0 Errors, 0 Warnings.
/programy/C/PIC/PICcam/873/camerus.h
0,0 → 1,16
#include <16F873.h>
#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)
#use i2c(Master,Fast,sda=PIN_C4,scl=PIN_C3,force_HW)
 
/programy/C/PIC/PICcam/873/camerus.sym
0,0 → 1,44
015 CCP_1_LOW
015-016 CCP_1
016 CCP_1_HIGH
01B CCP_2_LOW
01B-01C CCP_2
01C CCP_2_HIGH
020 @SCRATCH
021 @SCRATCH
021 _RETURN_
022 @SCRATCH
023 @SCRATCH
024 @SCRATCH
025 @TRIS_C
026 @I2C_WRITEU_1_59_60_4000000.P1
026 @delay_ms1.P2
 
0004 @delay_ms1
0019 @I2C_WRITEU_1_59_60_4000000
0029 main
0029 @cinit
 
Project Files:
D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c
D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.h
C:\Program Files\PICC\devices\16F873.h
 
Units:
D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.c (main)
 
Compiler Settings:
Processor: PIC16F873
Pointer Size: 8
ADC Range: 0-255
Opt Level: 9
Short,Int,Long: 1,8,16
 
Output Files:
Errors: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.err
INHX8: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.hex
Symbols: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.sym
List: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.lst
Debug/COFF: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.cof
Call Tree: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.tre
Statistics: D:\KAKLIK\projekty\programy\PIC_C\PICcam\873\camerus.sta
/programy/C/PIC/PICcam/873/camerus.tre
0,0 → 1,16
ÀÄcamerus
ÀÄmain 0/153 Ram=0
ÃÄ??0??
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1
ÃÄ@I2C_WRITEU_1_59_60_4000000 0/16 Ram=1
ÀÄ@delay_ms1 0/21 Ram=1