Subversion Repositories svnkaklik

Compare Revisions

No changes between revisions

Ignore whitespace Rev 658 → Rev 659

/programy/C/PIC/mereni/vyskomer_drak/main.BAK
0,0 → 1,21
#include "D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h"
 
#DEFINE SCLK PIN_A2
#DEFINE DOUT
#DEFINE DIN PIN_A1
#include "MS5534A.c"
void main()
{
output_high(pin_B2);
while(true)
{
while(!input(pin_B1))
{
output_high(pin_A3);
Delay_ms(50);
}
output_low(pin_A3);
Delay_ms(50);
}
 
}
/programy/C/PIC/mereni/vyskomer_drak/main.HEX
0,0 → 1,10
:1000000000308A001928000012308400000803190B
:10001000182801308D008C018C0B0C288D0B0B28BF
:100020004A308C008C0B122800000000800B09283D
:10003000003484011F3083058316061183120615D0
:1000400083168614831286182D2883168511831231
:1000500085153230920004202028831685118312E2
:0C0060008511323092000420202863003B
:02400E00F93F78
:00000001FF
;PIC16F84
/programy/C/PIC/mereni/vyskomer_drak/main.LST
0,0 → 1,204
CCS PCW C Compiler, Version 3.110, 15448
 
Filename: d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\main.LST
 
ROM used: 54 (5%)
Largest free fragment is 970
RAM used: 5 (7%) at main() level
6 (9%) worst case
Stack: 1 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 019
0003: NOP
.................... #include "D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h"
.................... #include <16F84.h>
.................... //////// Standard Header file for the PIC16F84 device ////////////////
.................... #device PIC16F84
.................... #list
....................
.................... #use delay(clock=4000000)
0004: MOVLW 12
0005: MOVWF 04
0006: MOVF 00,W
0007: BTFSC 03.2
0008: GOTO 018
0009: MOVLW 01
000A: MOVWF 0D
000B: CLRF 0C
000C: DECFSZ 0C,F
000D: GOTO 00C
000E: DECFSZ 0D,F
000F: GOTO 00B
0010: MOVLW 4A
0011: MOVWF 0C
0012: DECFSZ 0C,F
0013: GOTO 012
0014: NOP
0015: NOP
0016: DECFSZ 00,F
0017: GOTO 009
0018: RETLW 00
.................... #fuses XT,NOWDT
....................
....................
....................
.................... #DEFINE SCLK PIN_A2
.................... #DEFINE DOUT PIN_A3
.................... #DEFINE DIN PIN_A1
.................... #include "MS5534A.c"
....................
.................... #DEFINE CLK 250
.................... #DEFINE WORD1 0b111010101000
.................... #DEFINE WORD2 0b111010110000
.................... #DEFINE WORD3 0b111011001000
.................... #DEFINE WORD4 0b111011010000
....................
.................... void send_bit(bit)
.................... {
.................... output_bit(DIN,bit);
.................... output_high(SCLK);
.................... Delay_us(CLK);
.................... output_low(SCLK);
.................... }
.................... int1 read_bit()
.................... {
.................... output_high(SCLK);
.................... Delay_us(CLK);
.................... output_low(SCLK);
.................... if (input(DOUT)) return true;
.................... if (!input(DOUT)) return false;
.................... }
....................
.................... void read_byte(*byte_r)
.................... {
.................... int i;
....................
.................... for(i=0;i>=7;i++)
.................... {
.................... *byte_r = read_bit();
.................... *byte_r << 1;
.................... }
.................... }
....................
.................... void send_command(command,width)
.................... {
.................... int i;
.................... for (i=width;i>=0;i--)
.................... {
.................... send_bit(bit_test(command,0));
.................... command >>1;
.................... }
.................... }
....................
.................... void bar_reset()
.................... {
.................... int8 i;
....................
.................... for(i=0;i>=20;i++) send_bit(Bit_test(i,0));
.................... }
....................
.................... int16 bar_con_pre()
.................... {
.................... int16 word;
....................
.................... send_command(0b1111010000,9);
....................
.................... Delay_ms(10);
....................
.................... While(input(DOUT)) Delay_us(100);
....................
.................... read_byte(&word);
.................... word << 8;
.................... read_byte(&word);
....................
.................... return word;
.................... }
....................
.................... int16 bar_con_term()
.................... {
.................... int16 word;
....................
.................... send_command(0b1111001000,9);
....................
.................... Delay_ms(10);
....................
.................... While(input(DOUT)) Delay_us(100);
....................
.................... read_byte(&word);
.................... word << 8;
.................... read_byte(&word);
....................
.................... return word;
.................... }
....................
.................... int16 bar_read_cal(command)
.................... {
.................... int16 word;
....................
.................... send_command(command,11);
....................
.................... Delay_ms(10);
....................
.................... While(input(DOUT)) Delay_us(100);
....................
.................... read_byte(&word);
.................... word << 8;
.................... read_byte(&word);
....................
.................... return word;
.................... }
....................
....................
....................
....................
....................
....................
....................
.................... void main()
.................... {
0019: CLRF 04
001A: MOVLW 1F
001B: ANDWF 03,F
.................... output_high(pin_B2);
001C: BSF 03.5
001D: BCF 06.2
001E: BCF 03.5
001F: BSF 06.2
.................... while(true)
.................... {
.................... while(!input(pin_B1))
0020: BSF 03.5
0021: BSF 06.1
0022: BCF 03.5
0023: BTFSC 06.1
0024: GOTO 02D
.................... {
.................... output_high(pin_A3);
0025: BSF 03.5
0026: BCF 05.3
0027: BCF 03.5
0028: BSF 05.3
.................... Delay_ms(50);
0029: MOVLW 32
002A: MOVWF 12
002B: CALL 004
.................... }
002C: GOTO 020
.................... output_low(pin_A3);
002D: BSF 03.5
002E: BCF 05.3
002F: BCF 03.5
0030: BCF 05.3
.................... Delay_ms(50);
0031: MOVLW 32
0032: MOVWF 12
0033: CALL 004
.................... }
0034: GOTO 020
....................
.................... }
....................
0035: SLEEP
/programy/C/PIC/mereni/vyskomer_drak/main.PJT
0,0 → 1,32
[PROJECT]
Target=main.HEX
Development_Mode=
Processor=0x684A
ToolSuite=CCS
 
[Directories]
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr
Library=
LinkerScript=
 
[Target Data]
FileList=main.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[main.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=main.c
 
[Windows]
0=0000 main.c 0 0 796 451 3 0
 
/programy/C/PIC/mereni/vyskomer_drak/main.SYM
0,0 → 1,28
00C @SCRATCH
00D @SCRATCH
00D _RETURN_
00E @SCRATCH
00F @SCRATCH
010 @SCRATCH
012 delay_ms.P1
delay_us.P1
send_bit.bit
read_byte.byte_r
read_byte.i
send_command.command
send_command.width
send_command.i
bar_reset.i
-000 bar_con_pre.word
-000 bar_con_term.word
bar_read_cal.command
-000 bar_read_cal.word
 
0004 delay_ms
0019 main
 
Project Files:
d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\main.c
D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h
C:\PROGRAM FILES\PICC\devices\16F84.h
d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\MS5534A.c
/programy/C/PIC/mereni/vyskomer_drak/main.c
0,0 → 1,21
#include "D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h"
 
#DEFINE SCLK PIN_A2
#DEFINE DOUT PIN_A3
#DEFINE DIN PIN_A1
#include "MS5534A.c"
void main()
{
output_high(pin_B2);
while(true)
{
while(!input(pin_B1))
{
output_high(pin_A3);
Delay_ms(50);
}
output_low(pin_A3);
Delay_ms(50);
}
 
}
/programy/C/PIC/mereni/vyskomer_drak/main.cod
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/mereni/vyskomer_drak/main.err
0,0 → 1,0
No Errors
/programy/C/PIC/mereni/vyskomer_drak/main.h
0,0 → 1,4
#include <16F84.h>
#use delay(clock=4000000)
#fuses XT,NOWDT
 
/programy/C/PIC/mereni/vyskomer_drak/main.sta
0,0 → 1,29
 
ROM used: 54 (5%)
970 (95%) including unused fragments
 
0 Average locations per line
1 Average locations per statement
 
RAM used: 5 (7%) at main() level
6 (9%) worst case
 
Lines Stmts % Files
----- ----- --- -----
22 9 17 d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\main.c
5 0 0 D:\@Kaklik\programy\PIC_C\mereni\vyskomer_drak\main.h
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h
108 45 71 d:\@kaklik\programy\pic_c\mereni\vyskomer_drak\MS5534A.c
----- -----
492 108 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 39 1 delay_ms
0 29 54 0 main
 
Segment Used Free
--------- ---- ----
0000-0003 4 0
0004-03FF 50 970
 
/programy/C/PIC/mereni/vyskomer_drak/main.tre
0,0 → 1,5
ÀÄmain
ÀÄmain 0/29 Ram=0
ÃÄ??0??
ÃÄdelay_ms 0/21 Ram=1
ÀÄdelay_ms 0/21 Ram=1
/programy/C/PIC/mereni/vyskomer_drak/ms5534a.BAK
0,0 → 1,107
 
#DEFINE CLK 250
#DEFINE WORD1 0b111010101000
#DEFINE WORD2 0b111010110000
#DEFINE WORD3 0b111011001000
#DEFINE WORD4 0b111011010000
 
void send_bit(bit)
{
output_bit(DIN,bit);
output_high(SCLK);
Delay_us(CLK);
output_low(SCLK);
}
int1 read_bit()
{
output_high(SCLK);
Delay_us(CLK);
output_low(SCLK);
if (input(DOUT)) return true;
if (!input(DOUT)) return false;
}
 
void read_byte(*byte_r)
{
int i;
 
for(i=0;i>=7;i++)
{
*byte_r = read_bit();
*byte_r << 1;
}
}
 
void send_command(command,width)
{
int i;
for (i=width;i>=0;i--)
{
send_bit(bit_test(command,0));
command >>1;
}
}
 
void bar_reset()
{
int8 i;
 
for(i=0;i>=20;i++) send_bit(Bit_test(i,0));
}
 
int16 bar_con_pre()
{
int16 word;
send_command(0b1111010000,9);
 
Delay_ms(10);
 
While(input(DOUT)) Delay_us(100);
 
read_byte(&word);
word << 8;
read_byte(&word);
 
return word;
}
 
int16 bar_con_term()
{
int16 word;
 
send_command(0b1111001000,9);
 
Delay_ms(10);
 
While(input(DOUT)) Delay_us(100);
 
read_byte(&word);
word << 8;
read_byte(&word);
 
return word;
}
 
int16 bar_read_cal(command)
{
int16 word;
 
send_command(command,11);
 
Delay_ms(10);
 
While(input(DOUT)) Delay_us(100);
 
read_byte(&word);
word << 8;
read_byte(&word);
 
return word;
}
 
 
 
 
 
 
/programy/C/PIC/mereni/vyskomer_drak/ms5534a.c
0,0 → 1,107
 
#DEFINE CLK 250
#DEFINE WORD1 0b111010101000
#DEFINE WORD2 0b111010110000
#DEFINE WORD3 0b111011001000
#DEFINE WORD4 0b111011010000
 
void send_bit(bit)
{
output_bit(DIN,bit);
output_high(SCLK);
Delay_us(CLK);
output_low(SCLK);
}
int1 read_bit()
{
output_high(SCLK);
Delay_us(CLK);
output_low(SCLK);
if (input(DOUT)) return true;
if (!input(DOUT)) return false;
}
 
void read_byte(*byte_r)
{
int i;
 
for(i=0;i>=7;i++)
{
*byte_r = read_bit();
*byte_r << 1;
}
}
 
void send_command(command,width)
{
int i;
for (i=width;i>=0;i--)
{
send_bit(bit_test(command,0));
command >>1;
}
}
 
void bar_reset()
{
int8 i;
 
for(i=0;i>=20;i++) send_bit(Bit_test(i,0));
}
 
int16 bar_con_pre()
{
int16 word;
send_command(0b1111010000,9);
 
Delay_ms(10);
 
While(input(DOUT)) Delay_us(100);
 
read_byte(&word);
word << 8;
read_byte(&word);
 
return word;
}
 
int16 bar_con_term()
{
int16 word;
 
send_command(0b1111001000,9);
 
Delay_ms(10);
 
While(input(DOUT)) Delay_us(100);
 
read_byte(&word);
word << 8;
read_byte(&word);
 
return word;
}
 
int16 bar_read_cal(command)
{
int16 word;
 
send_command(command,11);
 
Delay_ms(10);
 
While(input(DOUT)) Delay_us(100);
 
read_byte(&word);
word << 8;
read_byte(&word);
 
return word;
}
 
 
 
 
 
 
/programy/C/PIC/mereni/vyskomer_drak/prg.bat
0,0 → 1,8
:start
call picpgr stop
call picpgr erase pic16f84
call picpgr program main.hex hex pic16f84
call picpgr run
pause
call picpgr stop
rem goto start
/programy/C/PIC/mereni/vyskomer_drak/run.bat
0,0 → 1,5
call picpgr run
pause
call picpgr stop
pause
run.bat
/programy/C/PIC/mereni/vyskomer_drak/vssver.scc
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