Subversion Repositories svnkaklik

Compare Revisions

No changes between revisions

Ignore whitespace Rev 5 → Rev 6

/programy/PIC_C/mereni/PS2mys/PIC16F84/RUN.PIF
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/PIC_C/mereni/PS2mys/PIC16F84/Run.BAT
0,0 → 1,8
@echo off
:loop
picpgr reset PIC16F84 lpt2
picpgr run lpt2
pause
picpgr stop lpt2
pause
goto loop
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.BAK
0,0 → 1,57
#include "main.h"
#include "c:\library\kaklik\CSS\PS2.c"
 
#define SIGN_X 4
 
void trigger()
{
output_high(PIN_A0);
output_low(PIN_A0);
delay_us(100);
output_high(PIN_A0);
}
 
void flash_red() // blikne ledkou
{
output_high(LED_red);
Delay_ms(BLIK);
output_low(LED_red);
}
 
void flash_yellow() // blikne ledkou
{
output_high(LED_yellow);
Delay_ms(BLIK);
output_low(LED_yellow);
}
 
void main()
{
int8 X,y,tl=0;
int8 X_old,y_old,tl_old=0;
 
Delay_ms(500);
send(ENABLE_DATA_REPORTING);
 
while(true)
{
tl = read_byte(PRVNI);
x = read_byte(DRUHY);
y = read_byte(TRETI);
trigger();
 
 
if (bit_test(tl, SIGN_X))
{
output_high(LED_red);
output_low(LED_yellow);
}
else
{
output_high(LED_yellow);
output_low(LED_red);
}
}
}
 
 
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.HEX
0,0 → 1,38
:1000000000308A00D128000016308400000803194F
:10001000182801308D008C018C0B0C288D0B0B28BF
:100020004A308C008C0B122800000000800B09283D
:10003000DB28970183160614861083128610213060
:100040008C008C0B212883160610831206100630B4
:100050008C008C0B29280000831686148312861CC2
:100060002C2896011608073C031C52288316861478
:1000700083128618362815080139003A031D4228D4
:10008000061043280614831606108312150801393A
:1000900097070310950C831686148312861C4B2831
:1000A000960A322883168614831286185228170857
:1000B000FF3A0139003A031D5F2806106028061434
:1000C0008316061086148312861868288316622801
:1000D00069288316861483128618692806148316E5
:1000E00006108614831286187728831671287828BC
:1000F000831606148312E0289601160203188D2831
:10010000831686148312861C8A288316061483128B
:1001100006188B289601960A7D288316861483126A
:1001200086188D2883160614831206188D288316C8
:1001300086148312861C9728950196011608073CA1
:10014000031CBD288316861483128618A228031068
:10015000950C8316061400308312061801308C00AB
:100160000C0C8C0103188C170C089504831686144C
:100170008312861CB628960A9E2815088D00003426
:1001800083160510831205148316051083120510BB
:1001900021308C008C0BCA2883160510831205149D
:1001A000FC2884011F3083059101940102309500E1
:1001B000FA3096000428950BD828F43095001928B9
:1001C000E83083160317FF00831203137C200D0809
:1001D0009100023083160317FF00831203137C2063
:1001E0000D088F00023083160317FF0083120313DC
:1001F0007C200D089000C028111E072983160511C8
:100200008312051583168511831285110F29831614
:100210008511831285158316051183120511E028B7
:02022000630079
:02400E00F93F78
:00000001FF
;PIC16F84
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.LST
0,0 → 1,474
CCS PCW C Compiler, Version 3.110, 15448
 
Filename: d:\@kaklik\programy\pic_c\ps2mys\main.LST
 
ROM used: 273 (27%)
Largest free fragment is 751
RAM used: 9 (13%) at main() level
12 (18%) worst case
Stack: 1 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 0D1
0003: NOP
.................... #include "D:\@Kaklik\programy\PIC_C\PS2mys\main.h"
.................... #include <16F84.h>
.................... //////// Standard Header file for the PIC16F84 device ////////////////
.................... #device PIC16F84
.................... #list
....................
.................... #use delay(clock=4000000)
0004: MOVLW 16
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: GOTO 0DB (RETURN)
.................... #fuses XT,NOWDT
....................
.................... #DEFINE DATA PIN_B0 // musi byt definovan kanal DATA
.................... #DEFINE CLK PIN_B1 // a taky hodiny CLK
....................
.................... #define PRVNI 1000 // nastaveni prodlevy pred zacatkem vysilani bajtu
.................... #define DRUHY 2
.................... #define TRETI DRUHY
....................
.................... // prikazy
.................... #define RESET 0xFF
.................... #define ENABLE_DATA_REPORTING 0xF4
.................... #define READ_DATA 0xEB
.................... #define STATUS_REQUEST 0xE9
.................... #define SET_REMOTE_MODE 0xF0
.................... #define SET_STREAM_MODE 0xEA
.................... #define GET_DEVICE_ID 0xF2
....................
.................... #DEFINE LED_yellow PIN_A3
.................... #DEFINE LED_red PIN_A2
....................
.................... #DEFINE BLIK 120 // doba rozsviceni led
....................
.................... #include "PS2.c"
.................... // Modul pro komunikaci s Mysi
....................
.................... void send(byte command)
.................... {
.................... int n;
0019: CLRF 17
.................... int parity=0;
....................
.................... //Request-to-send
.................... output_float(DATA);
001A: BSF 03.5
001B: BSF 06.0
.................... output_low(CLK);
001C: BCF 06.1
001D: BCF 03.5
001E: BCF 06.1
.................... delay_us(100);
001F: MOVLW 21
0020: MOVWF 0C
0021: DECFSZ 0C,F
0022: GOTO 021
.................... // start bit
.................... output_low(DATA);
0023: BSF 03.5
0024: BCF 06.0
0025: BCF 03.5
0026: BCF 06.0
.................... delay_us(20);
0027: MOVLW 06
0028: MOVWF 0C
0029: DECFSZ 0C,F
002A: GOTO 029
002B: NOP
.................... while(!input(CLK));
002C: BSF 03.5
002D: BSF 06.1
002E: BCF 03.5
002F: BTFSS 06.1
0030: GOTO 02C
.................... // 8 bitu
.................... for(n=0; n<8; n++)
0031: CLRF 16
0032: MOVF 16,W
0033: SUBLW 07
0034: BTFSS 03.0
0035: GOTO 052
.................... {
.................... while(input(CLK));
0036: BSF 03.5
0037: BSF 06.1
0038: BCF 03.5
0039: BTFSC 06.1
003A: GOTO 036
.................... output_bit(DATA, command & 1);
003B: MOVF 15,W
003C: ANDLW 01
003D: XORLW 00
003E: BTFSS 03.2
003F: GOTO 042
0040: BCF 06.0
0041: GOTO 043
0042: BSF 06.0
0043: BSF 03.5
0044: BCF 06.0
.................... parity += command & 1;
0045: BCF 03.5
0046: MOVF 15,W
0047: ANDLW 01
0048: ADDWF 17,F
.................... command>>=1;
0049: BCF 03.0
004A: RRF 15,F
.................... while(!input(CLK));
004B: BSF 03.5
004C: BSF 06.1
004D: BCF 03.5
004E: BTFSS 06.1
004F: GOTO 04B
.................... };
0050: INCF 16,F
0051: GOTO 032
.................... // parita
.................... while(input(CLK));
0052: BSF 03.5
0053: BSF 06.1
0054: BCF 03.5
0055: BTFSC 06.1
0056: GOTO 052
.................... output_bit(DATA, ~parity & 1);
0057: MOVF 17,W
0058: XORLW FF
0059: ANDLW 01
005A: XORLW 00
005B: BTFSS 03.2
005C: GOTO 05F
005D: BCF 06.0
005E: GOTO 060
005F: BSF 06.0
0060: BSF 03.5
0061: BCF 06.0
.................... while(!input(CLK));
0062: BSF 06.1
0063: BCF 03.5
0064: BTFSC 06.1
0065: GOTO 068
0066: BSF 03.5
0067: GOTO 062
0068: GOTO 069
.................... // stop bit
.................... while(input(CLK));
0069: BSF 03.5
006A: BSF 06.1
006B: BCF 03.5
006C: BTFSC 06.1
006D: GOTO 069
.................... output_bit(DATA, 1);
006E: BSF 06.0
006F: BSF 03.5
0070: BCF 06.0
.................... while(!input(CLK));
0071: BSF 06.1
0072: BCF 03.5
0073: BTFSC 06.1
0074: GOTO 077
0075: BSF 03.5
0076: GOTO 071
0077: GOTO 078
.................... output_float(DATA);
0078: BSF 03.5
0079: BSF 06.0
007A: BCF 03.5
007B: GOTO 0E0 (RETURN)
.................... }
....................
....................
.................... int8 read_byte(int8 const poradi)
.................... {
.................... int8 bajt;
.................... int8 i;
....................
.................... // cekani na komunikacni klid
.................... for (i=0; i<poradi; i++)
007C: CLRF 16
007D: SUBWF 16,W
007E: BTFSC 03.0
007F: GOTO 08D
.................... {
.................... if (!input(CLK) || !input(DATA)) i=0;
0080: BSF 03.5
0081: BSF 06.1
0082: BCF 03.5
0083: BTFSS 06.1
0084: GOTO 08A
0085: BSF 03.5
0086: BSF 06.0
0087: BCF 03.5
0088: BTFSC 06.0
0089: GOTO 08B
008A: CLRF 16
.................... };
008B: INCF 16,F
008C: GOTO 07D
....................
.................... // cekani na startbit
.................... while(input(CLK) || input(DATA));
008D: BSF 03.5
008E: BSF 06.1
008F: BCF 03.5
0090: BTFSC 06.1
0091: GOTO 08D
0092: BSF 03.5
0093: BSF 06.0
0094: BCF 03.5
0095: BTFSC 06.0
0096: GOTO 08D
.................... while(!input(CLK));
0097: BSF 03.5
0098: BSF 06.1
0099: BCF 03.5
009A: BTFSS 06.1
009B: GOTO 097
....................
.................... bajt = 0;
009C: CLRF 15
.................... for(i=0; i<8; i++)
009D: CLRF 16
009E: MOVF 16,W
009F: SUBLW 07
00A0: BTFSS 03.0
00A1: GOTO 0BD
.................... {
.................... while(input(CLK)); // ceka na nulu hodin
00A2: BSF 03.5
00A3: BSF 06.1
00A4: BCF 03.5
00A5: BTFSC 06.1
00A6: GOTO 0A2
....................
.................... bajt >>= 1;
00A7: BCF 03.0
00A8: RRF 15,F
.................... bajt |= input(DATA) << 7;
00A9: BSF 03.5
00AA: BSF 06.0
00AB: MOVLW 00
00AC: BCF 03.5
00AD: BTFSC 06.0
00AE: MOVLW 01
00AF: MOVWF 0C
00B0: RRF 0C,W
00B1: CLRF 0C
00B2: BTFSC 03.0
00B3: BSF 0C.7
00B4: MOVF 0C,W
00B5: IORWF 15,F
....................
.................... while(!input(CLK)); // ceka na jednicku hodin
00B6: BSF 03.5
00B7: BSF 06.1
00B8: BCF 03.5
00B9: BTFSS 06.1
00BA: GOTO 0B6
.................... };
00BB: INCF 16,F
00BC: GOTO 09E
.................... return (bajt);
00BD: MOVF 15,W
00BE: MOVWF 0D
00BF: RETLW 00
.................... }
....................
....................
.................... /*void read_all_byte(int8*st,*nd,*rd) // precte 3 bajty
.................... {
.................... int8 i;
....................
.................... // *st=read_byte(1st);
....................
.................... // cekani na startbit
.................... while(input(CLK) || input(DATA));
.................... while(!input(CLK));
.................... *nd = 0;
.................... for(i=0; i<8; i++)
.................... {
.................... while(input(CLK)); // ceka na nulu hodin
....................
.................... *nd |= input(DATA) << 7;
.................... *nd >>= 1;
....................
.................... while(!input(CLK)); // ceka na jednicku hodin
.................... };
....................
.................... // cekani na startbit
.................... while(input(CLK) || input(DATA));
.................... while(!input(CLK));
.................... *rd = 0;
.................... for(i=0; i<8; i++)
.................... {
.................... while(input(CLK)); // ceka na nulu hodin
....................
.................... *rd |= input(DATA) << 7;
.................... *rd >>= 1;
....................
.................... while(!input(CLK)); // ceka na jednicku hodin
.................... };
.................... }*/
....................
....................
.................... #define SIGN_X 4
....................
.................... void trigger()
.................... {
.................... output_high(PIN_A0);
00C0: BSF 03.5
00C1: BCF 05.0
00C2: BCF 03.5
00C3: BSF 05.0
.................... output_low(PIN_A0);
00C4: BSF 03.5
00C5: BCF 05.0
00C6: BCF 03.5
00C7: BCF 05.0
.................... delay_us(100);
00C8: MOVLW 21
00C9: MOVWF 0C
00CA: DECFSZ 0C,F
00CB: GOTO 0CA
.................... output_high(PIN_A0);
00CC: BSF 03.5
00CD: BCF 05.0
00CE: BCF 03.5
00CF: BSF 05.0
00D0: GOTO 0FC (RETURN)
.................... }
....................
.................... void flash_red() // blikne ledkou
.................... {
.................... output_high(LED_red);
.................... Delay_ms(BLIK);
.................... output_low(LED_red);
.................... }
....................
.................... void flash_yellow() // blikne ledkou
.................... {
.................... output_high(LED_yellow);
.................... Delay_ms(BLIK);
.................... output_low(LED_yellow);
.................... }
....................
.................... void main()
.................... {
.................... int8 X,y,tl=0;
*
00D4: CLRF 11
00D5: CLRF 14
.................... int8 X_old,y_old,tl_old=0;
*
00D1: CLRF 04
00D2: MOVLW 1F
00D3: ANDWF 03,F
....................
.................... Delay_ms(500);
*
00D6: MOVLW 02
00D7: MOVWF 15
00D8: MOVLW FA
00D9: MOVWF 16
00DA: GOTO 004
00DB: DECFSZ 15,F
00DC: GOTO 0D8
.................... send(ENABLE_DATA_REPORTING);
00DD: MOVLW F4
00DE: MOVWF 15
00DF: GOTO 019
....................
.................... while(true)
.................... {
.................... tl = read_byte(PRVNI);
00E0: MOVLW E8
00E1: BSF 03.5
00E2: BSF 03.6
00E3: MOVWF 7F
00E4: BCF 03.5
00E5: BCF 03.6
00E6: CALL 07C
00E7: MOVF 0D,W
00E8: MOVWF 11
.................... x = read_byte(DRUHY);
00E9: MOVLW 02
00EA: BSF 03.5
00EB: BSF 03.6
00EC: MOVWF 7F
00ED: BCF 03.5
00EE: BCF 03.6
00EF: CALL 07C
00F0: MOVF 0D,W
00F1: MOVWF 0F
.................... y = read_byte(TRETI);
00F2: MOVLW 02
00F3: BSF 03.5
00F4: BSF 03.6
00F5: MOVWF 7F
00F6: BCF 03.5
00F7: BCF 03.6
00F8: CALL 07C
00F9: MOVF 0D,W
00FA: MOVWF 10
.................... trigger();
00FB: GOTO 0C0
....................
....................
.................... if (bit_test(tl, SIGN_X))
00FC: BTFSS 11.4
00FD: GOTO 107
.................... {
.................... output_high(LED_red);
00FE: BSF 03.5
00FF: BCF 05.2
0100: BCF 03.5
0101: BSF 05.2
.................... output_low(LED_yellow);
0102: BSF 03.5
0103: BCF 05.3
0104: BCF 03.5
0105: BCF 05.3
.................... }
.................... else
0106: GOTO 10F
.................... {
.................... output_high(LED_yellow);
0107: BSF 03.5
0108: BCF 05.3
0109: BCF 03.5
010A: BSF 05.3
.................... output_low(LED_red);
010B: BSF 03.5
010C: BCF 05.2
010D: BCF 03.5
010E: BCF 05.2
.................... }
.................... }
010F: GOTO 0E0
.................... }
....................
0110: SLEEP
....................
....................
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.PJT
0,0 → 1,37
[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
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F84\main.c
2=C:\PROGRAM FILES\PICC\devices\16F84.h
3=c:\library\kaklik\CCS\PS2.c
4=
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.SYM
0,0 → 1,32
00C @SCRATCH
00D @SCRATCH
00D _RETURN_
00F main.X
010 main.y
011 main.tl
012 main.X_old
013 main.y_old
014 main.tl_old
015 send.command
015 read_byte.bajt
015 main.@SCRATCH
016 delay_ms.P1
016 send.n
016 read_byte.i
017 send.parity
017 read_byte.@SCRATCH
018 send.@SCRATCH
delay_us.P1
read_byte.poradi
 
0004 delay_ms
0019 send
007C read_byte
00C0 trigger
00D1 main
 
Project Files:
d:\@kaklik\programy\pic_c\ps2mys\main.c
D:\@Kaklik\programy\PIC_C\PS2mys\main.h
C:\PROGRAM FILES\PICC\devices\16F84.h
d:\@kaklik\programy\pic_c\ps2mys\PS2.c
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.c
0,0 → 1,57
#include "main.h"
#include "c:\library\kaklik\CCS\PS2.c"
 
#define SIGN_X 4
 
void trigger()
{
output_high(PIN_A0);
output_low(PIN_A0);
delay_us(100);
output_high(PIN_A0);
}
 
void flash_red() // blikne ledkou
{
output_high(LED_red);
Delay_ms(BLIK);
output_low(LED_red);
}
 
void flash_yellow() // blikne ledkou
{
output_high(LED_yellow);
Delay_ms(BLIK);
output_low(LED_yellow);
}
 
void main()
{
int8 X,y,tl=0;
int8 X_old,y_old,tl_old=0;
 
Delay_ms(500);
send(ENABLE_DATA_REPORTING);
 
while(true)
{
tl = read_byte(PRVNI);
x = read_byte(DRUHY);
y = read_byte(TRETI);
trigger();
 
 
if (bit_test(tl, SIGN_X))
{
output_high(LED_red);
output_low(LED_yellow);
}
else
{
output_high(LED_yellow);
output_low(LED_red);
}
}
}
 
 
/programy/PIC_C/mereni/PS2mys/PIC16F84/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/PIC_C/mereni/PS2mys/PIC16F84/main.err
0,0 → 1,0
Error[51] c:\library\kaklik\CCS\PS2.c 48 : A numeric expression must appear here
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.h
0,0 → 1,24
#include <16F84.h>
#use delay(clock=4000000)
#fuses XT,NOWDT
 
#DEFINE DATA PIN_B0 // musi byt definovan kanal DATA
#DEFINE CLK PIN_B1 // a taky hodiny CLK
 
#define PRVNI 1000 // nastaveni prodlevy pred zacatkem vysilani bajtu
#define DRUHY 2
#define TRETI DRUHY
 
// prikazy
#define RESET 0xFF
#define ENABLE_DATA_REPORTING 0xF4
#define READ_DATA 0xEB
#define STATUS_REQUEST 0xE9
#define SET_REMOTE_MODE 0xF0
#define SET_STREAM_MODE 0xEA
#define GET_DEVICE_ID 0xF2
 
#DEFINE LED_yellow PIN_A3
#DEFINE LED_red PIN_A2
 
#DEFINE BLIK 120 // doba rozsviceni led
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.sta
0,0 → 1,32
 
ROM used: 273 (27%)
751 (73%) including unused fragments
 
1 Average locations per line
4 Average locations per statement
 
RAM used: 9 (13%) at main() level
12 (18%) worst case
 
Lines Stmts % Files
----- ----- --- -----
58 25 34 d:\@kaklik\programy\pic_c\ps2mys\main.c
25 0 0 D:\@Kaklik\programy\PIC_C\PS2mys\main.h
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h
100 48 49 d:\@kaklik\programy\pic_c\ps2mys\PS2.c
----- -----
588 146 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 8 1 delay_ms
0 99 36 4 send
0 68 25 4 read_byte
0 17 6 0 trigger
0 64 23 7 main
 
Segment Used Free
--------- ---- ----
0000-0003 4 0
0004-03FF 269 751
 
/programy/PIC_C/mereni/PS2mys/PIC16F84/main.tre
0,0 → 1,9
ÀÄmain
ÀÄmain 0/64 Ram=7
ÃÄ??0??
ÃÄdelay_ms 0/21 Ram=1
ÃÄsend 0/99 Ram=4
ÃÄread_byte 0/68 Ram=4
ÃÄread_byte 0/68 Ram=4
ÃÄread_byte 0/68 Ram=4
ÀÄtrigger 0/17 Ram=0
/programy/PIC_C/mereni/PS2mys/PIC16F84/prg.bat
0,0 → 1,6
call picpgr stop
call picpgr erase pic16f84
call picpgr program main.hex hex pic16f84
call picpgr run
pause
call picpgr stop
/programy/PIC_C/mereni/PS2mys/PIC16F84/ps2.BAK
0,0 → 1,99
// Modul pro komunikaci s Mysi
 
void send(byte command)
{
int n;
int parity=0;
 
//Request-to-send
// output_float(DATA);
output_low(CLK);
delay_us(100);
// start bit
output_low(DATA);
delay_us(20);
while(!input(CLK));
// 8 bitu
for(n=0; n<8; n++)
{
while(input(CLK));
output_bit(DATA, command & 1);
parity += command & 1;
command>>=1;
while(!input(CLK));
};
// parita
while(input(CLK));
output_bit(DATA, ~parity & 1);
while(!input(CLK));
// stop bit
while(input(CLK));
output_bit(DATA, 1);
while(!input(CLK));
output_float(DATA);
}
 
 
int8 read_byte(int8 const poradi)
{
int8 bajt;
int8 i;
 
// cekani na komunikacni klid
for (i=0; i<poradi; i++)
{
if (!input(CLK) || !input(DATA)) i=0;
};
 
// cekani na startbit
while(input(CLK) || input(DATA));
while(!input(CLK));
 
bajt = 0;
for(i=0; i<8; i++)
{
while(input(CLK)); // ceka na nulu hodin
 
bajt >>= 1;
bajt |= input(DATA) << 7;
 
while(!input(CLK)); // ceka na jednicku hodin
};
return (bajt);
}
 
 
/*void read_all_byte(int8*st,*nd,*rd) // precte 3 bajty
{
int8 i;
 
// *st=read_byte(1st);
 
// cekani na startbit
while(input(CLK) || input(DATA));
while(!input(CLK));
*nd = 0;
for(i=0; i<8; i++)
{
while(input(CLK)); // ceka na nulu hodin
 
*nd |= input(DATA) << 7;
*nd >>= 1;
 
while(!input(CLK)); // ceka na jednicku hodin
};
 
// cekani na startbit
while(input(CLK) || input(DATA));
while(!input(CLK));
*rd = 0;
for(i=0; i<8; i++)
{
while(input(CLK)); // ceka na nulu hodin
 
*rd |= input(DATA) << 7;
*rd >>= 1;
 
while(!input(CLK)); // ceka na jednicku hodin
};
}*/
/programy/PIC_C/mereni/PS2mys/PIC16F84/ps2mouse.BAK
0,0 → 1,100
#include "main.h"
#include "ps2mouse.h"
 
void send(byte command)
{
int n;
int parity=0;
 
//Request-to-send
input(DATA);
output_low(CLK);
delay_us(100);
// start bit
output_low(DATA);
delay_us(20);
while(!input(CLK));
// 8 bitu
for(n=0; n<8; n++)
{
while(input(CLK));
output_bit(DATA, command & 1);
parity += command & 1;
command>>=1;
while(!input(CLK));
};
// parita
while(input(CLK));
output_bit(DATA, ~parity & 1);
while(!input(CLK));
// stop bit
while(input(CLK));
output_bit(DATA, 1);
while(!input(CLK));
output_float(DATA);
}
 
 
int8 read_byte(int8 const poradi)
{
int8 bajt;
int8 i;
 
// cekani na komunikacni klid
for (i=0; i<poradi; i++)
{
if (!input(CLK) || !input(DATA)) i=0;
};
 
// cekani na startbit
while(input(CLK) || input(DATA));
while(!input(CLK));
 
bajt = 0;
for(i=0; i<8; i++)
{
while(input(CLK)); // ceka na nulu hodin
 
bajt >>= 1;
bajt |= input(DATA) << 7;
 
while(!input(CLK)); // ceka na jednicku hodin
};
return (bajt);
}
 
 
/*void read_all_byte(int8*st,*nd,*rd) // precte 3 bajty
{
int8 i;
 
// *st=read_byte(1st);
 
// cekani na startbit
while(input(CLK) || input(DATA));
while(!input(CLK));
*nd = 0;
for(i=0; i<8; i++)
{
while(input(CLK)); // ceka na nulu hodin
 
*nd |= input(DATA) << 7;
*nd >>= 1;
 
while(!input(CLK)); // ceka na jednicku hodin
};
 
// cekani na startbit
while(input(CLK) || input(DATA));
while(!input(CLK));
*rd = 0;
for(i=0; i<8; i++)
{
while(input(CLK)); // ceka na nulu hodin
 
*rd |= input(DATA) << 7;
*rd >>= 1;
 
while(!input(CLK)); // ceka na jednicku hodin
};
}*/
/programy/PIC_C/mereni/PS2mys/PIC16F84/ps2mouse.c
0,0 → 1,97
void send(byte command)
{
int n;
int parity=0;
 
//Request-to-send
input(DATA);
output_low(CLK);
delay_us(100);
// start bit
output_low(DATA);
delay_us(20);
while(!input(CLK));
// 8 bitu
for(n=0; n<8; n++)
{
while(input(CLK));
output_bit(DATA, command & 1);
parity += command & 1;
command>>=1;
while(!input(CLK));
};
// parita
while(input(CLK));
output_bit(DATA, ~parity & 1);
while(!input(CLK));
// stop bit
while(input(CLK));
output_bit(DATA, 1);
while(!input(CLK));
output_float(DATA);
}
 
 
int8 read_byte(int8 const poradi)
{
int8 bajt;
int8 i;
 
// cekani na komunikacni klid
for (i=0; i<poradi; i++)
{
if (!input(CLK) || !input(DATA)) i=0;
};
 
// cekani na startbit
while(input(CLK) || input(DATA));
while(!input(CLK));
 
bajt = 0;
for(i=0; i<8; i++)
{
while(input(CLK)); // ceka na nulu hodin
 
bajt >>= 1;
bajt |= input(DATA) << 7;
 
while(!input(CLK)); // ceka na jednicku hodin
};
return (bajt);
}
 
 
/*void read_all_byte(int8*st,*nd,*rd) // precte 3 bajty
{
int8 i;
 
// *st=read_byte(1st);
 
// cekani na startbit
while(input(CLK) || input(DATA));
while(!input(CLK));
*nd = 0;
for(i=0; i<8; i++)
{
while(input(CLK)); // ceka na nulu hodin
 
*nd |= input(DATA) << 7;
*nd >>= 1;
 
while(!input(CLK)); // ceka na jednicku hodin
};
 
// cekani na startbit
while(input(CLK) || input(DATA));
while(!input(CLK));
*rd = 0;
for(i=0; i<8; i++)
{
while(input(CLK)); // ceka na nulu hodin
 
*rd |= input(DATA) << 7;
*rd >>= 1;
 
while(!input(CLK)); // ceka na jednicku hodin
};
}*/
/programy/PIC_C/mereni/PS2mys/PIC16F84/ps2mouse.h
0,0 → 1,18
 
#define PRVNI 1000 // nastaveni prodlevy pred zacatkem vysilani bajtu
#define DRUHY 2
#define TRETI DRUHY
 
 
// prikazy
#define RESET 0xFF
#define ENABLE_DATA_REPORTING 0xF4
#define READ_DATA 0xEB
#define STATUS_REQUEST 0xE9
#define SET_REMOTE_MODE 0xF0
#define SET_STREAM_MODE 0xEA
#define GET_DEVICE_ID 0xF2
 
void send(byte command);
int8 read_byte(int8 const poradi);
 
/programy/PIC_C/mereni/PS2mys/PIC16F84/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
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.BAK
0,0 → 1,54
#include "D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h"
 
#define LCD_RS PIN_A0 // rizeni registru LCD displeje
#define LCD_E PIN_A1 // enable LCD displeje
#define LCD_DATA_LSB PIN_B0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
#include "C:\library\CCS\lcd.c"
 
#define TRIGGER_PIN PIN_B4
 
#DEFINE DATA PIN_B5 // musi byt definovan kanal DATA
#DEFINE CLK PIN_B6 // a taky hodiny CLK
#include "C:\library\kaklik\CCS\ps2.c"
 
 
 
void trigger()
{
output_high(TRIGGER_PIN);
delay_us(50);
output_low(TRIGGER_PIN);
}
 
void main()
{
signed int16 x=0,y=0;
signed int8 hodnota,dx,dy;
unsigned int8 tl1,tl2,tl3;
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
 
lcd_init();
Delay_ms(500);
 
send(SET_REMOTE_MODE);
 
while (true)
{
LCD_gotoxy(1,1);
printf(lcd_putc,"%X X=%ld Y=%ld TL1=%U TL2=%U TL3=%U",hodnota, x,y,tl1,tl2,tl3);
delay_ms(20);
send(READ_DATA);
hodnota=read_byte();
read_standard_byte(&dx,&dy,&tl1,&tl2,&tl3);
x+=dx;
y+=dy;
}
}
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.HEX
0,0 → 1,123
:1000000000308A00E22A00000A108A100A118207D2
:1000100028340C34013406340A108A100A1182077D
:1000200025345834203458343D3425346C34643409
:10003000203459343D3425346C3464342034543401
:100040004C3431343D342534553454344C3432340A
:100050003D3425345534203454344C3433343D3419
:1000600025345534003434308400000803194728FF
:100070000130F800F701F70B3B28F80B3A284A301B
:10008000F700F70B412800000000800B38280034EF
:100090000608F039BB003A080F393B048600851486
:1000A0008316851000008312851083168510831235
:1000B0000034B808031D5E2805105F280514831658
:1000C00005108312B90E3908BA004820B90E390854
:1000D000BA0048200D30F700F70B6C2800341430BC
:1000E000B4003320F0308316860583120510831682
:1000F000051083128510831685108312AB012B081F
:10010000023C031C8B280230B40033200330BA00B9
:100110004820AB0A7F280D30F700F70B8D280230FE
:10012000BA0048200D30F700F70B9428AB012B08DC
:10013000023C031CA7282B080420AC00B8012C08A3
:10014000B90059200230B4003320AB0A97288A1135
:10015000242BAD0183168616061383120613213055
:10016000F700F70BB12883168612831286128316C6
:1001700006178312061BB728AC012C08073C031C8A
:10018000DA28831606178312061BC1282B18CA28E3
:100190008612CB2886168316861283122B08013905
:1001A000AD070310AB0C831606178312061FD32866
:1001B000AC0ABD28831606178312061BDA282D0801
:1001C000FF3A0139003A031DE7288612E82886160F
:1001D0008316861206178312061BF0288316EA2858
:1001E0008316861686168312861EF8288316F22832
:1001F000831606178312061BF82883160617831228
:10020000061FFD28831686168312861EFD280034DD
:1002100001303402B6003508023C031D112940307C
:10022000B60736088038B700B8013708B90059203A
:10023000003433080C3A03192729063A03192F29E9
:10024000073A03193529053A03193A293F29B80114
:100250000130B90059200230B40033204B2901305D
:10026000B4000230B50008214B290130B400B500BC
:1002700008214B29B8011030B90059204B29330807
:100280001F3C031C45290730B3050130B800330873
:10029000B90059204B290034AC1B5E290F30F70000
:1002A0002B0EF7050A307702031859293030F7076B
:1002B0005B292C08F7077708B30019210F30AB052D
:1002C0000A302B020318662930306829AC132C0839
:1002D000AB072B08B30019218A11372B0408B20091
:1002E000AC1F7B292D30B30019218403AB09AC0965
:1002F000AB0A0319AC0A2C0EF038AE00AE07E23E92
:10030000AF00323EB1002C080F39AF07AF07B1077D
:10031000E93EB000B007B0072B0E0F39B007B107A8
:10032000B00DB10DB109B10D2B080F39B107AE0DEC
:100330000730AD000A30B107B003031C9B29B0079A
:10034000AF03031C9F29AF07AE03031CA329AE070D
:10035000AD03031CA7292D30840007303205840724
:10036000313004020319D0290008F700031DBE290B
:10037000321ACE29B219C0292030C1290830B20062
:100380003030F707AC010408AB007708AD00770800
:10039000B30019212B0884002D08F700840AB02926
:1003A0000008F7003030F7077708B3001921003450
:1003B0003208F80131020318E0293108F700EC296E
:1003C000F7010830B300B10DF70D320877020318BA
:1003D000F700F80DB30BE32900343013B0122F08E7
:1003E000B1006430B200D8217708AF007808031D4F
:1003F000172AB01A172AB019252A301B052A3018D7
:10040000052A3019052AB01B252A301C112AB01BD9
:10041000252A301B112A3018252A3019112AB01B21
:10042000252A2030301E3030B3001921252AB0167D
:10043000B01F212A78088000F8002D30B300192160
:10044000B01330307807B3001921301B302A2F0841
:10045000B1000A30B200D8217708AF003017F62972
:10046000B01F352A2D30B300192130302F07B300CB
:10047000192100343510831606178312061B3B2AF8
:10048000831686168312861A3B2A83160617831252
:10049000061F452AB301B4013408073C031C7C2A1B
:1004A000831606178312061B502A0310B30C8316FB
:1004B000861600308312861A0130F700770CF70198
:1004C0000318F7177708B304003035180130B60069
:1004D0008316861600308312861A01303606F8001D
:1004E0007818742A3510752A351483160617831266
:1004F000061F752AB40A4C2A831606178312061B98
:100500007C2A003035180130B6008316861600307C
:100510008312861A01303606F8007818912A3510B1
:10052000922A3514831606178312061F922A831601
:1005300006178312061B972A831606178312061FB7
:100540009C2A3308F80000343A227808B0003A2296
:100550007808B1003A227808B20030080839083C1F
:10056000031DB82A2B0884003108003C8000BC2AF7
:100570002B0884003108800030081039103C031D1E
:10058000C72A2C0884003208003C8000CB2A2C08A3
:100590008400320880002D08840030080139800072
:1005A0002E0884000310300C013980002F088400CD
:1005B000300CF700F70C3F30F70577080139800061
:1005C0008A11A52B84011F30830583161F129F12E9
:1005D0001B0880399B0007309C001C0883120D13F8
:1005E000603083168F008312A101A201A301A40130
:1005F00083161F129F121B0880399B0083121F1045
:100600009412831606118614061200308312940089
:10061000831694000108C7390838810083129001BD
:100620000030F800920000308316920007309C00E2
:1006300005080330F700F70B1B2B1C0883120D1362
:1006400083169D0183126F280230AB00FA30B4008C
:100650003320AB0B262BF030AB00A9200130B400C7
:10066000B50008212508AB003730AC004C292030FC
:10067000B30019215830B30019213D30B3001921BE
:10068000103084002208AC002108AB006E2120301D
:10069000B30019215930B30019213D30B30019219D
:1006A000103084002408AC002308AB006E210E300B
:1006B000AB002B080C20AB0AF700B3001921133054
:1006C0002B02031D592B2808AF001830B000ED2174
:1006D0000330AC002030B3001921AC0B6A2B15306D
:1006E000AD002D080C20AD0AF700B3001921193018
:1006F0002D02031D712B2908AF001830B000ED2129
:100700001B30AE002E080C20AE0AF700B3001921F2
:1007100020302E02031D822B2A08AF001830B000B3
:10072000ED211430B4003320EB30AB00A9203A2285
:100730007808A5002630AB002730AC002830AD008B
:100740002930AE002A30AF00A42AFA012608A61BE1
:10075000FA03A1070318A20A7A08A207FA012708D8
:10076000A71BFA03A3070318A40A7A08A4072E2BD1
:02077000630024
:04400E00783FFF3FB9
:00000001FF
;PIC16F88
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.LST
0,0 → 1,1177
CCS PCM C Compiler, Version 3.221, 27853 19-XII-05 23:22
 
Filename: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.LST
 
ROM used: 953 words (23%)
Largest free fragment is 2048
RAM used: 19 (11%) at main() level
33 (19%) worst case
Stack: 5 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 2E2
0003: NOP
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h"
.................... #include <16F88.h>
.................... //////// Standard Header file for the PIC16F88 device ////////////////
.................... #device PIC16F88
.................... #list
....................
.................... #device adc=8
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO
.................... #use delay(clock=4000000)
*
0033: MOVLW 34
0034: MOVWF 04
0035: MOVF 00,W
0036: BTFSC 03.2
0037: GOTO 047
0038: MOVLW 01
0039: MOVWF 78
003A: CLRF 77
003B: DECFSZ 77,F
003C: GOTO 03B
003D: DECFSZ 78,F
003E: GOTO 03A
003F: MOVLW 4A
0040: MOVWF 77
0041: DECFSZ 77,F
0042: GOTO 041
0043: NOP
0044: NOP
0045: DECFSZ 00,F
0046: GOTO 038
0047: RETLW 00
....................
....................
....................
.................... #define LCD_RS PIN_A0 // rizeni registru LCD displeje
.................... #define LCD_E PIN_A1 // enable LCD displeje
.................... #define LCD_DATA_LSB PIN_B0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
.................... #include "C:\library\CCS\lcd.c"
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem
.................... // (c)miho 2002,2005
.................... //
.................... // Historie:
.................... //
.................... // 0.00 Uvodni verze se snadnou definici portu LCD displeje
.................... // 0.01 Oprava portu (zapomenute stare identifikatory)
.................... // 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty
.................... // 0.03 Doplnena procedura lcd_clr pro smazani displeje
.................... //
.................... //
.................... // Funkce:
.................... //
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni
.................... //
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky
.................... // \f = \x0C - nova stranka - smazani displeje
.................... // \n = \x0A - odradkovani (prechod na druhou radku)
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet
.................... // \r = \x0D - goto home to position 1,1
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce)
.................... //
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu
.................... // nekontroluje parametry
.................... //
.................... // lcd_cursor_on zapne kurzor
.................... // lcd_cursor_off vypne kurzor
.................... //
.................... // lcd_clr smaze displej
.................... //
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM.
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7.
.................... // Na konci se provede lcd_gotoxy(1,1).
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku
.................... //
.................... //
.................... // Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
.................... //
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje
.................... // #define LCD_E PIN_B1 // enable LCD displeje
.................... // #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
.................... //
.................... //
.................... // Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov)
.................... //
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje
.................... // #define LCD_E PIN_B1 // enable LCD displeje
.................... // #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty
.................... // #define LCD_D1 PIN_C3 // D1
.................... // #define LCD_D2 PIN_C4 // D2
.................... // #define LCD_D3 PIN_C5 // D3
....................
....................
....................
....................
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje
....................
....................
....................
....................
.................... #ifdef LCD_DATA_LSB
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu
.................... //
.................... #define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu
.................... #define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu
.................... #define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru
.................... #define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu
.................... //
.................... #if LCD_SHIFT>4 // kontrola mezi
.................... #error LCD data port LSB bit not in range 0..4
.................... #endif
.................... #endif
....................
....................
.................... // Definice konstant pro LCD display
.................... //
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky
....................
....................
.................... // Definice rezimu LCD displeje
.................... //
.................... BYTE const LCD_INIT_STRING[4] =
.................... {
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7
.................... LCD_CURSOR_OFF_, // display on, kurzor off,
.................... 0x01, // clear displeje
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava)
.................... };
....................
....................
.................... // Odesle nibble do displeje (posle data a klikne signalem e)
.................... //
.................... void lcd_send_nibble( BYTE n )
.................... {
.................... #ifdef LCD_DATA_LSB
.................... // data jsou za sebou na 4 bitech jednoho portu
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej
0048: MOVF 06,W
0049: ANDLW F0
004A: MOVWF 3B
004B: MOVF 3A,W
004C: ANDLW 0F
004D: IORWF 3B,W
004E: MOVWF 06
.................... #else
.................... // data jsou na libovolnych 4 bitech libovolnych portu
.................... output_bit(LCD_D0,bit_test(n,0));
.................... output_bit(LCD_D1,bit_test(n,1));
.................... output_bit(LCD_D2,bit_test(n,2));
.................... output_bit(LCD_D3,bit_test(n,3));
.................... #endif
.................... output_bit(LCD_E,1); // vzestupna hrana
004F: BSF 05.1
0050: BSF 03.5
0051: BCF 05.1
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat
0052: NOP
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us)
0053: BCF 03.5
0054: BCF 05.1
0055: BSF 03.5
0056: BCF 05.1
.................... }
0057: BCF 03.5
0058: RETLW 00
....................
....................
.................... // Odesle bajt do registru LCD
.................... //
.................... // Pokud je Adr=0 .. instrukcni registr
.................... // Pokud je Adr=1 .. datovy registr
.................... //
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n )
.................... {
.................... output_bit(LCD_RS,Adr); // vyber registr
0059: MOVF 38,F
005A: BTFSS 03.2
005B: GOTO 05E
005C: BCF 05.0
005D: GOTO 05F
005E: BSF 05.0
005F: BSF 03.5
0060: BCF 05.0
.................... swap(n);
0061: BCF 03.5
0062: SWAPF 39,F
.................... lcd_send_nibble(n); // posli horni pulku bajtu
0063: MOVF 39,W
0064: MOVWF 3A
0065: CALL 048
.................... swap(n);
0066: SWAPF 39,F
.................... lcd_send_nibble(n); // posli spodni pulku bajtu
0067: MOVF 39,W
0068: MOVWF 3A
0069: CALL 048
.................... delay_us(40); // minimalni doba na provedeni prikazu
006A: MOVLW 0D
006B: MOVWF 77
006C: DECFSZ 77,F
006D: GOTO 06C
.................... }
006E: RETLW 00
....................
....................
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje
.................... //
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur
.................... //
.................... void lcd_init()
.................... {
....................
.................... int i; // pocitadlo cyklu
....................
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni
006F: MOVLW 14
0070: MOVWF 34
0071: CALL 033
....................
.................... #ifdef LCD_DATA_LSB
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD
0072: MOVLW F0
0073: BSF 03.5
0074: ANDWF 06,F
.................... #endif
....................
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav
0075: BCF 03.5
0076: BCF 05.0
0077: BSF 03.5
0078: BCF 05.0
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav
0079: BCF 03.5
007A: BCF 05.1
007B: BSF 03.5
007C: BCF 05.1
....................
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice
007D: BCF 03.5
007E: CLRF 2B
007F: MOVF 2B,W
0080: SUBLW 02
0081: BTFSS 03.0
0082: GOTO 08B
.................... {
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel
0083: MOVLW 02
0084: MOVWF 34
0085: CALL 033
.................... lcd_send_nibble(3); // rezim 8 bitu
0086: MOVLW 03
0087: MOVWF 3A
0088: CALL 048
.................... }
0089: INCF 2B,F
008A: GOTO 07F
....................
.................... delay_us(40); // cas na zpracovani
008B: MOVLW 0D
008C: MOVWF 77
008D: DECFSZ 77,F
008E: GOTO 08D
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu)
008F: MOVLW 02
0090: MOVWF 3A
0091: CALL 048
.................... delay_us(40); // cas na zpracovani
0092: MOVLW 0D
0093: MOVWF 77
0094: DECFSZ 77,F
0095: GOTO 094
....................
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod)
0096: CLRF 2B
0097: MOVF 2B,W
0098: SUBLW 02
0099: BTFSS 03.0
009A: GOTO 0A7
.................... {
.................... lcd_send_byte(0,LCD_INIT_STRING[i]);
009B: MOVF 2B,W
009C: CALL 004
009D: MOVWF 2C
009E: CLRF 38
009F: MOVF 2C,W
00A0: MOVWF 39
00A1: CALL 059
.................... delay_ms(2);
00A2: MOVLW 02
00A3: MOVWF 34
00A4: CALL 033
.................... }
00A5: INCF 2B,F
00A6: GOTO 097
.................... }
00A7: BCF 0A.3
00A8: GOTO 324 (RETURN)
....................
....................
.................... // Proved presun kurzoru
.................... //
.................... // Pozice 1.1 je domu
.................... //
.................... void lcd_gotoxy( BYTE x, BYTE y)
.................... {
....................
.................... BYTE Adr;
....................
.................... Adr=x-1;
*
0108: MOVLW 01
0109: SUBWF 34,W
010A: MOVWF 36
.................... if(y==2)
010B: MOVF 35,W
010C: SUBLW 02
010D: BTFSS 03.2
010E: GOTO 111
.................... Adr+=LCD_LINE_2;
010F: MOVLW 40
0110: ADDWF 36,F
....................
.................... lcd_send_byte(0,0x80|Adr);
0111: MOVF 36,W
0112: IORLW 80
0113: MOVWF 37
0114: CLRF 38
0115: MOVF 37,W
0116: MOVWF 39
0117: CALL 059
.................... }
0118: RETLW 00
....................
....................
.................... // Zapis znaku na displej, zpracovani ridicich znaku
.................... //
.................... void lcd_putc( char c)
.................... {
....................
.................... switch (c)
.................... {
0119: MOVF 33,W
011A: XORLW 0C
011B: BTFSC 03.2
011C: GOTO 127
011D: XORLW 06
011E: BTFSC 03.2
011F: GOTO 12F
0120: XORLW 07
0121: BTFSC 03.2
0122: GOTO 135
0123: XORLW 05
0124: BTFSC 03.2
0125: GOTO 13A
0126: GOTO 13F
.................... case '\f' : lcd_send_byte(0,1); // smaz displej
0127: CLRF 38
0128: MOVLW 01
0129: MOVWF 39
012A: CALL 059
.................... delay_ms(2);
012B: MOVLW 02
012C: MOVWF 34
012D: CALL 033
.................... break;
012E: GOTO 14B
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky
012F: MOVLW 01
0130: MOVWF 34
0131: MOVLW 02
0132: MOVWF 35
0133: CALL 108
0134: GOTO 14B
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home
0135: MOVLW 01
0136: MOVWF 34
0137: MOVWF 35
0138: CALL 108
0139: GOTO 14B
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet
013A: CLRF 38
013B: MOVLW 10
013C: MOVWF 39
013D: CALL 059
013E: GOTO 14B
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F
013F: MOVF 33,W
0140: SUBLW 1F
0141: BTFSS 03.0
0142: GOTO 145
0143: MOVLW 07
0144: ANDWF 33,F
.................... lcd_send_byte(1,c); break; // zapis znak
0145: MOVLW 01
0146: MOVWF 38
0147: MOVF 33,W
0148: MOVWF 39
0149: CALL 059
014A: GOTO 14B
.................... }
.................... }
014B: RETLW 00
....................
....................
.................... // Zapni kurzor
.................... //
.................... void lcd_cursor_on()
.................... {
.................... lcd_send_byte(0,LCD_CURSOR_ON_);
.................... }
....................
....................
.................... // Vypni kurzor
.................... //
.................... void lcd_cursor_off()
.................... {
.................... lcd_send_byte(0,LCD_CURSOR_OFF_);
.................... }
....................
....................
.................... // Smaz displej
.................... //
.................... void lcd_clr()
.................... {
.................... lcd_putc('\f');
.................... }
....................
....................
.................... // Definice vlastnich fontu
.................... //
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden
.................... // priklad pouziti definovanych znaku.
....................
....................
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje
.................... //
.................... void lcd_putc2(int Data)
.................... {
.................... lcd_send_byte(1,Data);
.................... }
....................
....................
.................... // Pomocne definice pro programovani obsahu CGRAM
.................... //
.................... #define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2)
.................... #define lcd_define_def(String) printf(lcd_putc2,String);
.................... #define lcd_define_end() lcd_send_byte(0,3); delay_ms(2)
....................
....................
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def
.................... //
.................... #define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end();
....................
....................
.................... // Pripravene definice fontu vybranych znaku
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80
.................... //
.................... #define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */
.................... #define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */
.................... #define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */
.................... #define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */
.................... #define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */
.................... #define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */
.................... #define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */
.................... #define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */
.................... #define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */
.................... #define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */
.................... #define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */
.................... #define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */
.................... #define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */
.................... #define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */
.................... #define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */
.................... #define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */
.................... #define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */
.................... #define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */
.................... #define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */
.................... #define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */
.................... #define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */
.................... #define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */
.................... #define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */
.................... #define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */
.................... #define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */
.................... #define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */
.................... #define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */
.................... #define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */
.................... #define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */
.................... #define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */
.................... #define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */
.................... #define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */
.................... #define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */
.................... #define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */
.................... #define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */
....................
....................
.................... // Priklad pouziti definovanych znaku
.................... //
.................... //
.................... //void lcd_sample()
.................... //{
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji
.................... // // jediny definicni retezec)
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3
.................... // delay_ms(1000);
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0
.................... // delay_ms(1000);
.................... //}
....................
....................
.................... #define TRIGGER_PIN PIN_B4
....................
.................... #DEFINE DATA PIN_B5 // musi byt definovan kanal DATA
.................... #DEFINE CLK PIN_B6 // a taky hodiny CLK
.................... #include "C:\library\kaklik\CCS\ps2.c"
.................... ////////////////////////////////////////////////////////////////////////////////
.................... // Modul pro komunikaci s PS/2 mysi
.................... //
.................... // #DEFINE DATA PIN_B0 // musi byt definovan kanal DATA
.................... // #DEFINE CLK PIN_B1 // a taky hodiny CLK
.................... //
.................... ////////////////////////////////////////////////////////////////////////////////
....................
.................... #define PRVNI 1000 // nastaveni prodlevy pred zacatkem vysilani bajtu
.................... #define DRUHY 2
.................... #define TRETI DRUHY
....................
.................... // prikazy
.................... #define RESET 0xFF
.................... #define ENABLE_DATA_REPORTING 0xF4
.................... #define READ_DATA 0xEB
.................... #define STATUS_REQUEST 0xE9
.................... #define SET_REMOTE_MODE 0xF0
.................... #define SET_STREAM_MODE 0xEA
.................... #define GET_DEVICE_ID 0xF2
....................
....................
.................... void send(byte command)
.................... {
.................... unsigned int8 n;
.................... unsigned int8 parity=0;
*
00A9: CLRF 2D
....................
.................... //Request-to-send
.................... output_float(DATA);
00AA: BSF 03.5
00AB: BSF 06.5
.................... output_low(CLK);
00AC: BCF 06.6
00AD: BCF 03.5
00AE: BCF 06.6
.................... delay_us(100);
00AF: MOVLW 21
00B0: MOVWF 77
00B1: DECFSZ 77,F
00B2: GOTO 0B1
.................... // start bit
.................... output_low(DATA);
00B3: BSF 03.5
00B4: BCF 06.5
00B5: BCF 03.5
00B6: BCF 06.5
.................... while(input(CLK)); // ceka se na hodiny od mysi (mys zataha za hodiny)
00B7: BSF 03.5
00B8: BSF 06.6
00B9: BCF 03.5
00BA: BTFSC 06.6
00BB: GOTO 0B7
.................... // 8 bitu
.................... for(n=0; n<8; n++)
00BC: CLRF 2C
00BD: MOVF 2C,W
00BE: SUBLW 07
00BF: BTFSS 03.0
00C0: GOTO 0DA
.................... {
.................... while(input(CLK));
00C1: BSF 03.5
00C2: BSF 06.6
00C3: BCF 03.5
00C4: BTFSC 06.6
00C5: GOTO 0C1
.................... output_bit(DATA, command & 1);
00C6: BTFSC 2B.0
00C7: GOTO 0CA
00C8: BCF 06.5
00C9: GOTO 0CB
00CA: BSF 06.5
00CB: BSF 03.5
00CC: BCF 06.5
.................... parity += command & 1;
00CD: BCF 03.5
00CE: MOVF 2B,W
00CF: ANDLW 01
00D0: ADDWF 2D,F
.................... command >>= 1;
00D1: BCF 03.0
00D2: RRF 2B,F
.................... while(!input(CLK));
00D3: BSF 03.5
00D4: BSF 06.6
00D5: BCF 03.5
00D6: BTFSS 06.6
00D7: GOTO 0D3
.................... };
00D8: INCF 2C,F
00D9: GOTO 0BD
.................... // parita
.................... while(input(CLK));
00DA: BSF 03.5
00DB: BSF 06.6
00DC: BCF 03.5
00DD: BTFSC 06.6
00DE: GOTO 0DA
.................... output_bit(DATA, ~parity & 1);
00DF: MOVF 2D,W
00E0: XORLW FF
00E1: ANDLW 01
00E2: XORLW 00
00E3: BTFSS 03.2
00E4: GOTO 0E7
00E5: BCF 06.5
00E6: GOTO 0E8
00E7: BSF 06.5
00E8: BSF 03.5
00E9: BCF 06.5
.................... while(!input(CLK));
00EA: BSF 06.6
00EB: BCF 03.5
00EC: BTFSC 06.6
00ED: GOTO 0F0
00EE: BSF 03.5
00EF: GOTO 0EA
....................
.................... // stop bit
.................... output_float(DATA);
00F0: BSF 03.5
00F1: BSF 06.5
.................... while(input(DATA)); // mys musi sama jeste jednou zatahat za hodiny a data
00F2: BSF 06.5
00F3: BCF 03.5
00F4: BTFSS 06.5
00F5: GOTO 0F8
00F6: BSF 03.5
00F7: GOTO 0F2
.................... while(input(CLK));
00F8: BSF 03.5
00F9: BSF 06.6
00FA: BCF 03.5
00FB: BTFSC 06.6
00FC: GOTO 0F8
....................
.................... // ceka se az nastane klidovy stav
.................... while(!input(CLK) || !input(DATA));
00FD: BSF 03.5
00FE: BSF 06.6
00FF: BCF 03.5
0100: BTFSS 06.6
0101: GOTO 0FD
0102: BSF 03.5
0103: BSF 06.5
0104: BCF 03.5
0105: BTFSS 06.5
0106: GOTO 0FD
.................... }
0107: RETLW 00
....................
....................
.................... int8 read_byte() // dodelat paritu
.................... {
.................... unsigned int8 bajt;
.................... unsigned int8 i;
.................... int1 parity=0;
*
023A: BCF 35.0
....................
.................... // cekani na startbit
.................... while(input(CLK) || input(DATA)); // oba signaly musi byt v 0
023B: BSF 03.5
023C: BSF 06.6
023D: BCF 03.5
023E: BTFSC 06.6
023F: GOTO 23B
0240: BSF 03.5
0241: BSF 06.5
0242: BCF 03.5
0243: BTFSC 06.5
0244: GOTO 23B
.................... while(!input(CLK)); // ceka se na nabeznou hranu hodin
0245: BSF 03.5
0246: BSF 06.6
0247: BCF 03.5
0248: BTFSS 06.6
0249: GOTO 245
....................
.................... bajt = 0;
024A: CLRF 33
.................... for(i=0; i<8; i++)
024B: CLRF 34
024C: MOVF 34,W
024D: SUBLW 07
024E: BTFSS 03.0
024F: GOTO 27C
.................... {
.................... while(input(CLK)); // ceka na nulu hodin
0250: BSF 03.5
0251: BSF 06.6
0252: BCF 03.5
0253: BTFSC 06.6
0254: GOTO 250
....................
.................... bajt >>= 1;
0255: BCF 03.0
0256: RRF 33,F
.................... bajt |= input(DATA) << 7; // zapise se stav do promene
0257: BSF 03.5
0258: BSF 06.5
0259: MOVLW 00
025A: BCF 03.5
025B: BTFSC 06.5
025C: MOVLW 01
025D: MOVWF 77
025E: RRF 77,W
025F: CLRF 77
0260: BTFSC 03.0
0261: BSF 77.7
0262: MOVF 77,W
0263: IORWF 33,F
.................... parity^=input(DATA);
0264: MOVLW 00
0265: BTFSC 35.0
0266: MOVLW 01
0267: MOVWF 36
0268: BSF 03.5
0269: BSF 06.5
026A: MOVLW 00
026B: BCF 03.5
026C: BTFSC 06.5
026D: MOVLW 01
026E: XORWF 36,W
026F: MOVWF 78
0270: BTFSC 78.0
0271: GOTO 274
0272: BCF 35.0
0273: GOTO 275
0274: BSF 35.0
....................
.................... while(!input(CLK)); // ceka na jednicku hodin
0275: BSF 03.5
0276: BSF 06.6
0277: BCF 03.5
0278: BTFSS 06.6
0279: GOTO 275
.................... };
027A: INCF 34,F
027B: GOTO 24C
.................... while(input(CLK));
027C: BSF 03.5
027D: BSF 06.6
027E: BCF 03.5
027F: BTFSC 06.6
0280: GOTO 27C
.................... parity^=input(DATA);
0281: MOVLW 00
0282: BTFSC 35.0
0283: MOVLW 01
0284: MOVWF 36
0285: BSF 03.5
0286: BSF 06.5
0287: MOVLW 00
0288: BCF 03.5
0289: BTFSC 06.5
028A: MOVLW 01
028B: XORWF 36,W
028C: MOVWF 78
028D: BTFSC 78.0
028E: GOTO 291
028F: BCF 35.0
0290: GOTO 292
0291: BSF 35.0
.................... // if (parity)
.................... while(!input(CLK)); // ceka na jednicku hodin
0292: BSF 03.5
0293: BSF 06.6
0294: BCF 03.5
0295: BTFSS 06.6
0296: GOTO 292
.................... while(input(CLK));
0297: BSF 03.5
0298: BSF 06.6
0299: BCF 03.5
029A: BTFSC 06.6
029B: GOTO 297
.................... while(!input(CLK)); // ceka na jednicku hodin
029C: BSF 03.5
029D: BSF 06.6
029E: BCF 03.5
029F: BTFSS 06.6
02A0: GOTO 29C
.................... return (bajt);
02A1: MOVF 33,W
02A2: MOVWF 78
.................... }
02A3: RETLW 00
....................
....................
.................... void read_standard_byte(signed int8 *x,*y,unsigned int8 *tl1,*tl2,*tl3)
.................... {
.................... unsigned int8 st,nd,rd;
....................
.................... st = read_byte();
02A4: CALL 23A
02A5: MOVF 78,W
02A6: MOVWF 30
.................... nd = read_byte();
02A7: CALL 23A
02A8: MOVF 78,W
02A9: MOVWF 31
.................... rd = read_byte();
02AA: CALL 23A
02AB: MOVF 78,W
02AC: MOVWF 32
....................
.................... if ((st & 0b1000) == 0b1000) *x=-nd; else *x=nd;
02AD: MOVF 30,W
02AE: ANDLW 08
02AF: SUBLW 08
02B0: BTFSS 03.2
02B1: GOTO 2B8
02B2: MOVF 2B,W
02B3: MOVWF 04
02B4: MOVF 31,W
02B5: SUBLW 00
02B6: MOVWF 00
02B7: GOTO 2BC
02B8: MOVF 2B,W
02B9: MOVWF 04
02BA: MOVF 31,W
02BB: MOVWF 00
.................... if ((st & 0b10000) == 0b10000) *y=-rd; else *y=rd;
02BC: MOVF 30,W
02BD: ANDLW 10
02BE: SUBLW 10
02BF: BTFSS 03.2
02C0: GOTO 2C7
02C1: MOVF 2C,W
02C2: MOVWF 04
02C3: MOVF 32,W
02C4: SUBLW 00
02C5: MOVWF 00
02C6: GOTO 2CB
02C7: MOVF 2C,W
02C8: MOVWF 04
02C9: MOVF 32,W
02CA: MOVWF 00
....................
.................... *tl1=st & 1;
02CB: MOVF 2D,W
02CC: MOVWF 04
02CD: MOVF 30,W
02CE: ANDLW 01
02CF: MOVWF 00
.................... *tl2=(st >> 1) & 1;
02D0: MOVF 2E,W
02D1: MOVWF 04
02D2: BCF 03.0
02D3: RRF 30,W
02D4: ANDLW 01
02D5: MOVWF 00
.................... *tl3=(st >> 2) & 1;
02D6: MOVF 2F,W
02D7: MOVWF 04
02D8: RRF 30,W
02D9: MOVWF 77
02DA: RRF 77,F
02DB: MOVLW 3F
02DC: ANDWF 77,F
02DD: MOVF 77,W
02DE: ANDLW 01
02DF: MOVWF 00
.................... }
02E0: BCF 0A.3
02E1: GOTO 3A5 (RETURN)
.................... void ps2break()
.................... {
.................... output_low(CLK);
.................... }
.................... void ps2enable()
.................... {
.................... output_float(CLK);
.................... }
....................
....................
....................
....................
.................... void trigger()
.................... {
.................... output_high(TRIGGER_PIN);
.................... delay_us(50);
.................... output_low(TRIGGER_PIN);
.................... }
....................
.................... void main()
.................... {
02E2: CLRF 04
02E3: MOVLW 1F
02E4: ANDWF 03,F
02E5: BSF 03.5
02E6: BCF 1F.4
02E7: BCF 1F.5
02E8: MOVF 1B,W
02E9: ANDLW 80
02EA: MOVWF 1B
02EB: MOVLW 07
02EC: MOVWF 1C
02ED: MOVF 1C,W
02EE: BCF 03.5
02EF: BCF 0D.6
02F0: MOVLW 60
02F1: BSF 03.5
02F2: MOVWF 0F
.................... signed int16 x=0,y=0;
02F3: BCF 03.5
02F4: CLRF 21
02F5: CLRF 22
02F6: CLRF 23
02F7: CLRF 24
.................... signed int8 hodnota,dx,dy;
.................... unsigned int8 tl1,tl2,tl3;
....................
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
02F8: BSF 03.5
02F9: BCF 1F.4
02FA: BCF 1F.5
02FB: MOVF 1B,W
02FC: ANDLW 80
02FD: MOVWF 1B
.................... setup_adc(ADC_OFF);
02FE: BCF 03.5
02FF: BCF 1F.0
.................... setup_spi(FALSE);
0300: BCF 14.5
0301: BSF 03.5
0302: BCF 06.2
0303: BSF 06.1
0304: BCF 06.4
0305: MOVLW 00
0306: BCF 03.5
0307: MOVWF 14
0308: BSF 03.5
0309: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
030A: MOVF 01,W
030B: ANDLW C7
030C: IORLW 08
030D: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
030E: BCF 03.5
030F: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
0310: MOVLW 00
0311: MOVWF 78
0312: MOVWF 12
0313: MOVLW 00
0314: BSF 03.5
0315: MOVWF 12
.................... setup_comparator(NC_NC_NC_NC);
0316: MOVLW 07
0317: MOVWF 1C
0318: MOVF 05,W
0319: MOVLW 03
031A: MOVWF 77
031B: DECFSZ 77,F
031C: GOTO 31B
031D: MOVF 1C,W
031E: BCF 03.5
031F: BCF 0D.6
.................... setup_vref(FALSE);
0320: BSF 03.5
0321: CLRF 1D
....................
.................... lcd_init();
0322: BCF 03.5
0323: GOTO 06F
.................... Delay_ms(500);
0324: MOVLW 02
0325: MOVWF 2B
0326: MOVLW FA
0327: MOVWF 34
0328: CALL 033
0329: DECFSZ 2B,F
032A: GOTO 326
....................
.................... send(SET_REMOTE_MODE);
032B: MOVLW F0
032C: MOVWF 2B
032D: CALL 0A9
....................
.................... while (true)
.................... {
.................... LCD_gotoxy(1,1);
032E: MOVLW 01
032F: MOVWF 34
0330: MOVWF 35
0331: CALL 108
.................... printf(lcd_putc,"%X X=%ld Y=%ld TL1=%U TL2=%U TL3=%U",hodnota, x,y,tl1,tl2,tl3);
0332: MOVF 25,W
0333: MOVWF 2B
0334: MOVLW 37
0335: MOVWF 2C
0336: GOTO 14C
0337: MOVLW 20
0338: MOVWF 33
0339: CALL 119
033A: MOVLW 58
033B: MOVWF 33
033C: CALL 119
033D: MOVLW 3D
033E: MOVWF 33
033F: CALL 119
0340: MOVLW 10
0341: MOVWF 04
0342: MOVF 22,W
0343: MOVWF 2C
0344: MOVF 21,W
0345: MOVWF 2B
0346: CALL 16E
0347: MOVLW 20
0348: MOVWF 33
0349: CALL 119
034A: MOVLW 59
034B: MOVWF 33
034C: CALL 119
034D: MOVLW 3D
034E: MOVWF 33
034F: CALL 119
0350: MOVLW 10
0351: MOVWF 04
0352: MOVF 24,W
0353: MOVWF 2C
0354: MOVF 23,W
0355: MOVWF 2B
0356: CALL 16E
0357: MOVLW 0E
0358: MOVWF 2B
0359: MOVF 2B,W
035A: CALL 00C
035B: INCF 2B,F
035C: MOVWF 77
035D: MOVWF 33
035E: CALL 119
035F: MOVLW 13
0360: SUBWF 2B,W
0361: BTFSS 03.2
0362: GOTO 359
0363: MOVF 28,W
0364: MOVWF 2F
0365: MOVLW 18
0366: MOVWF 30
0367: CALL 1ED
0368: MOVLW 03
0369: MOVWF 2C
036A: MOVLW 20
036B: MOVWF 33
036C: CALL 119
036D: DECFSZ 2C,F
036E: GOTO 36A
036F: MOVLW 15
0370: MOVWF 2D
0371: MOVF 2D,W
0372: CALL 00C
0373: INCF 2D,F
0374: MOVWF 77
0375: MOVWF 33
0376: CALL 119
0377: MOVLW 19
0378: SUBWF 2D,W
0379: BTFSS 03.2
037A: GOTO 371
037B: MOVF 29,W
037C: MOVWF 2F
037D: MOVLW 18
037E: MOVWF 30
037F: CALL 1ED
0380: MOVLW 1B
0381: MOVWF 2E
0382: MOVF 2E,W
0383: CALL 00C
0384: INCF 2E,F
0385: MOVWF 77
0386: MOVWF 33
0387: CALL 119
0388: MOVLW 20
0389: SUBWF 2E,W
038A: BTFSS 03.2
038B: GOTO 382
038C: MOVF 2A,W
038D: MOVWF 2F
038E: MOVLW 18
038F: MOVWF 30
0390: CALL 1ED
.................... delay_ms(20);
0391: MOVLW 14
0392: MOVWF 34
0393: CALL 033
.................... send(READ_DATA);
0394: MOVLW EB
0395: MOVWF 2B
0396: CALL 0A9
.................... hodnota=read_byte();
0397: CALL 23A
0398: MOVF 78,W
0399: MOVWF 25
.................... read_standard_byte(&dx,&dy,&tl1,&tl2,&tl3);
039A: MOVLW 26
039B: MOVWF 2B
039C: MOVLW 27
039D: MOVWF 2C
039E: MOVLW 28
039F: MOVWF 2D
03A0: MOVLW 29
03A1: MOVWF 2E
03A2: MOVLW 2A
03A3: MOVWF 2F
03A4: GOTO 2A4
.................... x+=dx;
03A5: CLRF 7A
03A6: MOVF 26,W
03A7: BTFSC 26.7
03A8: DECF 7A,F
03A9: ADDWF 21,F
03AA: BTFSC 03.0
03AB: INCF 22,F
03AC: MOVF 7A,W
03AD: ADDWF 22,F
.................... y+=dy;
03AE: CLRF 7A
03AF: MOVF 27,W
03B0: BTFSC 27.7
03B1: DECF 7A,F
03B2: ADDWF 23,F
03B3: BTFSC 03.0
03B4: INCF 24,F
03B5: MOVF 7A,W
03B6: ADDWF 24,F
.................... }
03B7: GOTO 32E
.................... }
....................
03B8: SLEEP
 
Configuration Fuses:
Word 1: 3F78 NOWDT NOPUT MCLR BROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO
Word 2: 3FFF FCMEN IESO
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.PJT
0,0 → 1,39
[PROJECT]
Target=mys.HEX
Development_Mode=
Processor=0x688F
ToolSuite=CCS
 
[Directories]
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr
Library=
LinkerScript=
 
[Target Data]
FileList=mys.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[mys.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=mys.c
 
[Windows]
0=0000 mys.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.c
2=C:\library\CCS\lcd.c
3=D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h
4=C:\Program Files\PICC\devices\16F88.h
5=C:\library\kaklik\CCS\ps2.c
6=
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.SYM
0,0 → 1,109
015-016 CCP_1
015 CCP_1_LOW
016 CCP_1_HIGH
021-022 main.x
023-024 main.y
025 main.hodnota
026 main.dx
027 main.dy
028 main.tl1
029 main.tl2
02A main.tl3
02B lcd_init.i
02B send.command
02B-02C @PRINTF_LD_278.P1
02B @PRINTF_X_278.P2
02B read_standard_byte.x
02B main.@SCRATCH
02C send.n
02C @PRINTF_X_278.P1
02C read_standard_byte.y
02C lcd_init.@SCRATCH
02C main.@SCRATCH
02D send.parity
02D read_standard_byte.tl1
02D main.@SCRATCH
02D @PRINTF_LD_278.@SCRATCH
02E read_standard_byte.tl2
02E send.@SCRATCH
02E main.@SCRATCH
02E @PRINTF_LD_278.@SCRATCH
02F @PRINTF_U_278.P1
02F read_standard_byte.tl3
02F @PRINTF_LD_278.@SCRATCH
030 read_standard_byte.st
030 @PRINTF_U_278.P1
030 @PRINTF_LD_278.@SCRATCH
031 @DIV88.P1
031 read_standard_byte.nd
031 @PRINTF_LD_278.@SCRATCH
032 @DIV88.P1
032 read_standard_byte.rd
032 @PRINTF_LD_278.@SCRATCH
033 lcd_putc.c
033 read_byte.bajt
033 read_standard_byte.@SCRATCH
033 @DIV88.@SCRATCH
034 read_byte.i
034 lcd_gotoxy.x
034 @delay_ms1.P1
034 read_standard_byte.@SCRATCH
035 lcd_gotoxy.y
035.0 read_byte.parity
036 lcd_gotoxy.Adr
036 read_byte.@SCRATCH
037 lcd_gotoxy.@SCRATCH
038 lcd_send_byte.Adr
039 lcd_send_byte.n
03A lcd_send_nibble.n
03B lcd_send_nibble.@SCRATCH
03C lcd_send_nibble.@SCRATCH
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
079 @SCRATCH
07A @SCRATCH
07B @SCRATCH
09C.6 C1OUT
09C.7 C2OUT
 
0033 @delay_ms1
0004 @const27
0048 lcd_send_nibble
0059 lcd_send_byte
006F lcd_init
0108 lcd_gotoxy
0119 lcd_putc
00A9 send
023A read_byte
02A4 read_standard_byte
02E2 main
000C @const10225
014C @PRINTF_X_278
016E @PRINTF_LD_278
01D8 @DIV88
01ED @PRINTF_U_278
02E2 @cinit
 
Project Files:
D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.c
D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h
C:\Program Files\PICC\devices\16F88.h
C:\library\CCS\lcd.c
C:\library\kaklik\CCS\ps2.c
 
Compiler Settings:
Processor: PIC16F88
Pointer Size: 8
ADC Range: 0-255
Opt Level: 9
Short,Int,Long: 1,8,16
 
Output Files:
Errors: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.err
INHX8: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.HEX
Symbols: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.SYM
List: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.LST
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.cof
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.tre
Statistics: D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.sta
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.c
0,0 → 1,58
#include "D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h"
 
#define LCD_RS PIN_A0 // rizeni registru LCD displeje
#define LCD_E PIN_A1 // enable LCD displeje
#define LCD_DATA_LSB PIN_B0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
#include "C:\library\CCS\lcd.c" // modul pro ovladani LCD
 
#define TRIGGER_PIN PIN_B4
 
#DEFINE DATA PIN_B5 // drat DATA
#DEFINE CLK PIN_B6 // hodiny CLK
#include "C:\library\kaklik\CCS\ps2.c" // modul pro SW ovladani PS2
 
 
 
void trigger()
{
output_high(TRIGGER_PIN);
delay_us(50);
output_low(TRIGGER_PIN);
}
 
void main()
{
signed int16 x=0,y=0;
signed int8 hodnota,dx,dy;
unsigned int8 tl1,tl2,tl3;
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
 
lcd_init();
Delay_ms(200);
ps2send(RESET); // resetuje mys
read_byte(); // prijme 0xFA
read_byte(); // 0xAA self-test passed
read_byte(); // mouse ID
Delay_ms(200);
ps2send(SET_REMOTE_MODE);
 
while (true)
{
LCD_gotoxy(1,1);
printf(lcd_putc,"%X X=%ld Y=%ld TL1=%U TL2=%U TL3=%U",hodnota, x,y,tl1,tl2,tl3);
delay_ms(20);
send(READ_DATA);
hodnota=read_byte();
read_standard_byte(&dx,&dy,&tl1,&tl2,&tl3);
x+=dx;
y+=dy;
}
}
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.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/PIC_C/mereni/PS2mys/PIC16F88/mys.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.h
0,0 → 1,5
#include <16F88.h>
#device adc=8
#fuses NOWDT,INTRC_IO, NOPUT, MCLR, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO
#use delay(clock=4000000)
 
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.sta
0,0 → 1,45
 
ROM used: 953 (23%)
953 (23%) including unused fragments
 
1 Average locations per line
7 Average locations per statement
 
RAM used: 19 (11%) at main() level
33 (19%) worst case
 
Lines Stmts % Files
----- ----- --- -----
55 24 17 D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.c
6 0 0 D:\KAKLIK\programy\PIC_C\mereni\PS2mys\PIC16F88\mys.h
275 0 0 C:\Program Files\PICC\devices\16F88.h
312 47 29 C:\library\CCS\lcd.c
113 67 32 C:\library\kaklik\CCS\ps2.c
----- -----
1522 276 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 2 1 @delay_ms1
0 8 1 0 @const27
0 17 2 3 lcd_send_nibble
0 22 2 2 lcd_send_byte
0 58 6 2 lcd_init
0 17 2 4 lcd_gotoxy
0 51 5 1 lcd_putc
0 95 10 4 send
0 106 11 4 read_byte
0 62 7 10 read_standard_byte
0 215 23 14 main
0 39 4 0 @const10225
0 34 4 2 @PRINTF_X_278
0 106 11 8 @PRINTF_LD_278
0 21 2 3 @DIV88
0 77 8 2 @PRINTF_U_278
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-007FF 949 1095
00800-00FFF 0 2048
 
/programy/PIC_C/mereni/PS2mys/PIC16F88/mys.tre
0,0 → 1,668
ÀÄmys
ÀÄmain 0/215 Ram=14
ÃÄ??0??
ÃÄlcd_init 0/58 Ram=2
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@const27 0/8 Ram=0
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄsend 0/95 Ram=4
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@PRINTF_X_278 0/34 Ram=2
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@PRINTF_LD_278 0/106 Ram=8
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@PRINTF_LD_278 0/106 Ram=8
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@const10225 0/39 Ram=0
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@PRINTF_U_278 0/77 Ram=2
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@const10225 0/39 Ram=0
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@PRINTF_U_278 0/77 Ram=2
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@const10225 0/39 Ram=0
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@PRINTF_U_278 0/77 Ram=2
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄsend 0/95 Ram=4
ÃÄread_byte 0/106 Ram=4
ÀÄread_standard_byte 0/62 Ram=10
ÃÄread_byte 0/106 Ram=4
ÃÄread_byte 0/106 Ram=4
ÀÄread_byte 0/106 Ram=4
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.BAK
0,0 → 1,19
#include <16F88.h>
#device adc=8
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPUT //No Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#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
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOIESO //Internal External Switch Over mode enabled
 
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8)
 
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.PJT
0,0 → 1,40
[PROJECT]
Target=geiger.HEX
Development_Mode=2
Processor=0x688F
ToolSuite=CCS
 
[Directories]
Include=
Library=
LinkerScript=
 
[Target Data]
FileList=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[geiger.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
 
[Windows]
0=0000 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
2=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h
3=C:\Program Files\PICC\devices\16F88.h
4=
[Units]
Count=1
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c (main)
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.c
0,0 → 1,27
#include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h"
 
 
void main()
{
unsigned int16 n;
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
setup_timer_1(T1_DISABLED|T1_DIV_BY_1);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4);
setup_vref(VREF_LOW|1|VREF_A2);
setup_oscillator(False);
n=0;
set_timer0(0);
While(true)
{
printf("%Lu0, %u\n\r", n++, get_timer0());
set_timer0(0);
Delay_ms(10000);
}
}
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.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/PIC_C/mereni/geiger/bez_GPS/geiger.err
0,0 → 1,2
No Errors
0 Errors, 0 Warnings.
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.h
0,0 → 1,19
#include <16F88.h>
#device adc=8
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPUT //No Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#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
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOIESO //Internal External Switch Over mode disabled
 
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8)
 
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.hex
0,0 → 1,47
:1000000000308A00E12800008316861183128611D1
:100010000830F800000000000000F8171E28F81350
:10002000AE0C03188615031C861178171E2878134A
:10003000F80B10280000000000008615A73084008F
:10004000840B202800000000F81B0F28781B1728BD
:1000500000340408AD00270EF038A900A907E23EDD
:10006000AA00323EAC0027080F39AA07AA07AC073E
:10007000E93EAB00AB07AB07260E0F39AB07AC0769
:10008000AB0DAC0DAC09AC0D26080F39AC07A90DB2
:100090000730A8000A30AC07AB03031C4B28AB07A2
:1000A000AA03031C4F28AA07A903031C5328A90766
:1000B000A803031C57282830840007302D052D1372
:1000C00084072C30040203192D170008F700031DC4
:1000D00071282D1B71282D1A7D28AD19712820300B
:1000E0007428AD152D123030F707A7010408A600BB
:1000F0007708AE00042026088400840A2D1F61289A
:100100008A113C292908F801280203188A2828089E
:10011000F7009628F7010830AA00A80DF70D290866
:1001200077020318F700F80DAA0B8D280034780821
:100130002608A8006430A90082207708A600780865
:100140003030031DAA28A71CB128A719B128271AE7
:100150002030AD28A71127122714F8077808AE0021
:1001600004202608A8000A30A90082207708A600EB
:1001700078083030031DC228A719C628271CC628B6
:10018000271A2030F8077808AE0004203030A60780
:100190002608AE0004208A114A2924308400000871
:1001A0000319DF280630F800F701F70BD528F80B04
:1001B000D4287B30F700F70BDB28800BD2288A117C
:1001C000562984011F3083058316861183128615F4
:1001D00083161F129F121B0880399B0007309C005A
:1001E0001F129F121B0880399B0083121F1094124C
:1001F00083160611861406120030831294008316AB
:1002000094000108C739383881008312900100300A
:10021000F8009200003083169200061483129701B2
:100220009701063083169C0005080738E7398500DA
:100230001030F700F70B1A2900001C0883120D1369
:10024000E13083169D0005158F010F088312A2016E
:10025000A10181012208FA002108A10A0319A20ABA
:10026000A3007A08A4000108A50010308400240827
:10027000A7002308A60029283030AE0004202C3027
:10028000AE0004202030AE0004202508A6001B305C
:10029000A70097280A30AE0004200D30AE000420DD
:1002A00081012830A300FA30A400CD28A30B5329E4
:0402B0002A29630094
:04400E002A3FFC3F0A
:00000001FF
;PIC16F88
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.lst
0,0 → 1,250
CCS PCM C Compiler, Version 3.245, 27853 10-VI-06 10:23
 
Filename: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.lst
 
ROM used: 346 words (8%)
Largest free fragment is 2048
RAM used: 10 (6%) at main() level
19 (11%) worst case
Stack: 2 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 0E1
0003: NOP
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h"
.................... #include <16F88.h>
.................... //////// Standard Header file for the PIC16F88 device ////////////////
.................... #device PIC16F88
.................... #list
....................
.................... #device adc=8
....................
.................... #FUSES NOWDT //No Watch Dog Timer
.................... #FUSES HS //High speed Osc (> 4mhz)
.................... #FUSES NOPUT //No Power Up Timer
.................... #FUSES MCLR //Master Clear pin enabled
.................... #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
.................... #FUSES NOPROTECT //Code not protected from reading
.................... #FUSES NOFCMEN //Fail-safe clock monitor disabled
.................... #FUSES NOIESO //Internal External Switch Over mode disabled
....................
.................... #use delay(clock=20000000)
00CD: MOVLW 24
00CE: MOVWF 04
00CF: MOVF 00,W
00D0: BTFSC 03.2
00D1: GOTO 0DF
00D2: MOVLW 06
00D3: MOVWF 78
00D4: CLRF 77
00D5: DECFSZ 77,F
00D6: GOTO 0D5
00D7: DECFSZ 78,F
00D8: GOTO 0D4
00D9: MOVLW 7B
00DA: MOVWF 77
00DB: DECFSZ 77,F
00DC: GOTO 0DB
00DD: DECFSZ 00,F
00DE: GOTO 0D2
00DF: BCF 0A.3
00E0: GOTO 156 (RETURN)
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8)
*
0004: BSF 03.5
0005: BCF 06.3
0006: BCF 03.5
0007: BCF 06.3
0008: MOVLW 08
0009: MOVWF 78
000A: NOP
000B: NOP
000C: NOP
000D: BSF 78.7
000E: GOTO 01E
000F: BCF 78.7
0010: RRF 2E,F
0011: BTFSC 03.0
0012: BSF 06.3
0013: BTFSS 03.0
0014: BCF 06.3
0015: BSF 78.6
0016: GOTO 01E
0017: BCF 78.6
0018: DECFSZ 78,F
0019: GOTO 010
001A: NOP
001B: NOP
001C: NOP
001D: BSF 06.3
001E: MOVLW A7
001F: MOVWF 04
0020: DECFSZ 04,F
0021: GOTO 020
0022: NOP
0023: NOP
0024: BTFSC 78.7
0025: GOTO 00F
0026: BTFSC 78.6
0027: GOTO 017
0028: RETLW 00
....................
....................
....................
....................
.................... void main()
.................... {
*
00E1: CLRF 04
00E2: MOVLW 1F
00E3: ANDWF 03,F
00E4: BSF 03.5
00E5: BCF 06.3
00E6: BCF 03.5
00E7: BSF 06.3
00E8: BSF 03.5
00E9: BCF 1F.4
00EA: BCF 1F.5
00EB: MOVF 1B,W
00EC: ANDLW 80
00ED: MOVWF 1B
00EE: MOVLW 07
00EF: MOVWF 1C
.................... unsigned int16 n;
....................
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
00F0: BCF 1F.4
00F1: BCF 1F.5
00F2: MOVF 1B,W
00F3: ANDLW 80
00F4: MOVWF 1B
.................... setup_adc(ADC_OFF);
00F5: BCF 03.5
00F6: BCF 1F.0
.................... setup_spi(FALSE);
00F7: BCF 14.5
00F8: BSF 03.5
00F9: BCF 06.2
00FA: BSF 06.1
00FB: BCF 06.4
00FC: MOVLW 00
00FD: BCF 03.5
00FE: MOVWF 14
00FF: BSF 03.5
0100: MOVWF 14
.................... setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
0101: MOVF 01,W
0102: ANDLW C7
0103: IORLW 38
0104: MOVWF 01
.................... setup_timer_1(T1_DISABLED|T1_DIV_BY_1);
0105: BCF 03.5
0106: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
0107: MOVLW 00
0108: MOVWF 78
0109: MOVWF 12
010A: MOVLW 00
010B: BSF 03.5
010C: MOVWF 12
.................... setup_ccp1(CCP_OFF);
010D: BSF 06.0
010E: BCF 03.5
010F: CLRF 17
0110: CLRF 17
.................... setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4);
0111: MOVLW 06
0112: BSF 03.5
0113: MOVWF 1C
0114: MOVF 05,W
0115: IORLW 07
0116: ANDLW E7
0117: MOVWF 05
0118: MOVLW 10
0119: MOVWF 77
011A: DECFSZ 77,F
011B: GOTO 11A
011C: NOP
011D: MOVF 1C,W
011E: BCF 03.5
011F: BCF 0D.6
.................... setup_vref(VREF_LOW|1|VREF_A2);
0120: MOVLW E1
0121: BSF 03.5
0122: MOVWF 1D
0123: BSF 05.2
.................... setup_oscillator(False);
0124: CLRF 0F
0125: MOVF 0F,W
....................
.................... n=0;
0126: BCF 03.5
0127: CLRF 22
0128: CLRF 21
.................... set_timer0(0);
0129: CLRF 01
.................... While(true)
.................... {
.................... printf("%Lu0, %u\n\r", n++, get_timer0());
012A: MOVF 22,W
012B: MOVWF 7A
012C: MOVF 21,W
012D: INCF 21,F
012E: BTFSC 03.2
012F: INCF 22,F
0130: MOVWF 23
0131: MOVF 7A,W
0132: MOVWF 24
0133: MOVF 01,W
0134: MOVWF 25
0135: MOVLW 10
0136: MOVWF 04
0137: MOVF 24,W
0138: MOVWF 27
0139: MOVF 23,W
013A: MOVWF 26
013B: GOTO 029
013C: MOVLW 30
013D: MOVWF 2E
013E: CALL 004
013F: MOVLW 2C
0140: MOVWF 2E
0141: CALL 004
0142: MOVLW 20
0143: MOVWF 2E
0144: CALL 004
0145: MOVF 25,W
0146: MOVWF 26
0147: MOVLW 1B
0148: MOVWF 27
0149: GOTO 097
014A: MOVLW 0A
014B: MOVWF 2E
014C: CALL 004
014D: MOVLW 0D
014E: MOVWF 2E
014F: CALL 004
.................... set_timer0(0);
0150: CLRF 01
.................... Delay_ms(10000);
0151: MOVLW 28
0152: MOVWF 23
0153: MOVLW FA
0154: MOVWF 24
0155: GOTO 0CD
0156: DECFSZ 23,F
0157: GOTO 153
.................... }
0158: GOTO 12A
.................... }
0159: SLEEP
 
Configuration Fuses:
Word 1: 3F2A HS NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT
Word 2: 3FFC NOFCMEN NOIESO
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.sta
0,0 → 1,33
 
ROM used: 346 (8%)
346 (8%) including unused fragments
 
1 Average locations per line
20 Average locations per statement
 
RAM used: 10 (6%) at main() level
19 (11%) worst case
 
Lines Stmts % Files
----- ----- --- -----
28 17 100 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
20 0 0 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h
279 0 0 C:\Program Files\PICC\devices\16F88.h
----- -----
654 34 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 20 6 1 @delay_ms1
0 37 11 1 @PUTCHAR_1_
0 121 35 5 main
0 89 26 8 @PRINTF_LU_9600_51_53
0 21 6 3 @DIV88
0 54 16 2 @PRINTF_U_9600_51_53
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-007FF 342 1702
00800-00FFF 0 2048
 
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.sym
0,0 → 1,61
015-016 CCP_1
015 CCP_1_LOW
016 CCP_1_HIGH
021-022 main.n
023 main.@SCRATCH
024 @delay_ms1.P1
024 main.@SCRATCH
025 main.@SCRATCH
026-027 @PRINTF_LU_9600_51_53.P1
026 @PRINTF_U_9600_51_53.P2
027 @PRINTF_U_9600_51_53.P1
028 @DIV88.P1
028 @PRINTF_LU_9600_51_53.@SCRATCH
029 @DIV88.P1
029 @PRINTF_LU_9600_51_53.@SCRATCH
02A @PRINTF_LU_9600_51_53.@SCRATCH
02A @DIV88.@SCRATCH
02B @PRINTF_LU_9600_51_53.@SCRATCH
02C @PRINTF_LU_9600_51_53.@SCRATCH
02D @PRINTF_LU_9600_51_53.@SCRATCH
02E @PUTCHAR_1_.P1
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
079 @SCRATCH
07A @SCRATCH
07B @SCRATCH
09C.6 C1OUT
09C.7 C2OUT
 
00CD @delay_ms1
0004 @PUTCHAR_1_
00E1 main
0029 @PRINTF_LU_9600_51_53
0082 @DIV88
0097 @PRINTF_U_9600_51_53
00E1 @cinit
 
Project Files:
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h
C:\Program Files\PICC\devices\16F88.h
 
Units:
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c (main)
 
Compiler Settings:
Processor: PIC16F88
Pointer Size: 8
ADC Range: 0-255
Opt Level: 9
Short,Int,Long: 1,8,16
 
Output Files:
Errors: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.err
INHX8: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.hex
Symbols: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.sym
List: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.lst
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.cof
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.tre
Statistics: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.sta
/programy/PIC_C/mereni/geiger/bez_GPS/geiger.tre
0,0 → 1,17
ÀÄgeiger
ÀÄmain 0/121 Ram=5
ÃÄ??0??
ÃÄ@PRINTF_LU_9600_51_53 0/89 Ram=8
³ ÀÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PRINTF_U_9600_51_53 0/54 Ram=2
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/37 Ram=1
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/37 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÀÄ@delay_ms1 0/20 Ram=1
/programy/PIC_C/mereni/geiger/geiger.BAK
0,0 → 1,19
#include <16F88.h>
#device adc=8
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPUT //No Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#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
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOIESO //Internal External Switch Over mode enabled
 
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8)
 
/programy/PIC_C/mereni/geiger/geiger.PJT
0,0 → 1,40
[PROJECT]
Target=geiger.HEX
Development_Mode=2
Processor=0x688F
ToolSuite=CCS
 
[Directories]
Include=
Library=
LinkerScript=
 
[Target Data]
FileList=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[geiger.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
 
[Windows]
0=0000 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
2=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h
3=C:\Program Files\PICC\devices\16F88.h
4=
[Units]
Count=1
1=D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c (main)
/programy/PIC_C/mereni/geiger/geiger.c
0,0 → 1,27
#include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h"
 
 
void main()
{
unsigned int16 n;
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
setup_timer_1(T1_DISABLED|T1_DIV_BY_1);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4);
setup_vref(VREF_LOW|1|VREF_A2);
setup_oscillator(False);
n=0;
set_timer0(0);
While(true)
{
printf("%Lu0, %u\n\r", n++, get_timer0());
set_timer0(0);
Delay_ms(10000);
}
}
/programy/PIC_C/mereni/geiger/geiger.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/PIC_C/mereni/geiger/geiger.err
0,0 → 1,2
No Errors
0 Errors, 0 Warnings.
/programy/PIC_C/mereni/geiger/geiger.h
0,0 → 1,19
#include <16F88.h>
#device adc=8
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz)
#FUSES NOPUT //No Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#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
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOFCMEN //Fail-safe clock monitor disabled
#FUSES NOIESO //Internal External Switch Over mode disabled
 
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8)
 
/programy/PIC_C/mereni/geiger/geiger.hex
0,0 → 1,47
:1000000000308A00E12800008316861183128611D1
:100010000830F800000000000000F8171E28F81350
:10002000AE0C03188615031C861178171E2878134A
:10003000F80B10280000000000008615A73084008F
:10004000840B202800000000F81B0F28781B1728BD
:1000500000340408AD00270EF038A900A907E23EDD
:10006000AA00323EAC0027080F39AA07AA07AC073E
:10007000E93EAB00AB07AB07260E0F39AB07AC0769
:10008000AB0DAC0DAC09AC0D26080F39AC07A90DB2
:100090000730A8000A30AC07AB03031C4B28AB07A2
:1000A000AA03031C4F28AA07A903031C5328A90766
:1000B000A803031C57282830840007302D052D1372
:1000C00084072C30040203192D170008F700031DC4
:1000D00071282D1B71282D1A7D28AD19712820300B
:1000E0007428AD152D123030F707A7010408A600BB
:1000F0007708AE00042026088400840A2D1F61289A
:100100008A113C292908F801280203188A2828089E
:10011000F7009628F7010830AA00A80DF70D290866
:1001200077020318F700F80DAA0B8D280034780821
:100130002608A8006430A90082207708A600780865
:100140003030031DAA28A71CB128A719B128271AE7
:100150002030AD28A71127122714F8077808AE0021
:1001600004202608A8000A30A90082207708A600EB
:1001700078083030031DC228A719C628271CC628B6
:10018000271A2030F8077808AE0004203030A60780
:100190002608AE0004208A114A2924308400000871
:1001A0000319DF280630F800F701F70BD528F80B04
:1001B000D4287B30F700F70BDB28800BD2288A117C
:1001C000562984011F3083058316861183128615F4
:1001D00083161F129F121B0880399B0007309C005A
:1001E0001F129F121B0880399B0083121F1094124C
:1001F00083160611861406120030831294008316AB
:1002000094000108C739383881008312900100300A
:10021000F8009200003083169200061483129701B2
:100220009701063083169C0005080738E7398500DA
:100230001030F700F70B1A2900001C0883120D1369
:10024000E13083169D0005158F010F088312A2016E
:10025000A10181012208FA002108A10A0319A20ABA
:10026000A3007A08A4000108A50010308400240827
:10027000A7002308A60029283030AE0004202C3027
:10028000AE0004202030AE0004202508A6001B305C
:10029000A70097280A30AE0004200D30AE000420DD
:1002A00081012830A300FA30A400CD28A30B5329E4
:0402B0002A29630094
:04400E002A3FFC3F0A
:00000001FF
;PIC16F88
/programy/PIC_C/mereni/geiger/geiger.lst
0,0 → 1,250
CCS PCM C Compiler, Version 3.245, 27853 10-VI-06 10:23
 
Filename: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.lst
 
ROM used: 346 words (8%)
Largest free fragment is 2048
RAM used: 10 (6%) at main() level
19 (11%) worst case
Stack: 2 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 0E1
0003: NOP
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h"
.................... #include <16F88.h>
.................... //////// Standard Header file for the PIC16F88 device ////////////////
.................... #device PIC16F88
.................... #list
....................
.................... #device adc=8
....................
.................... #FUSES NOWDT //No Watch Dog Timer
.................... #FUSES HS //High speed Osc (> 4mhz)
.................... #FUSES NOPUT //No Power Up Timer
.................... #FUSES MCLR //Master Clear pin enabled
.................... #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
.................... #FUSES NOPROTECT //Code not protected from reading
.................... #FUSES NOFCMEN //Fail-safe clock monitor disabled
.................... #FUSES NOIESO //Internal External Switch Over mode disabled
....................
.................... #use delay(clock=20000000)
00CD: MOVLW 24
00CE: MOVWF 04
00CF: MOVF 00,W
00D0: BTFSC 03.2
00D1: GOTO 0DF
00D2: MOVLW 06
00D3: MOVWF 78
00D4: CLRF 77
00D5: DECFSZ 77,F
00D6: GOTO 0D5
00D7: DECFSZ 78,F
00D8: GOTO 0D4
00D9: MOVLW 7B
00DA: MOVWF 77
00DB: DECFSZ 77,F
00DC: GOTO 0DB
00DD: DECFSZ 00,F
00DE: GOTO 0D2
00DF: BCF 0A.3
00E0: GOTO 156 (RETURN)
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B5,bits=8)
*
0004: BSF 03.5
0005: BCF 06.3
0006: BCF 03.5
0007: BCF 06.3
0008: MOVLW 08
0009: MOVWF 78
000A: NOP
000B: NOP
000C: NOP
000D: BSF 78.7
000E: GOTO 01E
000F: BCF 78.7
0010: RRF 2E,F
0011: BTFSC 03.0
0012: BSF 06.3
0013: BTFSS 03.0
0014: BCF 06.3
0015: BSF 78.6
0016: GOTO 01E
0017: BCF 78.6
0018: DECFSZ 78,F
0019: GOTO 010
001A: NOP
001B: NOP
001C: NOP
001D: BSF 06.3
001E: MOVLW A7
001F: MOVWF 04
0020: DECFSZ 04,F
0021: GOTO 020
0022: NOP
0023: NOP
0024: BTFSC 78.7
0025: GOTO 00F
0026: BTFSC 78.6
0027: GOTO 017
0028: RETLW 00
....................
....................
....................
....................
.................... void main()
.................... {
*
00E1: CLRF 04
00E2: MOVLW 1F
00E3: ANDWF 03,F
00E4: BSF 03.5
00E5: BCF 06.3
00E6: BCF 03.5
00E7: BSF 06.3
00E8: BSF 03.5
00E9: BCF 1F.4
00EA: BCF 1F.5
00EB: MOVF 1B,W
00EC: ANDLW 80
00ED: MOVWF 1B
00EE: MOVLW 07
00EF: MOVWF 1C
.................... unsigned int16 n;
....................
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
00F0: BCF 1F.4
00F1: BCF 1F.5
00F2: MOVF 1B,W
00F3: ANDLW 80
00F4: MOVWF 1B
.................... setup_adc(ADC_OFF);
00F5: BCF 03.5
00F6: BCF 1F.0
.................... setup_spi(FALSE);
00F7: BCF 14.5
00F8: BSF 03.5
00F9: BCF 06.2
00FA: BSF 06.1
00FB: BCF 06.4
00FC: MOVLW 00
00FD: BCF 03.5
00FE: MOVWF 14
00FF: BSF 03.5
0100: MOVWF 14
.................... setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
0101: MOVF 01,W
0102: ANDLW C7
0103: IORLW 38
0104: MOVWF 01
.................... setup_timer_1(T1_DISABLED|T1_DIV_BY_1);
0105: BCF 03.5
0106: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
0107: MOVLW 00
0108: MOVWF 78
0109: MOVWF 12
010A: MOVLW 00
010B: BSF 03.5
010C: MOVWF 12
.................... setup_ccp1(CCP_OFF);
010D: BSF 06.0
010E: BCF 03.5
010F: CLRF 17
0110: CLRF 17
.................... setup_comparator(A0_A2_A1_A2_OUT_ON_A3_A4);
0111: MOVLW 06
0112: BSF 03.5
0113: MOVWF 1C
0114: MOVF 05,W
0115: IORLW 07
0116: ANDLW E7
0117: MOVWF 05
0118: MOVLW 10
0119: MOVWF 77
011A: DECFSZ 77,F
011B: GOTO 11A
011C: NOP
011D: MOVF 1C,W
011E: BCF 03.5
011F: BCF 0D.6
.................... setup_vref(VREF_LOW|1|VREF_A2);
0120: MOVLW E1
0121: BSF 03.5
0122: MOVWF 1D
0123: BSF 05.2
.................... setup_oscillator(False);
0124: CLRF 0F
0125: MOVF 0F,W
....................
.................... n=0;
0126: BCF 03.5
0127: CLRF 22
0128: CLRF 21
.................... set_timer0(0);
0129: CLRF 01
.................... While(true)
.................... {
.................... printf("%Lu0, %u\n\r", n++, get_timer0());
012A: MOVF 22,W
012B: MOVWF 7A
012C: MOVF 21,W
012D: INCF 21,F
012E: BTFSC 03.2
012F: INCF 22,F
0130: MOVWF 23
0131: MOVF 7A,W
0132: MOVWF 24
0133: MOVF 01,W
0134: MOVWF 25
0135: MOVLW 10
0136: MOVWF 04
0137: MOVF 24,W
0138: MOVWF 27
0139: MOVF 23,W
013A: MOVWF 26
013B: GOTO 029
013C: MOVLW 30
013D: MOVWF 2E
013E: CALL 004
013F: MOVLW 2C
0140: MOVWF 2E
0141: CALL 004
0142: MOVLW 20
0143: MOVWF 2E
0144: CALL 004
0145: MOVF 25,W
0146: MOVWF 26
0147: MOVLW 1B
0148: MOVWF 27
0149: GOTO 097
014A: MOVLW 0A
014B: MOVWF 2E
014C: CALL 004
014D: MOVLW 0D
014E: MOVWF 2E
014F: CALL 004
.................... set_timer0(0);
0150: CLRF 01
.................... Delay_ms(10000);
0151: MOVLW 28
0152: MOVWF 23
0153: MOVLW FA
0154: MOVWF 24
0155: GOTO 0CD
0156: DECFSZ 23,F
0157: GOTO 153
.................... }
0158: GOTO 12A
.................... }
0159: SLEEP
 
Configuration Fuses:
Word 1: 3F2A HS NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT
Word 2: 3FFC NOFCMEN NOIESO
/programy/PIC_C/mereni/geiger/geiger.sta
0,0 → 1,33
 
ROM used: 346 (8%)
346 (8%) including unused fragments
 
1 Average locations per line
20 Average locations per statement
 
RAM used: 10 (6%) at main() level
19 (11%) worst case
 
Lines Stmts % Files
----- ----- --- -----
28 17 100 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
20 0 0 D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h
279 0 0 C:\Program Files\PICC\devices\16F88.h
----- -----
654 34 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 20 6 1 @delay_ms1
0 37 11 1 @PUTCHAR_1_
0 121 35 5 main
0 89 26 8 @PRINTF_LU_9600_51_53
0 21 6 3 @DIV88
0 54 16 2 @PRINTF_U_9600_51_53
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-007FF 342 1702
00800-00FFF 0 2048
 
/programy/PIC_C/mereni/geiger/geiger.sym
0,0 → 1,61
015-016 CCP_1
015 CCP_1_LOW
016 CCP_1_HIGH
021-022 main.n
023 main.@SCRATCH
024 @delay_ms1.P1
024 main.@SCRATCH
025 main.@SCRATCH
026-027 @PRINTF_LU_9600_51_53.P1
026 @PRINTF_U_9600_51_53.P2
027 @PRINTF_U_9600_51_53.P1
028 @DIV88.P1
028 @PRINTF_LU_9600_51_53.@SCRATCH
029 @DIV88.P1
029 @PRINTF_LU_9600_51_53.@SCRATCH
02A @PRINTF_LU_9600_51_53.@SCRATCH
02A @DIV88.@SCRATCH
02B @PRINTF_LU_9600_51_53.@SCRATCH
02C @PRINTF_LU_9600_51_53.@SCRATCH
02D @PRINTF_LU_9600_51_53.@SCRATCH
02E @PUTCHAR_1_.P1
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
079 @SCRATCH
07A @SCRATCH
07B @SCRATCH
09C.6 C1OUT
09C.7 C2OUT
 
00CD @delay_ms1
0004 @PUTCHAR_1_
00E1 main
0029 @PRINTF_LU_9600_51_53
0082 @DIV88
0097 @PRINTF_U_9600_51_53
00E1 @cinit
 
Project Files:
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.h
C:\Program Files\PICC\devices\16F88.h
 
Units:
D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.c (main)
 
Compiler Settings:
Processor: PIC16F88
Pointer Size: 8
ADC Range: 0-255
Opt Level: 9
Short,Int,Long: 1,8,16
 
Output Files:
Errors: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.err
INHX8: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.hex
Symbols: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.sym
List: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.lst
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.cof
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.tre
Statistics: D:\KAKLIK\programy\PIC_C\mereni\geiger\geiger.sta
/programy/PIC_C/mereni/geiger/geiger.tre
0,0 → 1,17
ÀÄgeiger
ÀÄmain 0/121 Ram=5
ÃÄ??0??
ÃÄ@PRINTF_LU_9600_51_53 0/89 Ram=8
³ ÀÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PRINTF_U_9600_51_53 0/54 Ram=2
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/37 Ram=1
³ ÃÄ@DIV88 0/21 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/37 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÃÄ@PUTCHAR_1_ 0/37 Ram=1
ÀÄ@delay_ms1 0/20 Ram=1
/programy/PIC_C/mereni/geiger/nmea.c
0,0 → 1,1434
// Change the following to change the clock frequency
#define CRYSTAL_FREQ 16000000
// Change the following to change between 16 or 20 column display
#define DISPLAY_COLS 20
// Speed units are "1" (nautical knots), "2" (metric kph), or "3" (statute mph)
#define SPEED_UNITS 1
 
/****************************************************************************
GPS18.c
 
This program receives NMEA-0183 data from a GPS and displays it.
Meant for large display version still in 16F876.
Three buttons
Automicaly resets if main loop stops (not the best solution, still don't know why it's stopping)
 
Next: don't display GPS screens unless GPS is active
detect display needing reset
preset data eeprom for first-time operation
don't display init stuff if reseting from main loop
 
 
 
+5 +5+5
| | |
20 15 2
---------- ----------
~SerIn -----18-| |-24-----11-|DB4 A Vdd |
| |-25-----12-|DB5 |
ADC0 ------2-| |-26-----13-|DB6 |
ADC1 ------3-| 16F876 |-27-----14-|DB7 Vo| 3--
ADC2 ------5-| | | LCD | |
| |-14------6-|EN | |
XTAL--9-| |-15------4-|R/S | |
XTAL-10-| |-28-FET-16-|K | |
| | | RW Vss | |
BUTTON 1---21-| | ---------- |
BUTTON 2---22-| | 1 5 |
BUTTON 3---23-| | | | |
| | Gnd Gnd |
| | |
| |-11----------R/C-----------
| |
| |
----------
8 19
| |
Gnd Gnd
 
***************************************************************************/
#case
#include <16F876.h>
#include <jonsinc.h>
#device = *=16 ADC=10 /* allow RAM addresses over 255 */
 
#if ( ( CRYSTAL_FREQ < 4000000) || ( CRYSTAL_FREQ > 20000000 ) )
#error "CRYSTAL FREQ" not defined to between 8000000 and 20000000
#endif
#if ( ( DISPLAY_COLS != 16 ) && ( DISPLAY_COLS != 20 ) )
#error "DISPLAY COLS" not defined to 16 or 20
#endif
 
// RMC_TIME = 1 per clock megahertz, rounded
#define RMC_TIME CRYSTAL_FREQ/1000000
 
#define LCD_D0 PIN_B3
#define LCD_D1 PIN_B4
#define LCD_D2 PIN_B5
#define LCD_D3 PIN_B6
#define LCD_EN PIN_C3
#define LCD_RS PIN_C4
#define RX_IN PIN_C7
#define BUTTON_1 PIN_B0
#define BUTTON_2 PIN_B1
#define BUTTON_3 PIN_B2
#define LCD_BACKLITE PIN_B7
#define LINE_1 0x00
#define LINE_2 0x40
#if DISPLAY_COLS == 20
#define LINE_3 0x14
#define LINE_4 0x54
#endif
#if DISPLAY_COLS == 16
#define LINE_3 0x10
#define LINE_4 0x50
#endif
#define CLEAR_DISP 0x01
#define EOF 0x00
#define COMMA ','
#define CR 13
#define SPACE ' '
#define PERIOD '.'
#define DEGREE 0xdf
#define DOLLAR '$'
#define NULL 0
#define GPRMC_CODE 75
#define GPRMB_CODE 74
#define RX_BUFFER_SIZE 70
#define POSITION_SCREEN 1
#define WAYPOINT_SCREEN 2
#define BATTERY_SCREEN 3
#define HIDDEN_RMC 5
#define WARNING_MSG 0
#define NODATA_MSG 1
#define ACTIVITY_SYMBOL 0xFF
#define MAX_VOLTS 15
#define EEPROM_CONTRAST 0
#define EEPROM_INITIAL 1
 
/* Set the following define to "YES" to display XOR'ed GPS sentence code */
/* such as GPRMC and the display will read out the value of 74. */
#define GET_GPS_CODE NO
 
#separate void Display ( void );
#separate void LCD_Init ( void );
#separate void LCD_SetPosition ( unsigned int cX );
#separate void LCD_PutChar ( unsigned int cX );
#separate void LCD_PutCmd ( unsigned int cX );
#separate void LCD_PulseEnable ( void );
#separate void LCD_SetData ( unsigned int cX );
#separate void SkipField ( char cCnt );
#separate char GetField ( void );
#separate void InitRxBuffer ( char cCode );
#separate char GetRxChar ( void );
#separate void DisplayLatLon ( void );
#separate void DisplayWaypoint ( void );
#separate void DisplayLatitude ( char cLine );
#separate void DisplayLongitude ( char cLine );
#separate void DisplayHeading ( char cLine );
#separate void DisplaySpeed ( char cLine );
#separate void DisplaySteer ( char cLine, char cX );
#separate void DisplayWaypointName ( char cLine, char cX );
#separate void DisplayDistance ( char cLine, char cX );
#separate void DisplayBearing ( char cLine, char cX );
#separate void GetUtcAndMagVar ( void );
#separate long TrueToMag ( long iH );
#separate long FieldFiveToLong ( void );
#separate void DisplayAnalog ( void );
#separate void DisplayScaledVoltage ( long iV, char cScale );
#separate void DisplayArrival ( char cLine );
#separate void DisplayMessage ( char cMsgNum );
#separate void DisplayTemplateLatLon ( void );
#separate void DisplayTemplateWaypoint ( void );
#separate void DisplayTemplateAnalog ( void );
#separate void Delay5mS ( char cCnt );
 
#fuses HS, NOPROTECT, PUT, NOWDT, BROWNOUT, NOLVP, NOCPD
#use standard_io ( A )
#use standard_io ( B )
#use standard_io ( C )
#use delay ( clock = CRYSTAL_FREQ )
#use rs232 ( baud=4800, xmit=PIN_C6, rcv=PIN_C7, ERRORS ) // XMIT must be assigned to enable hardward USART
#priority RDA, RTCC, EXT
 
static char cC [ 10 ]; // local buffer
static char cTimeOut;
static char cRxBuffer [ RX_BUFFER_SIZE ]; // Fifo
static char cRxByteCnt; // Number of bytes in the recv fifo
static char *cRxBufferWritePtr; // Pointers for the Rx buffer
static char *cRxBufferReadPtr;
static char cRxIsrState, cRxMsgTypeReceived, cRxMsgTypeDesired;
static char cRxMsgReady, cReceiveFlag;
static long iVar, iLastRange, iTimeOut;
static char cVarDir, cScreenChanged, cAdcDone;
static char cButtonPressed, cSkip, cButtonCount;
static char cScreen, cSavedScreen, cRmcTimer1, cRmcTimer2;
static char cToFrom [ 5 ], cIndicator, cIllumination, cRxErrorFlag;
static char cDone, cContrast;
 
/*******************************************************************/
#int_ad
void AdcInterrupt ( void )
{
/* Gets here when ADC is done conversion, sets flag */
cAdcDone = YES;
}
 
#int_timer1
void Timer1Interrupt ( void )
{
/* Periodic RMC data timer, gets here every 204mS */
/* This routine forces RMC to run every 10 minutes to update */
/* magnetic variation */
if ( cRmcTimer1-- == 0 )
{
cRmcTimer1 = 255; // 52 seconds @ 10.240MHz
if ( cRmcTimer2-- == 0 )
{
cRmcTimer2 = RMC_TIME; // triggers every 10 minutes
cSavedScreen = cScreen; // save current screen type
cScreen = HIDDEN_RMC; // force RMC to run
}
}
}
 
#int_rtcc
void Timer0Interrupt ( void )
{
// Gets here every 16.4mS at 8MHz, 8.2mS at 16MHz
// Handles data timeout and switch debounce.
 
// DATA TIMEOUT TIMER
if ( cTimeOut != 0 )
{
cTimeOut--;
}
 
// This timer is preset by the normal operating loop, unless the operating
// loop stops looping, at which point iTimeOut finally decrements to zero
// and resets CPU.
if ( iTimeOut != 0 )
{
iTimeOut--;
}
else
{
reset_cpu(); // force reset
}
 
if ( input ( BUTTON_2 ) == LOW ) // if button still pressed
{
cScreen = WAYPOINT_SCREEN;
cSkip = YES; // skip out of anything in process
cScreenChanged = YES; // repaint complete screen
}
 
if ( input ( BUTTON_3 ) == LOW ) // if button still pressed
{
cScreen = BATTERY_SCREEN;
cSkip = YES; // skip out of anything in process
cScreenChanged = YES; // repaint complete screen
}
 
// SWITCH DEBOUNCE
if ( input ( BUTTON_1 ) == LOW ) // if button still pressed
{
if ( cButtonCount < 255 ) // hold at 255
{
cButtonCount++; // otherwise increment
}
}
else // if button is unpressed
{
if ( cButtonCount > 2 ) // filter out glitches
{
//If button press is greater than 3.3 seconds, cold reset
if ( cButtonCount == 255 )
{
reset_cpu();
}
if ( ( cButtonCount > 57 ) && ( cButtonCount < 255 ) )
{
if ( cScreen != HIDDEN_RMC ) // if not in the middle of getting magnetic variation
{
// cIllumination ^= ON;
output_bit ( LCD_BACKLITE, cIllumination ^= ON );
}
}
// If button press is less than 0.5 second
if ( cButtonCount <= 57 )
{
if ( cScreen != HIDDEN_RMC ) // if not in the middle of getting magnetic variation
{
//if ( cScreen++ >= BATTERY_SCREEN ) // increment to next screen
{
cScreen = POSITION_SCREEN; // wrap
}
cSkip = YES; // skip out of anything in process
cScreenChanged = YES; // repaint complete screen
}
}
}
cButtonCount = 0; // restart
}
}
 
#int_rda
void SerialInterrupt ( void )
{
/*
Reads incoming data from the USART and puts in in a rolling buffer
( but in this application, it should never roll.)
If the buffer is full, this routine just discards the received byte.
Not checking the LRC byte at the end of the NMEA-0183 sentence.
*/
char cChar;
 
if ( rs232_errors & 0x04 ) // get framing error bit from Rx status reg
{
cRxErrorFlag = ON;
}
cChar = getchar(); // get char from UART, clear any errors
 
if ( cRxByteCnt == RX_BUFFER_SIZE ) // is recv fifo full ???
{
goto done;
}
switch ( cRxIsrState )
{
case 0:
{
if ( cChar == DOLLAR ) // if start of NMEA0183 message
{
cRxByteCnt = 0; // reset byte count
cReceiveFlag = OFF; // default to off
cRxMsgTypeReceived = NULL; // set hashed value to null
cRxIsrState++; // next state
}
break;
}
case 1: // five type characters to obtain
case 2:
case 3:
case 4:
case 5:
{
cRxMsgTypeReceived ^= cChar; // hash in msg type
if ( cRxIsrState++ == 5 ) // if time to check message type
{
if ( cRxMsgTypeReceived == cRxMsgTypeDesired ) // if good
{
cReceiveFlag = YES; // enable receiving
cRxBufferWritePtr = cRxBuffer; // reset to beginning of buffer
}
else // don't want this message
{
cRxIsrState = 0; // reset to look for next msg
}
}
break;
}
case 6:
{
/* Case 6 skips the comma character following msg type */
cRxIsrState++;
break;
}
default: // remainder of characters
{
if ( cReceiveFlag == YES ) // if this message is wanted
{
*cRxBufferWritePtr = cChar; // put char in fifo
cRxBufferWritePtr++; // increment pointer
if ( cRxBufferWritePtr == ( cRxBuffer + RX_BUFFER_SIZE ) ) // pointer past end ?
{
cRxBufferWritePtr = cRxBuffer; // set pointer to start of fifo
}
cRxByteCnt++; // Increment byte count
if ( cChar == CR )
{
cRxMsgReady = YES; // signal that message is ready
cReceiveFlag = NO; // no more receive
}
}
}
}
done:;
}
 
/*******************************************************************/
 
void main ( void )
{
char cX;
 
iTimeOut = 65535; // default to very long to get by init
/* INITIALIZE */
output_float ( RX_IN ); // ensure Rx input is HiZ
output_float ( BUTTON_1 ); // ensure switch input is HiZ
output_float ( BUTTON_2 ); // ensure switch input is HiZ
output_float ( BUTTON_3 ); // ensure switch input is HiZ
output_low ( LCD_BACKLITE ); // turn off backlighting
port_b_pullups ( ON ); // enable pullups on switches
 
// GET SAVED SETTINGS
cContrast = read_eeprom ( EEPROM_CONTRAST ); // get stored value
 
// PWM is for display contrast
setup_ccp2 ( CCP_PWM ); // set for PWM mode
//The cycle time will be (1/clock)*4*t2div*(period+1)
// 1/8000000 * 4 * 1 * 128 = 51.2uS = 19.5KHz
setup_timer_2 ( T2_DIV_BY_1, 255, 1 ); // set PWM period
// duty cycle = value*(1/clock)*t2div
// 10 * 1/8000000 * 1 = 1.2uS
set_pwm2_duty ( cContrast ); // set contrast duty cycle
 
// SETUP TIMER 0
// Need 8-bit Timer0 to roll over every 13mS, approximately.
// Roll time = 256 * 1 / ( clock_freq / prescaler setting / 4 )
#if CRYSTAL_FREQ >= 15000000
setup_counters ( RTCC_INTERNAL, RTCC_DIV_256 ); // ~13mS timer wrap
#elif CRYSTAL_FREQ >= 8000000
setup_counters ( RTCC_INTERNAL, RTCC_DIV_128 ); // ~13mS timer wrap
#elif CRYSTAL_FREQ < 8000000
setup_counters ( RTCC_INTERNAL, RTCC_DIV_64 ); // ~13mS timer wrap
#endif
 
// Timer 1 roll time = 65536 * 1 / ( clock_freq / prescaler setting / 4 )
setup_timer_1 ( T1_INTERNAL | T1_DIV_BY_8 ); // 16-bit timer
 
setup_adc_ports ( RA0_RA1_RA3_ANALOG ); /* these three statements set up the ADC */
setup_adc ( ADC_CLOCK_INTERNAL );
cIllumination = OFF;
 
LCD_Init(); // set up LCD for 4-wire bus, etc.
 
/* INIT MESSAGE */
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( LINE_1 + 0 );
printf ( LCD_PutChar, " Northern Light " ); // welcome screen
LCD_SetPosition ( LINE_2 + 2 );
printf ( LCD_PutChar, "Monitor/Repeater" );
LCD_SetPosition ( LINE_3 + 3 );
printf ( LCD_PutChar, "v18 06/21/03" );
LCD_SetPosition ( LINE_4 + 5 );
printf ( LCD_PutChar, "c Jon Fick" );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( LINE_1 + 0);
printf ( LCD_PutChar, " Northern Light " ); // welcome screen
LCD_SetPosition ( LINE_2 + 2 );
printf ( LCD_PutChar, "GPS Repeater" );
LCD_SetPosition ( LINE_3 + 1 );
printf ( LCD_PutChar, "v18 06/21/03" );
LCD_SetPosition ( LINE_4 + 3 );
printf ( LCD_PutChar, "c Jon Fick" );
#endif
delay_ms ( 1000 );
 
/* INSTRUCTION MESSAGE */
LCD_PutCmd ( CLEAR_DISP );
LCD_SetPosition ( LINE_1 + 0 );
printf ( LCD_PutChar, "BUTTONS:" );
LCD_SetPosition ( LINE_2 + 0 );
printf ( LCD_PutChar, "<-- Lat/Lon" );
LCD_SetPosition ( LINE_3 + 0 );
printf ( LCD_PutChar, "<-- Waypoint" );
LCD_SetPosition ( LINE_4 + 0 );
printf ( LCD_PutChar, "<-- Battery" );
delay_ms ( 2000 );
 
/* SETUP MODE */
if ( input ( BUTTON_1 ) == LOW ) // if button is pressed
{
LCD_PutCmd ( CLEAR_DISP );
LCD_SetPosition ( LINE_1 + 0 );
printf ( LCD_PutChar, "Set contrast:" );
LCD_SetPosition ( LINE_2 + 0 );
printf ( LCD_PutChar, "<-- More" );
LCD_SetPosition ( LINE_3 + 0 );
printf ( LCD_PutChar, "<-- DONE" );
LCD_SetPosition ( LINE_4 + 0 );
printf ( LCD_PutChar, "<-- Less" );
while ( input ( BUTTON_1 ) == LOW ); // wait for switch to be released after entering SETUP mode
cContrast = 120; // start at full contrast
cDone = NO;
while ( cDone == NO )
{
set_pwm2_duty ( cContrast ); // update contrast
if ( input ( BUTTON_1 ) == LOW )
{
if ( cContrast > 0 )
{
cContrast--; // more
}
}
if ( input ( BUTTON_2 ) == LOW )
{
cDone = YES; // done
}
if ( input ( BUTTON_3 ) == LOW )
{
if ( cContrast < 255 )
{
cContrast++; // less
}
}
delay_ms ( 30 ); // autorepeat
}
write_eeprom ( EEPROM_CONTRAST, cContrast ); // save CONTRAST to EEPROM
 
LCD_PutCmd ( CLEAR_DISP );
LCD_SetPosition ( LINE_2 + 0 );
printf ( LCD_PutChar, "<- Press initial" );
LCD_SetPosition ( LINE_3 + 0 );
printf ( LCD_PutChar, " bootup screen" );
while ( input ( BUTTON_1 ) == LOW ); // wait until button not pressed
cX = POSITION_SCREEN;
while ( TRUE )
{
LCD_SetPosition ( LINE_4 + 3 );
switch ( cX )
{
case POSITION_SCREEN:
{
printf ( LCD_PutChar, "POSITION " );
break;
}
case WAYPOINT_SCREEN:
{
printf ( LCD_PutChar, "WAYPOINT " );
break;
}
case BATTERY_SCREEN:
{
printf ( LCD_PutChar, "BATTERY " );
break;
}
}
delay_ms ( 750 );
if ( input ( BUTTON_1 ) == LOW ) // if button is pressed
{
write_eeprom ( EEPROM_INITIAL, cX ); // save screen number to EEPROM
break;
}
if ( cX++ == BATTERY_SCREEN )
{
cX = POSITION_SCREEN;
}
}
LCD_PutCmd ( CLEAR_DISP );
}
 
/* This IF/ENDIF is a tool for getting the $GP... codes */
/* that are used in the switch/case in the main loop. */
#if ( GET_GPS_CODE == YES )
printf ( LCD_PutChar, "%u", 'G'^'P'^'R'^'M'^'B');
while ( TRUE );
#endif
 
/* INTERRUPTS */
ext_int_edge ( H_TO_L ); // set falling edge ext interrupt
enable_interrupts ( INT_TIMER1 ); // enable Timer1 interrupt
enable_interrupts ( INT_RDA ); // enable serial interrupt
enable_interrupts ( INT_RTCC ); // enable Timer0 interrupt
enable_interrupts ( INT_AD ); // enable ADC interrupt
enable_interrupts ( GLOBAL ); // enable all interrupts
 
/* VARIABLES */
iVar = NULL; // default, no variation yet
cVarDir = SPACE; // default, no variation yet
cRmcTimer1 = 255; // initialize to 52 seconds
cRmcTimer2 = RMC_TIME; // trigger forced RMC after 10 minutes
cScreen = HIDDEN_RMC; // default screen, get magnetic variation first
cSavedScreen = read_eeprom ( EEPROM_INITIAL ); // restore initial screen
iLastRange = 65535; // make max by default
strcpy ( cToFrom, " " ); // blank by default
cScreenChanged = YES;
cIndicator = 0;
cButtonCount = 0;
cButtonPressed = NO;
cRxErrorFlag = OFF;
 
/* MAIN LOOP */
while ( TRUE )
{
cTimeOut = 188; // 231 * 0.013mS = 3 seconds
switch ( cScreen )
{
case HIDDEN_RMC:
{
InitRxBuffer( GPRMC_CODE ); // set code and turn on serial interrupt
while ( ( cRxMsgReady == NO ) && ( cTimeOut != 0 ) );
disable_interrupts ( INT_RDA ); // ignore rest of messages
if ( cTimeOut != 0 ) // if not timed out
{
GetUtcAndMagVar(); // get and store the magnetic variation
}
cScreen = cSavedScreen; // revert to previous screen
break;
}
case POSITION_SCREEN:
{
if ( cScreenChanged == YES )
{
disable_interrupts ( INT_RDA );
cScreenChanged = NO;
cSkip = NO;
LCD_PutCmd ( CLEAR_DISP );
DisplayTemplateLatLon();
enable_interrupts ( INT_RDA );
}
InitRxBuffer( GPRMC_CODE ); // set code and turn on serial interrupt
while ( ( cRxMsgReady == NO ) && ( cTimeOut != 0 ) && ( cScreenChanged != YES ) );
disable_interrupts ( INT_RDA ); // ignore rest of messages
if ( cScreenChanged == NO )
{
if ( cTimeOut != 0 )
{
DisplayLatLon();
}
else
{
DisplayMessage ( NODATA_MSG );
}
}
cRxErrorFlag = OFF;
break;
}
case WAYPOINT_SCREEN:
{
if ( cScreenChanged == YES )
{
disable_interrupts ( INT_RDA );
cScreenChanged = NO;
cSkip = NO;
LCD_PutCmd ( CLEAR_DISP );
DisplayTemplateWaypoint();
enable_interrupts ( INT_RDA );
}
cSkip = NO;
InitRxBuffer( GPRMB_CODE ); // set code and turn on serial interrupt
while ( ( cRxMsgReady == NO ) && ( cTimeOut != 0 ) && ( cScreenChanged != YES ) );
disable_interrupts ( INT_RDA ); // ignore rest of messages
if ( cScreenChanged == NO )
{
if ( cTimeOut != 0 )
{
DisplayWaypoint();
}
else
{
DisplayMessage ( NODATA_MSG );
}
}
break;
}
case BATTERY_SCREEN:
{
if ( cScreenChanged == YES )
{
disable_interrupts ( INT_RDA );
cScreenChanged = NO;
cSkip = NO;
LCD_PutCmd ( CLEAR_DISP );
DisplayTemplateAnalog();
}
DisplayAnalog();
break;
}
}
 
// Preset timeout counter each loop; RTCC interrupt decrements, resets if zero is reached
iTimeOut = 2000; // ~ 30 seconds
 
/* Flashing activity indicator in lower right of screen. */
cIndicator ^= 1;
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( LINE_4 + 19 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( LINE_4 + 15 );
#endif
if ( cIndicator == 1 )
{
printf ( LCD_PutChar, "%c", ACTIVITY_SYMBOL );
}
else
{
printf ( LCD_PutChar, " " );
}
}
}
 
#separate void DisplayTemplateLatLon ( void )
{
LCD_SetPosition ( LINE_1 );
printf ( LCD_PutChar, "LAT" );
LCD_SetPosition ( LINE_2 );
printf ( LCD_PutChar, "LON" );
LCD_SetPosition ( LINE_3 );
#if ( DISPLAY_COLS == 20 )
printf ( LCD_PutChar, "SPEED" );
LCD_SetPosition ( LINE_4 );
printf ( LCD_PutChar, "HEADING" );
#elif ( DISPLAY_COLS == 16 )
printf ( LCD_PutChar, "SPD" );
LCD_SetPosition ( LINE_4 );
printf ( LCD_PutChar, "HDG" );
#endif
}
 
#separate void DisplayTemplateWaypoint ( void )
{
LCD_SetPosition ( LINE_1 );
#if ( DISPLAY_COLS == 20 )
printf ( LCD_PutChar, "WAYPOINT" );
#elif ( DISPLAY_COLS == 16 )
printf ( LCD_PutChar, "WAYPT" );
#endif
LCD_SetPosition ( LINE_2 );
printf ( LCD_PutChar, "STEER" );
LCD_SetPosition ( LINE_3 );
printf ( LCD_PutChar, "DIST" );
LCD_SetPosition ( LINE_4 );
printf ( LCD_PutChar, "BEARING" );
}
 
#separate void DisplayTemplateAnalog ( void )
{
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( LINE_1 + 3 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( LINE_1 + 1 );
#endif
printf ( LCD_PutChar, "BATTERY STATUS" );
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( LINE_2 );
printf ( LCD_PutChar, "Primary" );
LCD_SetPosition ( LINE_3 );
printf ( LCD_PutChar, "Secondary" );
LCD_SetPosition ( LINE_4 );
printf ( LCD_PutChar, "Refrigerator" );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( LINE_2 );
printf ( LCD_PutChar, "Main#1 " );
LCD_SetPosition ( LINE_3 );
printf ( LCD_PutChar, "Main#2 " );
LCD_SetPosition ( LINE_4 );
printf ( LCD_PutChar, "Refrig " );
#endif
}
 
#separate void DisplayLatLon ( void )
{
SkipField ( 1 ); // skip UTC
GetField(); // A = OK, V = warning
if ( ( cC [ 0 ] == 'A' ) && ( !cSkip ) )
{
GetField(); // LAT
if ( !cSkip )
{
DisplayLatitude ( LINE_1 );
}
GetField(); // LON
if ( !cSkip )
{
DisplayLongitude ( LINE_2 );
}
GetField(); // SPEED
if ( !cSkip )
{
DisplaySpeed ( LINE_3 );
}
GetField(); // HEADING
if ( !cSkip )
{
DisplayHeading ( LINE_4 );
}
}
else
{
DisplayMessage( WARNING_MSG );
}
}
 
#separate void DisplayWaypoint ( void )
{
char cX;
 
GetField(); // A = OK, V = warning
if ( ( cC [ 0 ] == 'A' ) && ( !cSkip ) )
{
cX = GetField(); // XTE
if ( !cSkip )
{
DisplaySteer ( LINE_2, cX );
}
SkipField ( 1 ); // skip origin WP ID
GetField(); // DEST WP ID
if ( !cSkip )
{
DisplayWaypointName ( LINE_1, cX );
}
SkipField ( 4 ); // skip LAT, NS, LON, EW
cX = GetField(); // RANGE
if ( !cSkip )
{
DisplayDistance ( LINE_3, cX );
}
cX = GetField(); // BEARING
if ( !cSkip )
{
DisplayBearing ( LINE_4, cX );
}
SkipField ( 1 ); // skip SPEED TO DEST
GetField(); // ARRIVAL FLAG
if ( !cSkip )
{
DisplayArrival ( LINE_1 ); // overwrite RANGE if arrived
}
}
else
{
DisplayMessage( WARNING_MSG );
}
}
 
#separate void DisplayAnalog ( void )
{
long iX;
char cCnt;
 
set_adc_channel ( 0 ); // set channel
delay_us ( 100 ); // wait aquisition time
cAdcDone = NO;
if ( !cSkip )
{
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( LINE_2 + 13 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( LINE_2 + 8 );
#endif
DisplayScaledVoltage ( read_adc(), MAX_VOLTS );
printf ( LCD_PutChar, " V " );
}
set_adc_channel ( 1 );
delay_us ( 100 );
cAdcDone = NO;
if ( !cSkip )
{
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( LINE_3 + 13 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( LINE_3 + 8 );
#endif
DisplayScaledVoltage ( read_adc(), MAX_VOLTS );
printf ( LCD_PutChar, " V " );
}
set_adc_channel ( 3 );
delay_us ( 100 );
cAdcDone = NO;
if ( !cSkip )
{
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( LINE_4 + 13 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( LINE_4 + 8 );
#endif
DisplayScaledVoltage ( read_adc(), MAX_VOLTS );
printf ( LCD_PutChar, " V " );
}
Delay5mS ( 100 ); // slow loop down a bit
}
 
#separate void GetUtcAndMagVar ( void )
{
/*
This is a non-display version of the RMC sentence
to get the A/V warning, the magnetic variation, and the
magnetic direction.
*/
 
GetField(); // get UTC
GetField(); // A = OK, V = warning
if ( cC [ 0 ] == 'A' )
{
SkipField ( 7 ); // skip fields
GetField(); // MAGNETIC VARIATION
iVar = FieldFiveToLong(); // save to global variable, used in other sentences
GetField(); // EW
cVarDir = cC [ 0 ]; // save direction
}
else
{
iVar = NULL; // invalid
cVarDir = SPACE;
}
}
 
/******************************************************************/
 
#separate void DisplayScaledVoltage ( long iV, char cScale )
{
float fX;
 
/*
0 to 5V input at pin 2 results in 0 - 1023. This routine
scales it to something else.
*/
while ( cAdcDone == NO ); // wait for completion by ADC interrupt
if ( iV == 1023 )
{
printf ( LCD_PutChar, "O/L" ); /* print it to the screen */
}
else
{
fX = ( ( float ) iV ) / 1023 * ( float ) cScale; // scale to proper range, 1023 leaves room for out-of-range
printf ( LCD_PutChar, "%2.1f", fX ); /* print it to the screen */
}
}
 
#separate void DisplayArrival ( char cLine )
{
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( cLine + 11 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( cLine + 9 );
#endif
if ( cC [ 0 ] == 'A' )
{
printf ( LCD_PutChar, "Arrived" );
}
else
{
printf ( LCD_PutChar, " " );
}
}
 
#separate void DisplayWaypointName ( char cLine, char cX )
{
/* Displays waypoint name, pads field with blanks */
char cChar, cI;
 
LCD_SetPosition ( cLine );
if ( cX != 0 )
{
printf ( LCD_PutChar, "\"" );
for ( cI = 0; cI < 6; cI++ )
{
cChar = cC [ cI ];
if ( cChar == EOF )
{
break;
}
printf ( LCD_PutChar, "%c", cChar );
}
printf ( LCD_PutChar, "\"" );
// Blank remainder of field
cChar = SPACE;
for ( ; cI < 6; cI++ )
{
printf ( LCD_PutChar, "%c", cChar );
}
}
else
{
printf ( LCD_PutChar, "- none -" );
}
}
 
#separate void DisplaySteer ( char cLine, char cX )
{
/*
Displays A.BC literals, appends 'L' or 'R'.
If less than 1.0, displays feet rather than nm.
Doesn't display distance if on track.
*/
long iX;
char cCnt;
 
if ( cX != 0 )
{
if ( ( cC [ 0 ] != '0' ) || ( cC [ 2 ] != '0' ) || ( cC [ 3 ] != '0' ) ) // if not 0.00
{
LCD_SetPosition ( cLine + 14 );
#if ( DISPLAY_COLS == 20 )
printf ( LCD_PutChar, " " ); // blank possible characters
LCD_SetPosition ( cLine + 11 );
#elif ( DISPLAY_COLS == 16 )
printf ( LCD_PutChar, " " ); // blank possible characters
LCD_SetPosition ( cLine + 8);
#endif
if ( cC [ 0 ] == '0' ) // if less than 1.0 nm, display as feet
{
iX = ( 528 * ( long ) ( cC [ 2 ] - 0x30 ) ) + ( 52 * ( long ) ( cC [ 3 ] - 0x30 ) );
printf ( LCD_PutChar, "%luft ", iX );
}
else // if 1.0 nm or greater, display as nautical miles
{
printf ( LCD_PutChar, "%c%c%c%cmi ", cC [ 0 ], cC [ 1 ], cC [ 2 ] , cC [ 3 ] );
}
GetField(); // L or R
LCD_SetPosition ( cLine + 6 );
if ( cC [ 0 ] == 'L' )
{
#if ( DISPLAY_COLS == 20 )
printf ( LCD_PutChar, "PORT " );
#elif ( DISPLAY_COLS == 16 )
printf ( LCD_PutChar, "L" );
#endif
}
else
{
#if ( DISPLAY_COLS == 20 )
printf ( LCD_PutChar, "STBD " );
#elif ( DISPLAY_COLS == 16 )
printf ( LCD_PutChar, "R" );
#endif
}
}
else // if 0.00
{
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( cLine + 11 );
printf ( LCD_PutChar, "On track " );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( cLine + 6 );
printf ( LCD_PutChar, " On track" );
#endif
GetField(); // dummy L or R
}
}
else
{
LCD_SetPosition ( cLine + 6 );
printf ( LCD_PutChar, " " );
}
}
 
#separate void DisplayDistance ( char cLine, char cX )
{
/* Format: ABC.D nautical miles */
char cChar, cI;
long iThisRange;
 
if ( cX != 0 ) // if waypoint data to display
{
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( cLine + 11 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( cLine + 8 );
#endif
cI = 0;
for ( cI = 0; cI < 2; cI++ ) // find first non-zero
{
cChar = cC [ cI ];
if ( cChar != '0' )
{
break;
}
}
for ( ; cI < 5; cI++ ) // display from there on
{
printf ( LCD_PutChar, "%c", cC [ cI ] );
}
printf ( LCD_PutChar, "nm " ); // pad with blanks
 
/*
The least significant character from the GPS is 0.1 nm.
Multiply whole thing by 10 and make it type long.
Discern if increasing (FROM) or decreasing (TO).
*/
iThisRange = 1000 * ( long ) ( cC [ 0 ] - 0x30 );
iThisRange += 100 * ( long ) ( cC [ 1 ] - 0x30 );
iThisRange += 10 * ( long ) ( cC [ 2 ] - 0x30 );
iThisRange += ( long ) ( cC [ 4 ] - 0x30 );
if ( iThisRange < iLastRange )
{
#if ( DISPLAY_COLS == 20 )
strcpy ( cToFrom, "TO " );
#elif ( DISPLAY_COLS == 16 )
strcpy ( cToFrom, "TO" );
#endif
}
if ( iThisRange > iLastRange )
{
#if ( DISPLAY_COLS == 20 )
strcpy ( cToFrom, "FROM" );
#elif ( DISPLAY_COLS == 16 )
strcpy ( cToFrom, "FM" );
#endif
}
iLastRange = iThisRange; // save this range to compare next time
LCD_SetPosition ( cLine + 5 );
printf ( LCD_PutChar, cToFrom );
}
else
{
LCD_SetPosition ( cLine + 5 );
#if ( DISPLAY_COLS == 20 )
printf ( LCD_PutChar, " " );
#elif ( DISPLAY_COLS == 16 )
printf ( LCD_PutChar, " " );
#endif
}
}
 
#separate void DisplayBearing ( char cLine, char cX )
{
/*
Compass variation comes from RMC sentence. If RMC has not run yet
then "T" is displayed after bearing.
*/
long iHdg;
char cTrueIndicator;
 
if ( cX != 0 ) // if waypoint data to display
{
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( cLine + 11 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( cLine + 8 );
#endif
iHdg = FieldFiveToLong();
iHdg = TrueToMag ( iHdg ); // factor variation into heading
if ( ( iVar == NULL ) || ( cVarDir == SPACE ) )
{
cTrueIndicator = 'T';
}
else
{
cTrueIndicator = ' ';
}
printf ( LCD_PutChar, "%lu%c%c ", iHdg, DEGREE, cTrueIndicator ); // pad with blanks
}
else
{
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( cLine + 11 );
printf ( LCD_PutChar, " " );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( cLine + 8 );
printf ( LCD_PutChar, " " );
#endif
}
}
 
#separate void DisplayLatitude ( char cLine )
{
/* Displays latitude ABCD.EF as AB CD.EF, appends 'N' or 'S' */
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( cLine + 8 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( cLine + 5 );
#endif
if ( cC [ 0 ] == '0' )
{
cC [ 0 ] = SPACE;
}
printf ( LCD_PutChar, "%c%c%c", cC [ 0 ], cC [ 1 ], DEGREE );
printf ( LCD_PutChar, "%c%c%c%c%c%c", cC [ 2 ], cC [ 3 ], cC [ 4 ], cC [ 5 ], cC [ 6 ], cC [ 7 ] );
GetField(); // NS
printf ( LCD_PutChar, " %c", cC [ 0 ] );
}
 
#separate void DisplayLongitude ( char cLine )
{
/* Displays longitude ABCDE.FG as ABC DE.FG, appends 'E' or 'W' */
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( cLine + 7 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( cLine + 4 );
#endif
if ( cC [ 0 ] == '0' )
{
cC [ 0 ] = SPACE;
}
if ( cC [ 1 ] == '0' )
{
cC [ 1 ] = SPACE;
}
printf ( LCD_PutChar, "%c%c%c%c", cC [ 0 ], cC [ 1 ], cC [ 2 ], DEGREE );
printf ( LCD_PutChar, "%c%c%c%c%c%c", cC [ 3 ], cC [ 4 ], cC [ 5 ], cC [ 6 ], cC [ 7 ], cC [ 8 ] );
GetField(); // EW
printf ( LCD_PutChar, " %c", cC [ 0 ] );
}
 
#separate void DisplaySpeed ( char cLine )
{
float fX;
 
// Format ABC.D
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( cLine + 8 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( cLine + 5 );
#endif
fX = 100 * ( cC [ 0 ] - 0x30 );
fX += 10 * ( cC [ 1 ] - 0x30 );
fX += 1 * ( cC [ 2 ] - 0x30 );
fX += 0.1 * ( cC [ 4 ] - 0x30 );
#if SPEED_UNITS == 2
fX *= 1.852; // convert knots to km/h
#endif
#if SPEED_UNITS == 3
fX *= 1.151; // convert knots to mi/h
#endif
printf ( LCD_PutChar, "%3.1f ", fX ); // print it to the screen
#if SPEED_UNITS == 1
printf ( LCD_PutChar, "kts " ); // print it to the screen
#endif
#if SPEED_UNITS == 2
printf ( LCD_PutChar, "kph " ); // print it to the screen
#endif
#if SPEED_UNITS == 3
printf ( LCD_PutChar, "mph " ); // print it to the screen
#endif
}
 
#separate void DisplayHeading ( char cLine )
{
long iHdg;
 
#if ( DISPLAY_COLS == 20 )
LCD_SetPosition ( cLine + 8 );
#elif ( DISPLAY_COLS == 16 )
LCD_SetPosition ( cLine + 5 );
#endif
iHdg = FieldFiveToLong();
SkipField ( 1 ); // skip fix date
GetField(); // MAGNETIC VARIATION
iVar = FieldFiveToLong(); // save to global variable, used in other sentences
GetField(); // EW
cVarDir = cC [ 0 ]; // save direction
iHdg = TrueToMag ( iHdg ); // factor variation into heading
printf ( LCD_PutChar, "%lu%c ", iHdg, DEGREE ); // pad with blanks
}
 
#separate long FieldFiveToLong ( void )
{
/* Converts ABC.D to long, rounds decimal up or down */
long iX;
 
iX = 100 * ( long ) ( cC [ 0 ] - 0x30 );
iX += 10 * ( long ) ( cC [ 1 ] - 0x30 );
iX += ( long ) ( cC [ 2 ] - 0x30 );
if ( ( cC [ 3 ] == PERIOD ) && ( cC [ 4 ] >= '5' ) )
{
iX++; // round up
}
return ( iX );
}
 
#separate long TrueToMag ( long iH )
{
/* Magnetic variation information comes from the RMC sentence */
 
if ( cVarDir == 'W' )
{
iH += iVar;
}
else
{
if ( iH >= iVar )
{
iH -= iVar; // OK as-is
}
else
{
iH = iH + 360 - iVar; // correct for below zero
}
}
if ( iH >= 360 )
{
iH -= 360;
}
return ( iH );
}
 
#separate void DisplayMessage ( char cMsgNum )
{
LCD_PutCmd ( CLEAR_DISP );
LCD_SetPosition ( LINE_2 );
switch ( cMsgNum )
{
case WARNING_MSG:
{
#if ( DISPLAY_COLS == 20 )
printf ( LCD_PutChar, " GPS warning " );
#elif ( DISPLAY_COLS == 16 )
printf ( LCD_PutChar, " GPS warning" );
#endif
break;
}
case NODATA_MSG:
{
if ( cRxErrorFlag == OFF ) // is it a framing error problem ?
{
#if ( DISPLAY_COLS == 20 )
printf ( LCD_PutChar, " No data from GPS" );
#elif ( DISPLAY_COLS == 16 )
printf ( LCD_PutChar, "No data from GPS" );
#endif
}
else
{
#if ( DISPLAY_COLS == 20 )
printf ( LCD_PutChar, " Baud error" );
#elif ( DISPLAY_COLS == 16 )
printf ( LCD_PutChar, " Baud error" );
#endif
cRxErrorFlag = OFF;
}
break;
}
}
Delay5mS ( 255 ); // delay 1.25 seconds
iVar = NULL;
cVarDir = SPACE; // signal "no magnetic variation" yet
cScreenChanged = YES;
}
 
#separate void Delay5mS ( char cCnt )
{
char cX;
 
/* This variable-count 5mS delay is interruptable by a button press */
for ( cX = 0; cX < cCnt; cX++ )
{
if ( cScreenChanged == YES )
{
break;
}
delay_ms ( 5 );
}
}
 
#separate char GetField ( void )
{
char cX, cIndex;
 
cX = NULL;
cIndex = 0;
while ( !cSkip )
{
cX = GetRxChar();
if ( ( cX == COMMA ) || ( cX == CR ) )
{
break;
}
cC [ cIndex++ ] = cX;
}
cC [ cIndex ] = EOF;
return ( cIndex ); // return number of characters in field
}
 
#separate void SkipField ( char cCnt )
{
char cX;
 
for ( cX = 0; cX < cCnt; cX++ )
{
while ( GetRxChar() != COMMA );
}
}
 
/* RS232 FUNCTIONS ================================================== */
 
#separate void InitRxBuffer ( char cCode )
{
disable_interrupts ( INT_RDA );
cRxBufferWritePtr = cRxBuffer; // point to beginning of buffer
cRxBufferReadPtr = cRxBuffer;
cRxByteCnt = 0;
cRxIsrState = 0;
cRxMsgReady = NO;
cRxMsgTypeDesired = cCode;
enable_interrupts ( INT_RDA );
}
 
#separate char GetRxChar ( void )
{
// Get the next available byte in the recv fifo.
// Call this function ONLY if the recv fifo contains data.
char cValue;
 
cValue = 0;
if ( cRxByteCnt > 0 ) // For safety, check if there is any data
{
cValue = *cRxBufferReadPtr++; // Read byte from fifo
if ( cRxBufferReadPtr == ( cRxBuffer + RX_BUFFER_SIZE ) ) // Did tail ptr wrap ?
{
cRxBufferReadPtr = cRxBuffer; // If so, reset it to start of buffer
}
cRxByteCnt--; // Decrement byte count
}
return ( cValue );
}
 
/* LCD FUNCTIONS ================================= */
 
#separate void LCD_Init ( void )
{
LCD_SetData ( 0x00 );
delay_ms ( 200 ); /* wait enough time after Vdd rise */
output_low ( LCD_RS );
LCD_SetData ( 0x03 ); /* init with specific nibbles to start 4-bit mode */
LCD_PulseEnable();
LCD_PulseEnable();
LCD_PulseEnable();
LCD_SetData ( 0x02 ); /* set 4-bit interface */
LCD_PulseEnable(); /* send dual nibbles hereafter, MSN first */
LCD_PutCmd ( 0x2C ); /* function set (all lines, 5x7 characters) */
LCD_PutCmd ( 0x0C ); /* display ON, cursor off, no blink */
LCD_PutCmd ( 0x01 ); /* clear display */
LCD_PutCmd ( 0x06 ); /* entry mode set, increment & scroll left */
}
 
#separate void LCD_SetPosition ( unsigned int cX )
{
/* this subroutine works specifically for 4-bit Port A */
LCD_SetData ( swap ( cX ) | 0x08 );
LCD_PulseEnable();
LCD_SetData ( swap ( cX ) );
LCD_PulseEnable();
}
 
#separate void LCD_PutChar ( unsigned int cX )
{
/* this subroutine works specifically for 4-bit Port A */
if ( !cSkip )
{
output_high ( LCD_RS );
LCD_SetData ( swap ( cX ) ); /* send high nibble */
LCD_PulseEnable();
LCD_SetData ( swap ( cX ) ); /* send low nibble */
LCD_PulseEnable();
output_low ( LCD_RS );
}
}
 
#separate void LCD_PutCmd ( unsigned int cX )
{
/* this subroutine works specifically for 4-bit Port A */
LCD_SetData ( swap ( cX ) ); /* send high nibble */
LCD_PulseEnable();
LCD_SetData ( swap ( cX ) ); /* send low nibble */
LCD_PulseEnable();
}
 
#separate void LCD_PulseEnable ( void )
{
output_high ( LCD_EN );
delay_us ( 3 ); // was 10
output_low ( LCD_EN );
delay_ms ( 3 ); // was 5
}
 
#separate void LCD_SetData ( unsigned int cX )
{
output_bit ( LCD_D0, cX & 0x01 );
output_bit ( LCD_D1, cX & 0x02 );
output_bit ( LCD_D2, cX & 0x04 );
output_bit ( LCD_D3, cX & 0x08 );
}
 
/programy/PIC_C/mereni/gmetr/gmetr.BAK
0,0 → 1,49
#include "D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.h"
 
#define LCD_RS PIN_B1 // rizeni registru LCD displeje
#define LCD_E PIN_B0 // enable LCD displeje
#define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
 
#include "C:\library\CCS\lcd.c"
 
 
void main()
{
signed int16 stred;
signed int16 hodnota;
setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_DIV_2);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
 
lcd_init();
Delay_ms(100);
set_adc_channel(1);
Delay_ms(500);
stred = read_adc();
while(true)
{
hodnota = stred - read_adc();
Delay_ms(100);
LCD_gotoxy(1,1);
printf(lcd_putc," ");
if (hodnota<0)
{
LCD_gotoxy(5,2);
printf(lcd_putc," %03ld ",hodnota);
LCD_gotoxy(8-hodnota,1);
printf(lcd_putc,"* ",hodnota);
}
else
{
LCD_gotoxy(6,2);
printf(lcd_putc," %03ld ",hodnota);
LCD_gotoxy(8-hodnota,1);
printf(lcd_putc," *",hodnota);
}
}
}
/programy/PIC_C/mereni/gmetr/gmetr.HEX
0,0 → 1,66
:1000000000308A00342900000A108A100A11820781
:1000100028340C34013406343330840000080319CA
:1000200020280130A100A001A00B1428A10B132847
:100030004A30A000A00B1A2800000000800B1128F5
:10004000003407080F39BA00390EA000F030A005BF
:100050002008F0393A0487000614831606100000C1
:10006000831206108316061083120034B708031D8E
:100070003B2886103C288614831686108312B80EFF
:100080003808B9002120B80E3808B90021200D30F9
:10009000A000A00B492800341430B3000C200F300E
:1000A0008316870583128610831686108312061026
:1000B000831606108312AA012A08023C031C682832
:1000C0000230B3000C200330B9002120AA0A5C28BA
:1000D0000D30A000A00B6A280230B90021200D309D
:1000E000A000A00B7128AA012A08023C031C842846
:1000F0002A080420AB00B7012B08B80036200230D4
:10010000B3000C20AA0A74288A116D290130330229
:10011000B5003408023C031D8F284030B507350870
:100120008038B600B7013608B800362000343208EF
:100130000C3A0319A528063A0319AD28073A031902
:10014000B328053A0319B828BD28B7010130B80013
:1001500036200230B3000C20C9280130B300023031
:10016000B4008620C9280130B300B4008620C92815
:10017000B7011030B8003620C92832081F3C031CD4
:10018000C3280730B2050130B7003208B800362066
:10019000C92800340408B100AB1FD7282D30B200A5
:1001A00097208403AA09AB09AA0A0319AB0A2B0EEC
:1001B000F038AD00AD07E23EAE00323EB0002B0895
:1001C0000F39AE07AE07B007E93EAF00AF07AF0784
:1001D0002A0E0F39AF07B007AF0DB00DB009B00D43
:1001E0002A080F39B007AD0D0730AC000A30B00750
:1001F000AF03031CF728AF07AE03031CFB28AE07B1
:10020000AD03031CFF28AD07AC03031C03292C30EE
:1002100084000730310584073030040203192C298B
:100220000008A000031D1A29311A2A29B1191C2916
:1002300020301D290830B1003030A007AB01040880
:10024000AA002008AC002008B20097202A088400E9
:100250002C08A000840A0C290008A0003030A00758
:100260002008B2009720003484011F3083058316D4
:100270001F149F141F159F11FF308312A5008316B2
:100280001F109F101F119F1183121F139F1383169E
:100290009F1783121F149412A51225088316870036
:1002A000831225162508831687008312A5112508B9
:1002B000831687000030831294008316940001088F
:1002C000C73908388100831290010030A1009200E4
:1002D00000308316920083124C286430B3000C2047
:1002E0000830A1001F08C73921049F000230AA006E
:1002F000FA30B3000C20AA0B78291F151F197E298C
:1003000083161E088312A6001E08A7001F151F19BA
:10031000872983161E0883122602A8002708A90031
:100320001E08031C1E0FA9026430B3000C2001300C
:10033000B300B40086201030AA002030B20097200D
:10034000AA0B9D29A91FCA290530B3000230B400A9
:1003500086202030B20097200A3084002908AB00A4
:100360002808AA00CA202030B20097202030B2000E
:1003700097202808083CAA00AB012908031C290F74
:10038000AB022A08B3000130B40086202A30B20044
:100390009720EF290630B3000230B40086202030C9
:1003A000B20097200A3084002908AB002808AA0070
:1003B000CA202030B20097202030B20097202808B1
:1003C000083CAA00AB012908031C290FAB022A082C
:1003D000B3000130B40086202A30B200972086296D
:0203E0006300B8
:02400E00393F38
:00000001FF
;PIC16F873
/programy/PIC_C/mereni/gmetr/gmetr.LST
0,0 → 1,774
CCS PCM C Compiler, Version 3.221, 27853 18-VI-05 19:21
 
Filename: D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.LST
 
ROM used: 497 words (12%)
Largest free fragment is 2048
RAM used: 12 (6%) at main() level
28 (15%) worst case
Stack: 5 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 134
0003: NOP
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.h"
.................... #include <16F873.h>
.................... //////// Standard Header file for the PIC16F873 device ////////////////
.................... #device PIC16F873
.................... #list
....................
.................... #device adc=10
.................... #fuses NOWDT,XT, NOPUT, NOPROTECT, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG
.................... #use delay(clock=4000000)
*
000C: MOVLW 33
000D: MOVWF 04
000E: MOVF 00,W
000F: BTFSC 03.2
0010: GOTO 020
0011: MOVLW 01
0012: MOVWF 21
0013: CLRF 20
0014: DECFSZ 20,F
0015: GOTO 014
0016: DECFSZ 21,F
0017: GOTO 013
0018: MOVLW 4A
0019: MOVWF 20
001A: DECFSZ 20,F
001B: GOTO 01A
001C: NOP
001D: NOP
001E: DECFSZ 00,F
001F: GOTO 011
0020: RETLW 00
....................
....................
....................
.................... #define LCD_RS PIN_B1 // rizeni registru LCD displeje
.................... #define LCD_E PIN_B0 // enable LCD displeje
.................... #define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
....................
.................... #include "C:\library\CCS\lcd.c"
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem
.................... // (c)miho 2002,2005
.................... //
.................... // Historie:
.................... //
.................... // 0.00 Uvodni verze se snadnou definici portu LCD displeje
.................... // 0.01 Oprava portu (zapomenute stare identifikatory)
.................... // 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty
.................... // 0.03 Doplnena procedura lcd_clr pro smazani displeje
.................... //
.................... //
.................... // Funkce:
.................... //
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni
.................... //
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky
.................... // \f = \x0C - nova stranka - smazani displeje
.................... // \n = \x0A - odradkovani (prechod na druhou radku)
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet
.................... // \r = \x0D - goto home to position 1,1
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce)
.................... //
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu
.................... // nekontroluje parametry
.................... //
.................... // lcd_cursor_on zapne kurzor
.................... // lcd_cursor_off vypne kurzor
.................... //
.................... // lcd_clr smaze displej
.................... //
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM.
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7.
.................... // Na konci se provede lcd_gotoxy(1,1).
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku
.................... //
.................... //
.................... // Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
.................... //
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje
.................... // #define LCD_E PIN_B1 // enable LCD displeje
.................... // #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
.................... //
.................... //
.................... // Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov)
.................... //
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje
.................... // #define LCD_E PIN_B1 // enable LCD displeje
.................... // #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty
.................... // #define LCD_D1 PIN_C3 // D1
.................... // #define LCD_D2 PIN_C4 // D2
.................... // #define LCD_D3 PIN_C5 // D3
....................
....................
....................
....................
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje
....................
....................
....................
....................
.................... #ifdef LCD_DATA_LSB
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu
.................... //
.................... #define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu
.................... #define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu
.................... #define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru
.................... #define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu
.................... //
.................... #if LCD_SHIFT>4 // kontrola mezi
.................... #error LCD data port LSB bit not in range 0..4
.................... #endif
.................... #endif
....................
....................
.................... // Definice konstant pro LCD display
.................... //
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky
....................
....................
.................... // Definice rezimu LCD displeje
.................... //
.................... BYTE const LCD_INIT_STRING[4] =
.................... {
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7
.................... LCD_CURSOR_OFF_, // display on, kurzor off,
.................... 0x01, // clear displeje
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava)
.................... };
....................
....................
.................... // Odesle nibble do displeje (posle data a klikne signalem e)
.................... //
.................... void lcd_send_nibble( BYTE n )
.................... {
.................... #ifdef LCD_DATA_LSB
.................... // data jsou za sebou na 4 bitech jednoho portu
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej
0021: MOVF 07,W
0022: ANDLW 0F
0023: MOVWF 3A
0024: SWAPF 39,W
0025: MOVWF 20
0026: MOVLW F0
0027: ANDWF 20,F
0028: MOVF 20,W
0029: ANDLW F0
002A: IORWF 3A,W
002B: MOVWF 07
.................... #else
.................... // data jsou na libovolnych 4 bitech libovolnych portu
.................... output_bit(LCD_D0,bit_test(n,0));
.................... output_bit(LCD_D1,bit_test(n,1));
.................... output_bit(LCD_D2,bit_test(n,2));
.................... output_bit(LCD_D3,bit_test(n,3));
.................... #endif
.................... output_bit(LCD_E,1); // vzestupna hrana
002C: BSF 06.0
002D: BSF 03.5
002E: BCF 06.0
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat
002F: NOP
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us)
0030: BCF 03.5
0031: BCF 06.0
0032: BSF 03.5
0033: BCF 06.0
.................... }
0034: BCF 03.5
0035: RETLW 00
....................
....................
.................... // Odesle bajt do registru LCD
.................... //
.................... // Pokud je Adr=0 .. instrukcni registr
.................... // Pokud je Adr=1 .. datovy registr
.................... //
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n )
.................... {
.................... output_bit(LCD_RS,Adr); // vyber registr
0036: MOVF 37,F
0037: BTFSS 03.2
0038: GOTO 03B
0039: BCF 06.1
003A: GOTO 03C
003B: BSF 06.1
003C: BSF 03.5
003D: BCF 06.1
.................... swap(n);
003E: BCF 03.5
003F: SWAPF 38,F
.................... lcd_send_nibble(n); // posli horni pulku bajtu
0040: MOVF 38,W
0041: MOVWF 39
0042: CALL 021
.................... swap(n);
0043: SWAPF 38,F
.................... lcd_send_nibble(n); // posli spodni pulku bajtu
0044: MOVF 38,W
0045: MOVWF 39
0046: CALL 021
.................... delay_us(40); // minimalni doba na provedeni prikazu
0047: MOVLW 0D
0048: MOVWF 20
0049: DECFSZ 20,F
004A: GOTO 049
.................... }
004B: RETLW 00
....................
....................
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje
.................... //
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur
.................... //
.................... void lcd_init()
.................... {
....................
.................... int i; // pocitadlo cyklu
....................
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni
004C: MOVLW 14
004D: MOVWF 33
004E: CALL 00C
....................
.................... #ifdef LCD_DATA_LSB
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD
004F: MOVLW 0F
0050: BSF 03.5
0051: ANDWF 07,F
.................... #endif
....................
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav
0052: BCF 03.5
0053: BCF 06.1
0054: BSF 03.5
0055: BCF 06.1
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav
0056: BCF 03.5
0057: BCF 06.0
0058: BSF 03.5
0059: BCF 06.0
....................
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice
005A: BCF 03.5
005B: CLRF 2A
005C: MOVF 2A,W
005D: SUBLW 02
005E: BTFSS 03.0
005F: GOTO 068
.................... {
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel
0060: MOVLW 02
0061: MOVWF 33
0062: CALL 00C
.................... lcd_send_nibble(3); // rezim 8 bitu
0063: MOVLW 03
0064: MOVWF 39
0065: CALL 021
.................... }
0066: INCF 2A,F
0067: GOTO 05C
....................
.................... delay_us(40); // cas na zpracovani
0068: MOVLW 0D
0069: MOVWF 20
006A: DECFSZ 20,F
006B: GOTO 06A
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu)
006C: MOVLW 02
006D: MOVWF 39
006E: CALL 021
.................... delay_us(40); // cas na zpracovani
006F: MOVLW 0D
0070: MOVWF 20
0071: DECFSZ 20,F
0072: GOTO 071
....................
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod)
0073: CLRF 2A
0074: MOVF 2A,W
0075: SUBLW 02
0076: BTFSS 03.0
0077: GOTO 084
.................... {
.................... lcd_send_byte(0,LCD_INIT_STRING[i]);
0078: MOVF 2A,W
0079: CALL 004
007A: MOVWF 2B
007B: CLRF 37
007C: MOVF 2B,W
007D: MOVWF 38
007E: CALL 036
.................... delay_ms(2);
007F: MOVLW 02
0080: MOVWF 33
0081: CALL 00C
.................... }
0082: INCF 2A,F
0083: GOTO 074
.................... }
0084: BCF 0A.3
0085: GOTO 16D (RETURN)
....................
....................
.................... // Proved presun kurzoru
.................... //
.................... // Pozice 1.1 je domu
.................... //
.................... void lcd_gotoxy( BYTE x, BYTE y)
.................... {
....................
.................... BYTE Adr;
....................
.................... Adr=x-1;
0086: MOVLW 01
0087: SUBWF 33,W
0088: MOVWF 35
.................... if(y==2)
0089: MOVF 34,W
008A: SUBLW 02
008B: BTFSS 03.2
008C: GOTO 08F
.................... Adr+=LCD_LINE_2;
008D: MOVLW 40
008E: ADDWF 35,F
....................
.................... lcd_send_byte(0,0x80|Adr);
008F: MOVF 35,W
0090: IORLW 80
0091: MOVWF 36
0092: CLRF 37
0093: MOVF 36,W
0094: MOVWF 38
0095: CALL 036
.................... }
0096: RETLW 00
....................
....................
.................... // Zapis znaku na displej, zpracovani ridicich znaku
.................... //
.................... void lcd_putc( char c)
.................... {
....................
.................... switch (c)
.................... {
0097: MOVF 32,W
0098: XORLW 0C
0099: BTFSC 03.2
009A: GOTO 0A5
009B: XORLW 06
009C: BTFSC 03.2
009D: GOTO 0AD
009E: XORLW 07
009F: BTFSC 03.2
00A0: GOTO 0B3
00A1: XORLW 05
00A2: BTFSC 03.2
00A3: GOTO 0B8
00A4: GOTO 0BD
.................... case '\f' : lcd_send_byte(0,1); // smaz displej
00A5: CLRF 37
00A6: MOVLW 01
00A7: MOVWF 38
00A8: CALL 036
.................... delay_ms(2);
00A9: MOVLW 02
00AA: MOVWF 33
00AB: CALL 00C
.................... break;
00AC: GOTO 0C9
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky
00AD: MOVLW 01
00AE: MOVWF 33
00AF: MOVLW 02
00B0: MOVWF 34
00B1: CALL 086
00B2: GOTO 0C9
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home
00B3: MOVLW 01
00B4: MOVWF 33
00B5: MOVWF 34
00B6: CALL 086
00B7: GOTO 0C9
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet
00B8: CLRF 37
00B9: MOVLW 10
00BA: MOVWF 38
00BB: CALL 036
00BC: GOTO 0C9
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F
00BD: MOVF 32,W
00BE: SUBLW 1F
00BF: BTFSS 03.0
00C0: GOTO 0C3
00C1: MOVLW 07
00C2: ANDWF 32,F
.................... lcd_send_byte(1,c); break; // zapis znak
00C3: MOVLW 01
00C4: MOVWF 37
00C5: MOVF 32,W
00C6: MOVWF 38
00C7: CALL 036
00C8: GOTO 0C9
.................... }
.................... }
00C9: RETLW 00
....................
....................
.................... // Zapni kurzor
.................... //
.................... void lcd_cursor_on()
.................... {
.................... lcd_send_byte(0,LCD_CURSOR_ON_);
.................... }
....................
....................
.................... // Vypni kurzor
.................... //
.................... void lcd_cursor_off()
.................... {
.................... lcd_send_byte(0,LCD_CURSOR_OFF_);
.................... }
....................
....................
.................... // Smaz displej
.................... //
.................... void lcd_clr()
.................... {
.................... lcd_putc('\f');
.................... }
....................
....................
.................... // Definice vlastnich fontu
.................... //
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden
.................... // priklad pouziti definovanych znaku.
....................
....................
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje
.................... //
.................... void lcd_putc2(int Data)
.................... {
.................... lcd_send_byte(1,Data);
.................... }
....................
....................
.................... // Pomocne definice pro programovani obsahu CGRAM
.................... //
.................... #define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2)
.................... #define lcd_define_def(String) printf(lcd_putc2,String);
.................... #define lcd_define_end() lcd_send_byte(0,3); delay_ms(2)
....................
....................
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def
.................... //
.................... #define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end();
....................
....................
.................... // Pripravene definice fontu vybranych znaku
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80
.................... //
.................... #define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */
.................... #define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */
.................... #define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */
.................... #define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */
.................... #define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */
.................... #define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */
.................... #define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */
.................... #define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */
.................... #define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */
.................... #define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */
.................... #define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */
.................... #define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */
.................... #define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */
.................... #define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */
.................... #define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */
.................... #define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */
.................... #define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */
.................... #define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */
.................... #define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */
.................... #define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */
.................... #define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */
.................... #define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */
.................... #define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */
.................... #define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */
.................... #define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */
.................... #define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */
.................... #define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */
.................... #define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */
.................... #define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */
.................... #define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */
.................... #define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */
.................... #define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */
.................... #define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */
.................... #define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */
.................... #define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */
....................
....................
.................... // Priklad pouziti definovanych znaku
.................... //
.................... //
.................... //void lcd_sample()
.................... //{
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji
.................... // // jediny definicni retezec)
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3
.................... // delay_ms(1000);
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0
.................... // delay_ms(1000);
.................... //}
....................
....................
....................
.................... void main()
.................... {
*
0134: CLRF 04
0135: MOVLW 1F
0136: ANDWF 03,F
0137: BSF 03.5
0138: BSF 1F.0
0139: BSF 1F.1
013A: BSF 1F.2
013B: BCF 1F.3
.................... signed int16 stred;
.................... signed int16 hodnota;
....................
.................... setup_adc_ports(ALL_ANALOG);
*
013F: BSF 03.5
0140: BCF 1F.0
0141: BCF 1F.1
0142: BCF 1F.2
0143: BCF 1F.3
.................... setup_adc(ADC_CLOCK_DIV_2);
0144: BCF 03.5
0145: BCF 1F.6
0146: BCF 1F.7
0147: BSF 03.5
0148: BSF 1F.7
0149: BCF 03.5
014A: BSF 1F.0
.................... setup_spi(FALSE);
*
013C: MOVLW FF
013D: BCF 03.5
013E: MOVWF 25
*
014B: BCF 14.5
014C: BCF 25.5
014D: MOVF 25,W
014E: BSF 03.5
014F: MOVWF 07
0150: BCF 03.5
0151: BSF 25.4
0152: MOVF 25,W
0153: BSF 03.5
0154: MOVWF 07
0155: BCF 03.5
0156: BCF 25.3
0157: MOVF 25,W
0158: BSF 03.5
0159: MOVWF 07
015A: MOVLW 00
015B: BCF 03.5
015C: MOVWF 14
015D: BSF 03.5
015E: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
015F: MOVF 01,W
0160: ANDLW C7
0161: IORLW 08
0162: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
0163: BCF 03.5
0164: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
0165: MOVLW 00
0166: MOVWF 21
0167: MOVWF 12
0168: MOVLW 00
0169: BSF 03.5
016A: MOVWF 12
....................
.................... lcd_init();
016B: BCF 03.5
016C: GOTO 04C
.................... Delay_ms(100);
016D: MOVLW 64
016E: MOVWF 33
016F: CALL 00C
.................... set_adc_channel(1);
0170: MOVLW 08
0171: MOVWF 21
0172: MOVF 1F,W
0173: ANDLW C7
0174: IORWF 21,W
0175: MOVWF 1F
.................... Delay_ms(500);
0176: MOVLW 02
0177: MOVWF 2A
0178: MOVLW FA
0179: MOVWF 33
017A: CALL 00C
017B: DECFSZ 2A,F
017C: GOTO 178
.................... stred = read_adc();
017D: BSF 1F.2
017E: BTFSC 1F.2
017F: GOTO 17E
0180: BSF 03.5
0181: MOVF 1E,W
0182: BCF 03.5
0183: MOVWF 26
0184: MOVF 1E,W
0185: MOVWF 27
....................
.................... while(true)
.................... {
.................... hodnota = stred - read_adc();
0186: BSF 1F.2
0187: BTFSC 1F.2
0188: GOTO 187
0189: BSF 03.5
018A: MOVF 1E,W
018B: BCF 03.5
018C: SUBWF 26,W
018D: MOVWF 28
018E: MOVF 27,W
018F: MOVWF 29
0190: MOVF 1E,W
0191: BTFSS 03.0
0192: INCFSZ 1E,W
0193: SUBWF 29,F
.................... Delay_ms(100);
0194: MOVLW 64
0195: MOVWF 33
0196: CALL 00C
.................... LCD_gotoxy(1,1);
0197: MOVLW 01
0198: MOVWF 33
0199: MOVWF 34
019A: CALL 086
.................... printf(lcd_putc," ");
019B: MOVLW 10
019C: MOVWF 2A
019D: MOVLW 20
019E: MOVWF 32
019F: CALL 097
01A0: DECFSZ 2A,F
01A1: GOTO 19D
.................... if (hodnota<0)
01A2: BTFSS 29.7
01A3: GOTO 1CA
.................... {
.................... LCD_gotoxy(5,2);
01A4: MOVLW 05
01A5: MOVWF 33
01A6: MOVLW 02
01A7: MOVWF 34
01A8: CALL 086
.................... printf(lcd_putc," %03ld ",hodnota);
01A9: MOVLW 20
01AA: MOVWF 32
01AB: CALL 097
01AC: MOVLW 0A
01AD: MOVWF 04
01AE: MOVF 29,W
01AF: MOVWF 2B
01B0: MOVF 28,W
01B1: MOVWF 2A
01B2: CALL 0CA
01B3: MOVLW 20
01B4: MOVWF 32
01B5: CALL 097
01B6: MOVLW 20
01B7: MOVWF 32
01B8: CALL 097
.................... LCD_gotoxy(8-hodnota,1);
01B9: MOVF 28,W
01BA: SUBLW 08
01BB: MOVWF 2A
01BC: CLRF 2B
01BD: MOVF 29,W
01BE: BTFSS 03.0
01BF: INCFSZ 29,W
01C0: SUBWF 2B,F
01C1: MOVF 2A,W
01C2: MOVWF 33
01C3: MOVLW 01
01C4: MOVWF 34
01C5: CALL 086
.................... printf(lcd_putc,"*",hodnota);
01C6: MOVLW 2A
01C7: MOVWF 32
01C8: CALL 097
.................... }
.................... else
01C9: GOTO 1EF
.................... {
.................... LCD_gotoxy(6,2);
01CA: MOVLW 06
01CB: MOVWF 33
01CC: MOVLW 02
01CD: MOVWF 34
01CE: CALL 086
.................... printf(lcd_putc," %03ld ",hodnota);
01CF: MOVLW 20
01D0: MOVWF 32
01D1: CALL 097
01D2: MOVLW 0A
01D3: MOVWF 04
01D4: MOVF 29,W
01D5: MOVWF 2B
01D6: MOVF 28,W
01D7: MOVWF 2A
01D8: CALL 0CA
01D9: MOVLW 20
01DA: MOVWF 32
01DB: CALL 097
01DC: MOVLW 20
01DD: MOVWF 32
01DE: CALL 097
.................... LCD_gotoxy(8-hodnota,1);
01DF: MOVF 28,W
01E0: SUBLW 08
01E1: MOVWF 2A
01E2: CLRF 2B
01E3: MOVF 29,W
01E4: BTFSS 03.0
01E5: INCFSZ 29,W
01E6: SUBWF 2B,F
01E7: MOVF 2A,W
01E8: MOVWF 33
01E9: MOVLW 01
01EA: MOVWF 34
01EB: CALL 086
.................... printf(lcd_putc,"*",hodnota);
01EC: MOVLW 2A
01ED: MOVWF 32
01EE: CALL 097
.................... }
.................... }
01EF: GOTO 186
.................... }
....................
01F0: SLEEP
 
Configuration Fuses:
Word 1: 3F39 XT NOWDT NOPUT NOPROTECT NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG
/programy/PIC_C/mereni/gmetr/gmetr.PJT
0,0 → 1,38
[PROJECT]
Target=gmetr.HEX
Development_Mode=
Processor=0x873F
ToolSuite=CCS
 
[Directories]
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr
Library=
LinkerScript=
 
[Target Data]
FileList=gmetr.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[gmetr.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=gmetr.c
 
[Windows]
0=0000 gmetr.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.c
2=C:\library\CCS\lcd.c
3=D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.h
4=C:\Program Files\PICC\devices\16F873.h
5=
/programy/PIC_C/mereni/gmetr/gmetr.SYM
0,0 → 1,70
015-016 CCP_1
015 CCP_1_LOW
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-027 main.stred
028-029 main.hodnota
02A lcd_init.i
02A-02B @PRINTF_LD_263.P1
02A main.@SCRATCH
02B lcd_init.@SCRATCH
02B main.@SCRATCH
02C @PRINTF_LD_263.@SCRATCH
02D @PRINTF_LD_263.@SCRATCH
02E @PRINTF_LD_263.@SCRATCH
02F @PRINTF_LD_263.@SCRATCH
030 @PRINTF_LD_263.@SCRATCH
031 @PRINTF_LD_263.@SCRATCH
032 lcd_putc.c
033 @delay_ms1.P1
033 lcd_gotoxy.x
034 lcd_gotoxy.y
035 lcd_gotoxy.Adr
036 lcd_gotoxy.@SCRATCH
037 lcd_send_byte.Adr
038 lcd_send_byte.n
039 lcd_send_nibble.n
03A lcd_send_nibble.@SCRATCH
03B lcd_send_nibble.@SCRATCH
 
000C @delay_ms1
0004 @const28
0021 lcd_send_nibble
0036 lcd_send_byte
004C lcd_init
0086 lcd_gotoxy
0097 lcd_putc
0134 main
00CA @PRINTF_LD_263
0134 @cinit
 
Project Files:
D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.c
D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.h
C:\Program Files\PICC\devices\16F873.h
C:\library\CCS\lcd.c
 
Compiler Settings:
Processor: PIC16F873
Pointer Size: 8
ADC Range: 0-1023
Opt Level: 9
Short,Int,Long: 1,8,16
 
Output Files:
Errors: D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.err
INHX8: D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.HEX
Symbols: D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.SYM
List: D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.LST
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.cof
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.tre
Statistics: D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.sta
/programy/PIC_C/mereni/gmetr/gmetr.c
0,0 → 1,49
#include "D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.h"
 
#define LCD_RS PIN_B1 // rizeni registru LCD displeje
#define LCD_E PIN_B0 // enable LCD displeje
#define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
 
#include "C:\library\CCS\lcd.c"
 
 
void main()
{
signed int16 stred;
signed int16 hodnota;
setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_DIV_2);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
 
lcd_init();
Delay_ms(100);
set_adc_channel(1);
Delay_ms(500);
stred = read_adc();
while(true)
{
hodnota = stred - read_adc();
Delay_ms(100);
LCD_gotoxy(1,1);
printf(lcd_putc," ");
if (hodnota<0)
{
LCD_gotoxy(5,2);
printf(lcd_putc," %03ld ",hodnota);
LCD_gotoxy(8-hodnota,1);
printf(lcd_putc,"*",hodnota);
}
else
{
LCD_gotoxy(6,2);
printf(lcd_putc," %03ld ",hodnota);
LCD_gotoxy(8-hodnota,1);
printf(lcd_putc,"*",hodnota);
}
}
}
/programy/PIC_C/mereni/gmetr/gmetr.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/PIC_C/mereni/gmetr/gmetr.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/gmetr/gmetr.h
0,0 → 1,5
#include <16F873.h>
#device adc=10
#fuses NOWDT,XT, NOPUT, NOPROTECT, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG
#use delay(clock=4000000)
 
/programy/PIC_C/mereni/gmetr/gmetr.sta
0,0 → 1,37
 
ROM used: 497 (12%)
497 (12%) including unused fragments
 
1 Average locations per line
7 Average locations per statement
 
RAM used: 12 (6%) at main() level
28 (15%) worst case
 
Lines Stmts % Files
----- ----- --- -----
50 28 37 D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.c
6 0 0 D:\KAKLIK\programy\PIC_C\mereni\gmetr\gmetr.h
240 0 0 C:\Program Files\PICC\devices\16F873.h
312 47 46 C:\library\CCS\lcd.c
----- -----
1216 150 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 4 1 @delay_ms1
0 8 2 0 @const28
0 21 4 3 lcd_send_nibble
0 22 4 2 lcd_send_byte
0 58 12 2 lcd_init
0 17 3 4 lcd_gotoxy
0 51 10 1 lcd_putc
0 189 38 6 main
0 106 21 8 @PRINTF_LD_263
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-007FF 493 1551
00800-00FFF 0 2048
 
/programy/PIC_C/mereni/gmetr/gmetr.tre
0,0 → 1,323
ÀÄgmetr
ÀÄmain 0/189 Ram=6
ÃÄ??0??
ÃÄlcd_init 0/58 Ram=2
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@const28 0/8 Ram=0
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄ@PRINTF_LD_263 0/106 Ram=8
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄ@PRINTF_LD_263 0/106 Ram=8
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÀÄlcd_putc 0/51 Ram=1
ÃÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÀÄlcd_send_byte 0/22 Ram=2
ÃÄlcd_send_nibble 0/21 Ram=3
ÀÄlcd_send_nibble 0/21 Ram=3
/programy/PIC_C/mereni/gmetr/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
/programy/PIC_C/mereni/mereni_ultraz/RUN.PIF
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/PIC_C/mereni/mereni_ultraz/Run.BAT
0,0 → 1,6
@echo off
picpgr reset PIC16F84
picpgr run
pause
picpgr stop
pause
/programy/PIC_C/mereni/mereni_ultraz/main.BAK
0,0 → 1,23
#include "D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h"
#use fast_io(A)
 
void main()
{
 
setup_counters(RTCC_INTERNAL,WDT_18MS);
 
set_tris_A(0b11111100);
output_high(pin_A3);
 
mainloop:
output_high(pin_A0);
output_low(pin_A1);
delay_us(9);
output_high(pin_A1);
output_low(pin_A0);
delay_us(9);
 
goto mainloop;
 
}
 
/programy/PIC_C/mereni/mereni_ultraz/main.HEX
0,0 → 1,9
:1000000000308A000428000084011F308305083076
:100010008C008C1D1328073081018130840000087A
:10002000C0390F3880006400813084000008C03976
:100030000C048000FC306500851505148510023025
:100040008C008C0B21280000000085140510023064
:0E0050008C008C0B2928000000001D28630086
:02400E00F93F78
:00000001FF
;PIC16F84
/programy/PIC_C/mereni/mereni_ultraz/main.LST
0,0 → 1,91
CCS PCW C Compiler, Version 3.110, 15448
 
Filename: d:\@kaklik\programy\pic_c\mereni_ultraz\main.LST
 
ROM used: 47 (5%)
Largest free fragment is 977
RAM used: 2 (3%) at main() level
2 (3%) worst case
Stack: 0 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 004
0003: NOP
.................... #include "D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h"
.................... #include <16F84.h>
.................... //////// Standard Header file for the PIC16F84 device ////////////////
.................... #device PIC16F84
.................... #list
....................
.................... #use delay(clock=4000000)
.................... #fuses XT,NOWDT
....................
....................
.................... #use fast_io(A)
....................
.................... void main()
.................... {
0004: CLRF 04
0005: MOVLW 1F
0006: ANDWF 03,F
....................
.................... setup_counters(RTCC_INTERNAL,WDT_18MS);
0007: MOVLW 08
0008: MOVWF 0C
0009: BTFSS 0C.3
000A: GOTO 013
000B: MOVLW 07
000C: CLRF 01
000D: MOVLW 81
000E: MOVWF 04
000F: MOVF 00,W
0010: ANDLW C0
0011: IORLW 0F
0012: MOVWF 00
0013: CLRWDT
0014: MOVLW 81
0015: MOVWF 04
0016: MOVF 00,W
0017: ANDLW C0
0018: IORWF 0C,W
0019: MOVWF 00
....................
.................... set_tris_A(0b11111100);
001A: MOVLW FC
001B: TRIS 5
.................... output_high(pin_A3);
001C: BSF 05.3
....................
.................... mainloop:
.................... output_high(pin_A0);
001D: BSF 05.0
.................... output_low(pin_A1);
001E: BCF 05.1
.................... delay_us(9);
001F: MOVLW 02
0020: MOVWF 0C
0021: DECFSZ 0C,F
0022: GOTO 021
0023: NOP
0024: NOP
.................... output_high(pin_A1);
0025: BSF 05.1
.................... output_low(pin_A0);
0026: BCF 05.0
.................... delay_us(9);
0027: MOVLW 02
0028: MOVWF 0C
0029: DECFSZ 0C,F
002A: GOTO 029
002B: NOP
002C: NOP
....................
.................... goto mainloop;
002D: GOTO 01D
....................
.................... }
....................
002E: SLEEP
....................
/programy/PIC_C/mereni/mereni_ultraz/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/PIC_C/mereni/mereni_ultraz/main.SYM
0,0 → 1,13
00C @SCRATCH
00D @SCRATCH
00D _RETURN_
delay_ms.P1
delay_us.P2
 
0004 main
001D mainloop
 
Project Files:
d:\@kaklik\programy\pic_c\mereni_ultraz\main.c
D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h
C:\PROGRAM FILES\PICC\devices\16F84.h
/programy/PIC_C/mereni/mereni_ultraz/main.c
0,0 → 1,23
#include "D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h"
#use fast_io(A)
 
void main()
{
 
setup_counters(RTCC_INTERNAL,WDT_18MS);
 
set_tris_A(0b11110100);
output_high(pin_A3);
 
mainloop:
output_high(pin_A0);
output_low(pin_A1);
delay_us(9);
output_high(pin_A1);
output_low(pin_A0);
delay_us(9);
 
goto mainloop;
 
}
 
/programy/PIC_C/mereni/mereni_ultraz/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/PIC_C/mereni/mereni_ultraz/main.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/mereni_ultraz/main.h
0,0 → 1,4
#include <16F84.h>
#use delay(clock=4000000)
#fuses XT,NOWDT
 
/programy/PIC_C/mereni/mereni_ultraz/main.sta
0,0 → 1,27
 
ROM used: 47 (5%)
977 (95%) including unused fragments
 
0 Average locations per line
4 Average locations per statement
 
RAM used: 2 (3%) at main() level
2 (3%) worst case
 
Lines Stmts % Files
----- ----- --- -----
24 11 100 d:\@kaklik\programy\pic_c\mereni_ultraz\main.c
5 0 0 D:\@Kaklik\programy\PIC_C\mereni_ultraz\main.h
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h
----- -----
280 22 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 43 91 0 main
 
Segment Used Free
--------- ---- ----
0000-0003 4 0
0004-03FF 43 977
 
/programy/PIC_C/mereni/mereni_ultraz/main.tre
0,0 → 1,3
ÀÄmain
ÀÄmain 0/43 Ram=0
ÀÄ??0??
/programy/PIC_C/mereni/mereni_ultraz/prg.bat
0,0 → 1,6
call picpgr stop
call picpgr erase pic16f84
call picpgr program main.hex hex pic16f84
call picpgr run
pause
call picpgr stop
/programy/PIC_C/mereni/mereni_ultraz/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
/programy/PIC_C/mereni/mys/PIC16F88/mys.BAK
0,0 → 1,52
#include "D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h"
 
#define LCD_RS PIN_B3 // rizeni registru LCD displeje
#define LCD_E PIN_B0 // enable LCD displeje
#define LCD_DATA_LSB PIN_A0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
#include "C:\library\CCS\lcd.c"
 
#include "C:\library\kaklik\CCS\mys_chip_SPI.c" // modul umoznujici komunikaci s cidlem v mysi
 
void main()
{
unsigned int8 hodnota;
signed int16 x=0,y=0;
signed int8 xd,yd;
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_64);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
 
chip_write(OPERATION_MODE);
chip_write(0x00); // vypne sleep mode
chip_write(CONFIGURATION);
chip_write(0b00000110); // nastavi rozliseni na 600cpi
lcd_init();
Delay_ms(200);
While(true)
{
LCD_gotoxy(1,1);
printf(lcd_putc,"status: %X", hodnota);
delay_ms(20);
 
LCD_gotoxy(1,2);
printf(lcd_putc,"X=%ld Y=%ld", x, y);
delay_ms(20);
 
hodnota=chip_read(MOTION_STATUS);
xd=chip_read(DELTA_X);
yd=chip_read(DELTA_Y);
x+=xd;
y+=yd;
}
}
/programy/PIC_C/mereni/mys/PIC16F88/mys.HEX
0,0 → 1,74
:1000000000308A00862900000A108A100A1182072F
:1000100028340C34013406340A108A100A1182077D
:100020007334743461347434753473343A34203432
:100030002534583400348316061183120615280817
:100040009300831614182628831221288312003463
:1000500031308400000803193C280130F800F70112
:10006000F70B3028F80B2F284A30F700F70B36280B
:1000700000000000800B2D2800340508F039B8007E
:1000800037080F393804850006148316061000005F
:10009000831206108316061083120034B508031D60
:1000A0005328861154288615831686118312B60E9E
:1000B0003608B7003D20B60E3608B7003D200D309B
:1000C000F700F70B612800341430B1002820F0301D
:1000D00083168505831286118316861183120610F6
:1000E000831606108312A8012808023C031C8028EE
:1000F0000230B10028200330B7003D20A80A742840
:100100000D30F700F70B82280230B7003D200D308C
:10011000F700F70B8928A8012808023C031C9C283B
:1001200028080420A900B5012908B6004E20023095
:10013000B1002820A80A8C288A11D4290130310264
:10014000B3003208023C031DA7284030B307330830
:100150008038B400B5013408B6004E2000343008B1
:100160000C3A0319BD28063A0319C528073A0319A2
:10017000CB28053A0319D028D528B5010130B6009F
:100180004E200230B1002820E1280130B1000230B9
:10019000B2009E20E1280130B100B2009E20E1288B
:1001A000B5011030B6004E20E12830081F3C031C7A
:1001B000DB280730B0050130B5003008B6004E200E
:1001C000E1280034AA1BF4280F30F700290EF705A8
:1001D0000A3077020318EF283030F707F1282A0891
:1001E000F7077708B000AF200F30A9050A302902C1
:1001F0000318FC283030FE28AA132A08A90729086A
:10020000B000AF208A11EB290408AF00A91F112903
:100210002D30B000AF208403A809A909A80A03194A
:10022000A90A290EF038AB00AB07E23EAC00323E23
:10023000AE0029080F39AC07AC07AE07E93EAD00A8
:10024000AD07AD07280E0F39AD07AE07AD0DAE0DEA
:10025000AE09AE0D28080F39AE07AB0D0730AA0066
:100260000A30AE07AD03031C3129AD07AC03031CF4
:100270003529AC07AB03031C3929AB07AA03031CC0
:100280003D292A30840007302F0584072E300402D0
:10029000031966290008F700031D54292F1A642941
:1002A000AF195629203057290830AF003030F707F2
:1002B000A9010408A8007708AA007708B000AF20B9
:1002C000280884002A08F700840A46290008F70055
:1002D0003030F7077708B000AF20003483160611DE
:1002E000831206152808930083161418792983129F
:1002F0007429061583121308930183161418822992
:1003000083127D2983121308F800003484011F3002
:10031000830583161F129F121B0880399B0007302C
:100320009C001C0883120D13603083168F0083120B
:10033000A201A301A401A50183161F129F121B088D
:1003400080399B0083121F109412831606118614A5
:100350000612323083129400003083169400010894
:10036000C73908388100831290010030F8009200EC
:1003700000308316920007309C0005080330F70018
:10038000F70BC0291C0883120D1383169D018530BD
:100390008312A8001B20A8011B208630A8001B2068
:1003A0000630A8001B206428C830B1002820013086
:1003B000B100B2009E20A80128080C20A80AF7006E
:1003C000B000AF2008302802031DDC292108A90055
:1003D0003730AA00E2281430B10028200130B100E3
:1003E0000230B2009E205830B000AF203D30B00047
:1003F000AF20103084002308A9002208A80004219F
:100400002030B000AF205930B000AF203D30B000F8
:10041000AF20103084002508A9002408A80004217A
:100420001430B10028200230A8006E217808A10005
:100430000330A8006E217808A6000430A8006E21C1
:100440007808A700FA012608A61BFA03A2070318DA
:10045000A30A7A08A307FA012708A71BFA03A4072F
:0C0460000318A50A7A08A507D729630035
:04400E00793FFF3FB8
:00000001FF
;PIC16F88
/programy/PIC_C/mereni/mys/PIC16F88/mys.LST
0,0 → 1,829
CCS PCM C Compiler, Version 3.221, 27853 26-XII-05 16:54
 
Filename: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.LST
 
ROM used: 566 words (14%)
Largest free fragment is 2048
RAM used: 13 (7%) at main() level
30 (17%) worst case
Stack: 5 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 186
0003: NOP
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h"
.................... #include <16F88.h>
.................... //////// Standard Header file for the PIC16F88 device ////////////////
.................... #device PIC16F88
.................... #list
....................
.................... #device adc=8
.................... #fuses NOWDT,INTRC, NOPUT, MCLR, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO
.................... #use delay(clock=4000000)
*
0028: MOVLW 31
0029: MOVWF 04
002A: MOVF 00,W
002B: BTFSC 03.2
002C: GOTO 03C
002D: MOVLW 01
002E: MOVWF 78
002F: CLRF 77
0030: DECFSZ 77,F
0031: GOTO 030
0032: DECFSZ 78,F
0033: GOTO 02F
0034: MOVLW 4A
0035: MOVWF 77
0036: DECFSZ 77,F
0037: GOTO 036
0038: NOP
0039: NOP
003A: DECFSZ 00,F
003B: GOTO 02D
003C: RETLW 00
....................
....................
....................
.................... #define LCD_RS PIN_B3 // rizeni registru LCD displeje
.................... #define LCD_E PIN_B0 // enable LCD displeje
.................... #define LCD_DATA_LSB PIN_A0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
.................... #include "C:\library\CCS\lcd.c"
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem
.................... // (c)miho 2002,2005
.................... //
.................... // Historie:
.................... //
.................... // 0.00 Uvodni verze se snadnou definici portu LCD displeje
.................... // 0.01 Oprava portu (zapomenute stare identifikatory)
.................... // 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty
.................... // 0.03 Doplnena procedura lcd_clr pro smazani displeje
.................... //
.................... //
.................... // Funkce:
.................... //
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni
.................... //
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky
.................... // \f = \x0C - nova stranka - smazani displeje
.................... // \n = \x0A - odradkovani (prechod na druhou radku)
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet
.................... // \r = \x0D - goto home to position 1,1
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce)
.................... //
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu
.................... // nekontroluje parametry
.................... //
.................... // lcd_cursor_on zapne kurzor
.................... // lcd_cursor_off vypne kurzor
.................... //
.................... // lcd_clr smaze displej
.................... //
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM.
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7.
.................... // Na konci se provede lcd_gotoxy(1,1).
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku
.................... //
.................... //
.................... // Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
.................... //
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje
.................... // #define LCD_E PIN_B1 // enable LCD displeje
.................... // #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
.................... //
.................... //
.................... // Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov)
.................... //
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje
.................... // #define LCD_E PIN_B1 // enable LCD displeje
.................... // #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty
.................... // #define LCD_D1 PIN_C3 // D1
.................... // #define LCD_D2 PIN_C4 // D2
.................... // #define LCD_D3 PIN_C5 // D3
....................
....................
....................
....................
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje
....................
....................
....................
....................
.................... #ifdef LCD_DATA_LSB
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu
.................... //
.................... #define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu
.................... #define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu
.................... #define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru
.................... #define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu
.................... //
.................... #if LCD_SHIFT>4 // kontrola mezi
.................... #error LCD data port LSB bit not in range 0..4
.................... #endif
.................... #endif
....................
....................
.................... // Definice konstant pro LCD display
.................... //
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky
....................
....................
.................... // Definice rezimu LCD displeje
.................... //
.................... BYTE const LCD_INIT_STRING[4] =
.................... {
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7
.................... LCD_CURSOR_OFF_, // display on, kurzor off,
.................... 0x01, // clear displeje
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava)
.................... };
....................
....................
.................... // Odesle nibble do displeje (posle data a klikne signalem e)
.................... //
.................... void lcd_send_nibble( BYTE n )
.................... {
.................... #ifdef LCD_DATA_LSB
.................... // data jsou za sebou na 4 bitech jednoho portu
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej
003D: MOVF 05,W
003E: ANDLW F0
003F: MOVWF 38
0040: MOVF 37,W
0041: ANDLW 0F
0042: IORWF 38,W
0043: MOVWF 05
.................... #else
.................... // data jsou na libovolnych 4 bitech libovolnych portu
.................... output_bit(LCD_D0,bit_test(n,0));
.................... output_bit(LCD_D1,bit_test(n,1));
.................... output_bit(LCD_D2,bit_test(n,2));
.................... output_bit(LCD_D3,bit_test(n,3));
.................... #endif
.................... output_bit(LCD_E,1); // vzestupna hrana
0044: BSF 06.0
0045: BSF 03.5
0046: BCF 06.0
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat
0047: NOP
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us)
0048: BCF 03.5
0049: BCF 06.0
004A: BSF 03.5
004B: BCF 06.0
.................... }
004C: BCF 03.5
004D: RETLW 00
....................
....................
.................... // Odesle bajt do registru LCD
.................... //
.................... // Pokud je Adr=0 .. instrukcni registr
.................... // Pokud je Adr=1 .. datovy registr
.................... //
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n )
.................... {
.................... output_bit(LCD_RS,Adr); // vyber registr
004E: MOVF 35,F
004F: BTFSS 03.2
0050: GOTO 053
0051: BCF 06.3
0052: GOTO 054
0053: BSF 06.3
0054: BSF 03.5
0055: BCF 06.3
.................... swap(n);
0056: BCF 03.5
0057: SWAPF 36,F
.................... lcd_send_nibble(n); // posli horni pulku bajtu
0058: MOVF 36,W
0059: MOVWF 37
005A: CALL 03D
.................... swap(n);
005B: SWAPF 36,F
.................... lcd_send_nibble(n); // posli spodni pulku bajtu
005C: MOVF 36,W
005D: MOVWF 37
005E: CALL 03D
.................... delay_us(40); // minimalni doba na provedeni prikazu
005F: MOVLW 0D
0060: MOVWF 77
0061: DECFSZ 77,F
0062: GOTO 061
.................... }
0063: RETLW 00
....................
....................
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje
.................... //
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur
.................... //
.................... void lcd_init()
.................... {
....................
.................... int i; // pocitadlo cyklu
....................
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni
0064: MOVLW 14
0065: MOVWF 31
0066: CALL 028
....................
.................... #ifdef LCD_DATA_LSB
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD
0067: MOVLW F0
0068: BSF 03.5
0069: ANDWF 05,F
.................... #endif
....................
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav
006A: BCF 03.5
006B: BCF 06.3
006C: BSF 03.5
006D: BCF 06.3
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav
006E: BCF 03.5
006F: BCF 06.0
0070: BSF 03.5
0071: BCF 06.0
....................
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice
0072: BCF 03.5
0073: CLRF 28
0074: MOVF 28,W
0075: SUBLW 02
0076: BTFSS 03.0
0077: GOTO 080
.................... {
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel
0078: MOVLW 02
0079: MOVWF 31
007A: CALL 028
.................... lcd_send_nibble(3); // rezim 8 bitu
007B: MOVLW 03
007C: MOVWF 37
007D: CALL 03D
.................... }
007E: INCF 28,F
007F: GOTO 074
....................
.................... delay_us(40); // cas na zpracovani
0080: MOVLW 0D
0081: MOVWF 77
0082: DECFSZ 77,F
0083: GOTO 082
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu)
0084: MOVLW 02
0085: MOVWF 37
0086: CALL 03D
.................... delay_us(40); // cas na zpracovani
0087: MOVLW 0D
0088: MOVWF 77
0089: DECFSZ 77,F
008A: GOTO 089
....................
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod)
008B: CLRF 28
008C: MOVF 28,W
008D: SUBLW 02
008E: BTFSS 03.0
008F: GOTO 09C
.................... {
.................... lcd_send_byte(0,LCD_INIT_STRING[i]);
0090: MOVF 28,W
0091: CALL 004
0092: MOVWF 29
0093: CLRF 35
0094: MOVF 29,W
0095: MOVWF 36
0096: CALL 04E
.................... delay_ms(2);
0097: MOVLW 02
0098: MOVWF 31
0099: CALL 028
.................... }
009A: INCF 28,F
009B: GOTO 08C
.................... }
009C: BCF 0A.3
009D: GOTO 1D4 (RETURN)
....................
....................
.................... // Proved presun kurzoru
.................... //
.................... // Pozice 1.1 je domu
.................... //
.................... void lcd_gotoxy( BYTE x, BYTE y)
.................... {
....................
.................... BYTE Adr;
....................
.................... Adr=x-1;
009E: MOVLW 01
009F: SUBWF 31,W
00A0: MOVWF 33
.................... if(y==2)
00A1: MOVF 32,W
00A2: SUBLW 02
00A3: BTFSS 03.2
00A4: GOTO 0A7
.................... Adr+=LCD_LINE_2;
00A5: MOVLW 40
00A6: ADDWF 33,F
....................
.................... lcd_send_byte(0,0x80|Adr);
00A7: MOVF 33,W
00A8: IORLW 80
00A9: MOVWF 34
00AA: CLRF 35
00AB: MOVF 34,W
00AC: MOVWF 36
00AD: CALL 04E
.................... }
00AE: RETLW 00
....................
....................
.................... // Zapis znaku na displej, zpracovani ridicich znaku
.................... //
.................... void lcd_putc( char c)
.................... {
....................
.................... switch (c)
.................... {
00AF: MOVF 30,W
00B0: XORLW 0C
00B1: BTFSC 03.2
00B2: GOTO 0BD
00B3: XORLW 06
00B4: BTFSC 03.2
00B5: GOTO 0C5
00B6: XORLW 07
00B7: BTFSC 03.2
00B8: GOTO 0CB
00B9: XORLW 05
00BA: BTFSC 03.2
00BB: GOTO 0D0
00BC: GOTO 0D5
.................... case '\f' : lcd_send_byte(0,1); // smaz displej
00BD: CLRF 35
00BE: MOVLW 01
00BF: MOVWF 36
00C0: CALL 04E
.................... delay_ms(2);
00C1: MOVLW 02
00C2: MOVWF 31
00C3: CALL 028
.................... break;
00C4: GOTO 0E1
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky
00C5: MOVLW 01
00C6: MOVWF 31
00C7: MOVLW 02
00C8: MOVWF 32
00C9: CALL 09E
00CA: GOTO 0E1
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home
00CB: MOVLW 01
00CC: MOVWF 31
00CD: MOVWF 32
00CE: CALL 09E
00CF: GOTO 0E1
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet
00D0: CLRF 35
00D1: MOVLW 10
00D2: MOVWF 36
00D3: CALL 04E
00D4: GOTO 0E1
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F
00D5: MOVF 30,W
00D6: SUBLW 1F
00D7: BTFSS 03.0
00D8: GOTO 0DB
00D9: MOVLW 07
00DA: ANDWF 30,F
.................... lcd_send_byte(1,c); break; // zapis znak
00DB: MOVLW 01
00DC: MOVWF 35
00DD: MOVF 30,W
00DE: MOVWF 36
00DF: CALL 04E
00E0: GOTO 0E1
.................... }
.................... }
00E1: RETLW 00
....................
....................
.................... // Zapni kurzor
.................... //
.................... void lcd_cursor_on()
.................... {
.................... lcd_send_byte(0,LCD_CURSOR_ON_);
.................... }
....................
....................
.................... // Vypni kurzor
.................... //
.................... void lcd_cursor_off()
.................... {
.................... lcd_send_byte(0,LCD_CURSOR_OFF_);
.................... }
....................
....................
.................... // Smaz displej
.................... //
.................... void lcd_clr()
.................... {
.................... lcd_putc('\f');
.................... }
....................
....................
.................... // Definice vlastnich fontu
.................... //
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden
.................... // priklad pouziti definovanych znaku.
....................
....................
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje
.................... //
.................... void lcd_putc2(int Data)
.................... {
.................... lcd_send_byte(1,Data);
.................... }
....................
....................
.................... // Pomocne definice pro programovani obsahu CGRAM
.................... //
.................... #define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2)
.................... #define lcd_define_def(String) printf(lcd_putc2,String);
.................... #define lcd_define_end() lcd_send_byte(0,3); delay_ms(2)
....................
....................
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def
.................... //
.................... #define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end();
....................
....................
.................... // Pripravene definice fontu vybranych znaku
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80
.................... //
.................... #define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */
.................... #define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */
.................... #define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */
.................... #define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */
.................... #define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */
.................... #define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */
.................... #define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */
.................... #define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */
.................... #define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */
.................... #define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */
.................... #define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */
.................... #define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */
.................... #define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */
.................... #define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */
.................... #define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */
.................... #define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */
.................... #define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */
.................... #define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */
.................... #define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */
.................... #define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */
.................... #define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */
.................... #define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */
.................... #define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */
.................... #define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */
.................... #define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */
.................... #define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */
.................... #define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */
.................... #define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */
.................... #define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */
.................... #define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */
.................... #define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */
.................... #define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */
.................... #define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */
.................... #define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */
.................... #define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */
....................
....................
.................... // Priklad pouziti definovanych znaku
.................... //
.................... //
.................... //void lcd_sample()
.................... //{
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji
.................... // // jediny definicni retezec)
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3
.................... // delay_ms(1000);
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0
.................... // delay_ms(1000);
.................... //}
....................
....................
.................... #include "C:\library\kaklik\CCS\mys_chip_SPI.c" // modul umoznujici komunikaci s cidlem v mysi
.................... ////////////////////////////////////////////////////////////////////////////////
.................... //
.................... // Modul pro prime ovladani senzoru v opticke mysi.
.................... // (Pouziva SPI jednotku)
.................... //
.................... //
.................... ////////////////////////////////////////////////////////////////////////////////
....................
.................... #define SPI_DATA PIN_B2 // je treba nadefinovat datovy pin, aby se vedelo, ktery pin se ma vypinat pri cteni dat.
....................
.................... // Address
.................... #define PRODUCT_ID 0x00
.................... #define PRODUCT_ID4 0x01
.................... #define MOTION_STATUS 0x02 //
.................... #define DELTA_X 0x03 // vycteni os
.................... #define DELTA_Y 0x04 // -//-
.................... #define OPERATION_MODE 0x85 // zapis do ridiciho registru
.................... #define CONFIGURATION 0x86 // zmeni nastaveni rozliseni, atd.
....................
.................... void chip_write(command)
.................... {
.................... output_high(PIN_B2);
*
001B: BSF 03.5
001C: BCF 06.2
001D: BCF 03.5
001E: BSF 06.2
.................... spi_write(command);
001F: MOVF 28,W
0020: MOVWF 13
0021: BSF 03.5
0022: BTFSC 14.0
0023: GOTO 026
0024: BCF 03.5
0025: GOTO 021
.................... }
0026: BCF 03.5
0027: RETLW 00
....................
.................... signed int8 chip_read(command)
.................... {
.................... output_high(SPI_DATA);
*
016E: BSF 03.5
016F: BCF 06.2
0170: BCF 03.5
0171: BSF 06.2
.................... spi_write(command);
0172: MOVF 28,W
0173: MOVWF 13
0174: BSF 03.5
0175: BTFSC 14.0
0176: GOTO 179
0177: BCF 03.5
0178: GOTO 174
.................... output_float(SPI_DATA);
0179: BSF 06.2
.................... return spi_read(0);
017A: BCF 03.5
017B: MOVF 13,W
017C: CLRF 13
017D: BSF 03.5
017E: BTFSC 14.0
017F: GOTO 182
0180: BCF 03.5
0181: GOTO 17D
0182: BCF 03.5
0183: MOVF 13,W
0184: MOVWF 78
.................... }
0185: RETLW 00
....................
....................
.................... void main()
.................... {
0186: CLRF 04
0187: MOVLW 1F
0188: ANDWF 03,F
0189: BSF 03.5
018A: BCF 1F.4
018B: BCF 1F.5
018C: MOVF 1B,W
018D: ANDLW 80
018E: MOVWF 1B
018F: MOVLW 07
0190: MOVWF 1C
0191: MOVF 1C,W
0192: BCF 03.5
0193: BCF 0D.6
0194: MOVLW 60
0195: BSF 03.5
0196: MOVWF 0F
.................... unsigned int8 hodnota;
.................... signed int16 x=0,y=0;
0197: BCF 03.5
0198: CLRF 22
0199: CLRF 23
019A: CLRF 24
019B: CLRF 25
.................... signed int8 xd,yd;
....................
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
019C: BSF 03.5
019D: BCF 1F.4
019E: BCF 1F.5
019F: MOVF 1B,W
01A0: ANDLW 80
01A1: MOVWF 1B
.................... setup_adc(ADC_OFF);
01A2: BCF 03.5
01A3: BCF 1F.0
.................... setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_64);
01A4: BCF 14.5
01A5: BSF 03.5
01A6: BCF 06.2
01A7: BSF 06.1
01A8: BCF 06.4
01A9: MOVLW 32
01AA: BCF 03.5
01AB: MOVWF 14
01AC: MOVLW 00
01AD: BSF 03.5
01AE: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
01AF: MOVF 01,W
01B0: ANDLW C7
01B1: IORLW 08
01B2: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
01B3: BCF 03.5
01B4: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
01B5: MOVLW 00
01B6: MOVWF 78
01B7: MOVWF 12
01B8: MOVLW 00
01B9: BSF 03.5
01BA: MOVWF 12
.................... setup_comparator(NC_NC_NC_NC);
01BB: MOVLW 07
01BC: MOVWF 1C
01BD: MOVF 05,W
01BE: MOVLW 03
01BF: MOVWF 77
01C0: DECFSZ 77,F
01C1: GOTO 1C0
01C2: MOVF 1C,W
01C3: BCF 03.5
01C4: BCF 0D.6
.................... setup_vref(FALSE);
01C5: BSF 03.5
01C6: CLRF 1D
....................
.................... chip_write(OPERATION_MODE);
01C7: MOVLW 85
01C8: BCF 03.5
01C9: MOVWF 28
01CA: CALL 01B
.................... chip_write(0x00); // vypne sleep mode
01CB: CLRF 28
01CC: CALL 01B
....................
.................... chip_write(CONFIGURATION);
01CD: MOVLW 86
01CE: MOVWF 28
01CF: CALL 01B
.................... chip_write(0b00000110); // nastavi rozliseni na 600cpi
01D0: MOVLW 06
01D1: MOVWF 28
01D2: CALL 01B
....................
.................... lcd_init();
01D3: GOTO 064
.................... Delay_ms(200);
01D4: MOVLW C8
01D5: MOVWF 31
01D6: CALL 028
....................
.................... While(true)
.................... {
.................... LCD_gotoxy(1,1);
01D7: MOVLW 01
01D8: MOVWF 31
01D9: MOVWF 32
01DA: CALL 09E
.................... printf(lcd_putc,"status: %X", hodnota);
01DB: CLRF 28
01DC: MOVF 28,W
01DD: CALL 00C
01DE: INCF 28,F
01DF: MOVWF 77
01E0: MOVWF 30
01E1: CALL 0AF
01E2: MOVLW 08
01E3: SUBWF 28,W
01E4: BTFSS 03.2
01E5: GOTO 1DC
01E6: MOVF 21,W
01E7: MOVWF 29
01E8: MOVLW 37
01E9: MOVWF 2A
01EA: GOTO 0E2
.................... delay_ms(20);
01EB: MOVLW 14
01EC: MOVWF 31
01ED: CALL 028
....................
.................... LCD_gotoxy(1,2);
01EE: MOVLW 01
01EF: MOVWF 31
01F0: MOVLW 02
01F1: MOVWF 32
01F2: CALL 09E
.................... printf(lcd_putc,"X=%ld Y=%ld", x, y);
01F3: MOVLW 58
01F4: MOVWF 30
01F5: CALL 0AF
01F6: MOVLW 3D
01F7: MOVWF 30
01F8: CALL 0AF
01F9: MOVLW 10
01FA: MOVWF 04
01FB: MOVF 23,W
01FC: MOVWF 29
01FD: MOVF 22,W
01FE: MOVWF 28
01FF: CALL 104
0200: MOVLW 20
0201: MOVWF 30
0202: CALL 0AF
0203: MOVLW 59
0204: MOVWF 30
0205: CALL 0AF
0206: MOVLW 3D
0207: MOVWF 30
0208: CALL 0AF
0209: MOVLW 10
020A: MOVWF 04
020B: MOVF 25,W
020C: MOVWF 29
020D: MOVF 24,W
020E: MOVWF 28
020F: CALL 104
.................... delay_ms(20);
0210: MOVLW 14
0211: MOVWF 31
0212: CALL 028
....................
.................... hodnota=chip_read(MOTION_STATUS);
0213: MOVLW 02
0214: MOVWF 28
0215: CALL 16E
0216: MOVF 78,W
0217: MOVWF 21
....................
.................... xd=chip_read(DELTA_X);
0218: MOVLW 03
0219: MOVWF 28
021A: CALL 16E
021B: MOVF 78,W
021C: MOVWF 26
.................... yd=chip_read(DELTA_Y);
021D: MOVLW 04
021E: MOVWF 28
021F: CALL 16E
0220: MOVF 78,W
0221: MOVWF 27
....................
.................... x+=xd;
0222: CLRF 7A
0223: MOVF 26,W
0224: BTFSC 26.7
0225: DECF 7A,F
0226: ADDWF 22,F
0227: BTFSC 03.0
0228: INCF 23,F
0229: MOVF 7A,W
022A: ADDWF 23,F
.................... y+=yd;
022B: CLRF 7A
022C: MOVF 27,W
022D: BTFSC 27.7
022E: DECF 7A,F
022F: ADDWF 24,F
0230: BTFSC 03.0
0231: INCF 25,F
0232: MOVF 7A,W
0233: ADDWF 25,F
.................... }
0234: GOTO 1D7
.................... }
....................
0235: SLEEP
 
Configuration Fuses:
Word 1: 3F79 NOWDT NOPUT MCLR BROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC
Word 2: 3FFF FCMEN IESO
/programy/PIC_C/mereni/mys/PIC16F88/mys.PJT
0,0 → 1,39
[PROJECT]
Target=mys.HEX
Development_Mode=
Processor=0x688F
ToolSuite=CCS
 
[Directories]
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr
Library=
LinkerScript=
 
[Target Data]
FileList=mys.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[mys.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=mys.c
 
[Windows]
0=0000 mys.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.c
2=C:\library\kaklik\CCS\mys_chip_SPI.c
3=D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h
4=C:\Program Files\PICC\devices\16F88.h
5=C:\library\CCS\lcd.c
6=
/programy/PIC_C/mereni/mys/PIC16F88/mys.SYM
0,0 → 1,79
015-016 CCP_1
015 CCP_1_LOW
016 CCP_1_HIGH
021 main.hodnota
022-023 main.x
024-025 main.y
026 main.xd
027 main.yd
028 chip_write.command
028 lcd_init.i
028 chip_read.command
028-029 @PRINTF_LD_278.P1
028 main.@SCRATCH
029 @PRINTF_X_278.P1
029 lcd_init.@SCRATCH
02A @PRINTF_X_278.P1
02A @PRINTF_LD_278.@SCRATCH
02B @PRINTF_LD_278.@SCRATCH
02C @PRINTF_LD_278.@SCRATCH
02D @PRINTF_LD_278.@SCRATCH
02E @PRINTF_LD_278.@SCRATCH
02F @PRINTF_LD_278.@SCRATCH
030 lcd_putc.c
031 @delay_ms1.P1
031 lcd_gotoxy.x
032 lcd_gotoxy.y
033 lcd_gotoxy.Adr
034 lcd_gotoxy.@SCRATCH
035 lcd_send_byte.Adr
036 lcd_send_byte.n
037 lcd_send_nibble.n
038 lcd_send_nibble.@SCRATCH
039 lcd_send_nibble.@SCRATCH
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
079 @SCRATCH
07A @SCRATCH
07B @SCRATCH
09C.6 C1OUT
09C.7 C2OUT
 
0028 @delay_ms1
0004 @const27
003D lcd_send_nibble
004E lcd_send_byte
0064 lcd_init
009E lcd_gotoxy
00AF lcd_putc
001B chip_write
016E chip_read
0186 main
000C @const10113
00E2 @PRINTF_X_278
0104 @PRINTF_LD_278
0186 @cinit
 
Project Files:
D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.c
D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h
C:\Program Files\PICC\devices\16F88.h
C:\library\CCS\lcd.c
C:\library\kaklik\CCS\mys_chip_SPI.c
 
Compiler Settings:
Processor: PIC16F88
Pointer Size: 8
ADC Range: 0-255
Opt Level: 9
Short,Int,Long: 1,8,16
 
Output Files:
Errors: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.err
INHX8: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.HEX
Symbols: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.SYM
List: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.LST
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.cof
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.tre
Statistics: D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.sta
/programy/PIC_C/mereni/mys/PIC16F88/mys.c
0,0 → 1,52
#include "D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h"
 
#define LCD_RS PIN_B3 // rizeni registru LCD displeje
#define LCD_E PIN_B0 // enable LCD displeje
#define LCD_DATA_LSB PIN_A0 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
#include "C:\library\CCS\lcd.c"
 
#include "C:\library\kaklik\CCS\mys_chip_SPI.c" // modul umoznujici komunikaci s cidlem v mysi
 
void main()
{
unsigned int8 hodnota;
signed int16 x=0,y=0;
signed int8 xd,yd;
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(SPI_MASTER|SPI_H_TO_L|SPI_XMIT_L_TO_H|SPI_CLK_DIV_64);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
 
chip_write(OPERATION_MODE);
chip_write(0x00); // vypne sleep mode
chip_write(CONFIGURATION);
chip_write(0b00000110); // nastavi rozliseni na 600cpi
lcd_init();
Delay_ms(200);
While(true)
{
LCD_gotoxy(1,1);
printf(lcd_putc,"status: %X", hodnota);
delay_ms(20);
 
LCD_gotoxy(1,2);
printf(lcd_putc,"X=%ld Y=%ld", x, y);
delay_ms(20);
 
hodnota=chip_read(MOTION_STATUS);
xd=chip_read(DELTA_X); //precte z cidla zmenu polohy
yd=chip_read(DELTA_Y);
x+=xd;
y+=yd;
}
}
/programy/PIC_C/mereni/mys/PIC16F88/mys.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/PIC_C/mereni/mys/PIC16F88/mys.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/mys/PIC16F88/mys.h
0,0 → 1,5
#include <16F88.h>
#device adc=8
#fuses NOWDT,INTRC, NOPUT, MCLR, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO
#use delay(clock=4000000)
 
/programy/PIC_C/mereni/mys/PIC16F88/mys.sta
0,0 → 1,42
 
ROM used: 566 (14%)
566 (14%) including unused fragments
 
1 Average locations per line
7 Average locations per statement
 
RAM used: 13 (7%) at main() level
30 (17%) worst case
 
Lines Stmts % Files
----- ----- --- -----
53 27 34 D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.c
6 0 0 D:\KAKLIK\programy\PIC_C\mereni\mys\PIC16F88\mys.h
275 0 0 C:\Program Files\PICC\devices\16F88.h
312 47 44 C:\library\CCS\lcd.c
33 6 4 C:\library\kaklik\CCS\mys_chip_SPI.c
----- -----
1358 160 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 4 1 @delay_ms1
0 8 1 0 @const27
0 17 3 3 lcd_send_nibble
0 22 4 2 lcd_send_byte
0 58 10 2 lcd_init
0 17 3 4 lcd_gotoxy
0 51 9 1 lcd_putc
0 13 2 1 chip_write
0 24 4 1 chip_read
0 176 31 8 main
0 15 3 0 @const10113
0 34 6 2 @PRINTF_X_278
0 106 19 8 @PRINTF_LD_278
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-007FF 562 1482
00800-00FFF 0 2048
 
/programy/PIC_C/mereni/mys/PIC16F88/mys.tre
0,0 → 1,301
ÀÄmys
ÀÄmain 0/176 Ram=8
ÃÄ??0??
ÃÄchip_write 0/13 Ram=1
ÃÄchip_write 0/13 Ram=1
ÃÄchip_write 0/13 Ram=1
ÃÄchip_write 0/13 Ram=1
ÃÄlcd_init 0/58 Ram=2
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@const27 0/8 Ram=0
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@const10113 0/15 Ram=0
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@PRINTF_X_278 0/34 Ram=2
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@PRINTF_LD_278 0/106 Ram=8
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@PRINTF_LD_278 0/106 Ram=8
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ³ ÀÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/17 Ram=3
³ ÀÄlcd_send_nibble 0/17 Ram=3
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄchip_read 0/24 Ram=1
ÃÄchip_read 0/24 Ram=1
ÀÄchip_read 0/24 Ram=1
/programy/PIC_C/mereni/mys/mys.JPG
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/PIC_C/mereni/otmer/16F873/LCD.C
0,0 → 1,311
// LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem
// (c)miho 2002,2005
//
// Historie:
//
// 0.00 Uvodni verze se snadnou definici portu LCD displeje
// 0.01 Oprava portu (zapomenute stare identifikatory)
// 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty
// 0.03 Doplnena procedura lcd_clr pro smazani displeje
//
//
// Funkce:
//
// lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni
//
// lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky
// \f = \x0C - nova stranka - smazani displeje
// \n = \x0A - odradkovani (prechod na druhou radku)
// \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet
// \r = \x0D - goto home to position 1,1
// \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM
// \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM
// Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce)
//
// lcd_gotoxy(x,y) presune kurzor na uvedenou adresu
// nekontroluje parametry
//
// lcd_cursor_on zapne kurzor
// lcd_cursor_off vypne kurzor
//
// lcd_clr smaze displej
//
// lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho
// retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM.
// Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7.
// Na konci se provede lcd_gotoxy(1,1).
// Na konci teto knihovny je priklad pouziti definovanych znaku
//
//
// Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
//
// #define LCD_RS PIN_B2 // rizeni registru LCD displeje
// #define LCD_E PIN_B1 // enable LCD displeje
// #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
//
//
// Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov)
//
// #define LCD_RS PIN_B2 // rizeni registru LCD displeje
// #define LCD_E PIN_B1 // enable LCD displeje
// #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty
// #define LCD_D1 PIN_C3 // D1
// #define LCD_D2 PIN_C4 // D2
// #define LCD_D3 PIN_C5 // D3
 
 
 
 
// Privatni sekce, cist jen v pripade, ze neco nefunguje
 
 
 
 
#ifdef LCD_DATA_LSB
// Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne
// bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva
// v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu
//
#define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu
#define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu
#define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru
#define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu
//
#if LCD_SHIFT>4 // kontrola mezi
#error LCD data port LSB bit not in range 0..4
#endif
#endif
 
 
// Definice konstant pro LCD display
//
#define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem
#define LCD_CURSOR_OFF_ 0x0C // zadny kurzor
#define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky
 
 
// Definice rezimu LCD displeje
//
BYTE const LCD_INIT_STRING[4] =
{
0x28, // intrfejs 4 bity, 2 radky, font 5x7
LCD_CURSOR_OFF_, // display on, kurzor off,
0x01, // clear displeje
0x06 // inkrement pozice kurzoru (posun kurzoru doprava)
};
 
 
// Odesle nibble do displeje (posle data a klikne signalem e)
//
void lcd_send_nibble( BYTE n )
{
#ifdef LCD_DATA_LSB
// data jsou za sebou na 4 bitech jednoho portu
*LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej
#else
// data jsou na libovolnych 4 bitech libovolnych portu
output_bit(LCD_D0,bit_test(n,0));
output_bit(LCD_D1,bit_test(n,1));
output_bit(LCD_D2,bit_test(n,2));
output_bit(LCD_D3,bit_test(n,3));
#endif
output_bit(LCD_E,1); // vzestupna hrana
delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat
output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us)
}
 
 
// Odesle bajt do registru LCD
//
// Pokud je Adr=0 .. instrukcni registr
// Pokud je Adr=1 .. datovy registr
//
void lcd_send_byte( BOOLEAN Adr, BYTE n )
{
output_bit(LCD_RS,Adr); // vyber registr
swap(n);
lcd_send_nibble(n); // posli horni pulku bajtu
swap(n);
lcd_send_nibble(n); // posli spodni pulku bajtu
delay_us(40); // minimalni doba na provedeni prikazu
}
 
 
// Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje
//
// Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur
//
void lcd_init()
{
 
int i; // pocitadlo cyklu
 
delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni
 
#ifdef LCD_DATA_LSB
// data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy
*LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD
#endif
 
output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav
output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav
 
for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice
{
delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel
lcd_send_nibble(3); // rezim 8 bitu
}
 
delay_us(40); // cas na zpracovani
lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu)
delay_us(40); // cas na zpracovani
 
for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod)
{
lcd_send_byte(0,LCD_INIT_STRING[i]);
delay_ms(2);
}
}
 
 
// Proved presun kurzoru
//
// Pozice 1.1 je domu
//
void lcd_gotoxy( BYTE x, BYTE y)
{
 
BYTE Adr;
 
Adr=x-1;
if(y==2)
Adr+=LCD_LINE_2;
 
lcd_send_byte(0,0x80|Adr);
}
 
 
// Zapis znaku na displej, zpracovani ridicich znaku
//
void lcd_putc( char c)
{
 
switch (c)
{
case '\f' : lcd_send_byte(0,1); // smaz displej
delay_ms(2);
break;
case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky
case '\r' : lcd_gotoxy(1,1); break; // presun home
case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet
default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F
lcd_send_byte(1,c); break; // zapis znak
}
}
 
 
// Zapni kurzor
//
void lcd_cursor_on()
{
lcd_send_byte(0,LCD_CURSOR_ON_);
}
 
 
// Vypni kurzor
//
void lcd_cursor_off()
{
lcd_send_byte(0,LCD_CURSOR_OFF_);
}
 
 
// Smaz displej
//
void lcd_clr()
{
lcd_putc('\f');
}
 
 
// Definice vlastnich fontu
//
// Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje
// Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden
// priklad pouziti definovanych znaku.
 
 
// Pomocna procedura pro posilani ridicich dat do radice displeje
//
void lcd_putc2(int Data)
{
lcd_send_byte(1,Data);
}
 
 
// Pomocne definice pro programovani obsahu CGRAM
//
#define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2)
#define lcd_define_def(String) printf(lcd_putc2,String);
#define lcd_define_end() lcd_send_byte(0,3); delay_ms(2)
 
 
// Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def
//
#define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end();
 
 
// Pripravene definice fontu vybranych znaku
// V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80
//
#define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */
#define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */
#define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */
#define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */
#define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */
#define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */
#define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */
#define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */
#define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */
#define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */
#define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */
#define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */
#define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */
#define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */
#define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */
#define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */
#define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */
#define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */
#define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */
#define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */
#define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */
#define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */
#define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */
#define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */
#define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */
#define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */
#define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */
#define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */
#define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */
#define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */
#define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */
#define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */
#define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */
#define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */
#define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */
 
 
// Priklad pouziti definovanych znaku
//
//
//void lcd_sample()
//{
// lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0
// lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2
// // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji
// // jediny definicni retezec)
// printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3
// delay_ms(1000);
// lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0
// delay_ms(1000);
//}
/programy/PIC_C/mereni/otmer/16F873/otmer.BAK
0,0 → 1,44
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h"
 
//Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
 
#define LCD_RS PIN_B1 // rizeni registru LCD displeje
#define LCD_E PIN_B0 // enable LCD displeje
#define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
 
#include "LCD.C"
 
#define DATA PIN_A1
#define CP PIN_A0
#define STROBE PIN_A2
 
#include "C:\library\kaklik\ccs\shift_reg.c"
 
void main()
{
unsigned int16 otacky;
 
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_2);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_PWM);
setup_ccp2(CCP_OFF);
 
lcd_init();
 
while (true)
{
set_timer1(0);
 
Delay_ms(500);
otacky=get_timer1();
otacky=otacky*40;
 
LCD_gotoxy(2,2);
printf(lcd_putc,"otacky:%lu ot/min ",otacky);
}
 
}
/programy/PIC_C/mereni/otmer/16F873/otmer.HEX
0,0 → 1,64
:1000000000308A00582900000A108A100A1182075D
:1000100028340C34013406340A108A100A1182077D
:100020006F347434613463346B3479343A34253446
:100030006C34753420346F3474342F346D34693437
:100040006E34203420340034323084000008031928
:1000500038280130A100A001A00B2C28A10B2B28CF
:100060004A30A000A00B322800000000800B292895
:10007000003407080F39B900380EA000F030A00591
:100080002008F03939048700061483160610000092
:10009000831206108316061083120034B608031D5F
:1000A0005328861054288614831686108312B70EA0
:1000B0003708B8003920B70E3708B80039200D309E
:1000C000A000A00B612800341430B20024200F30AF
:1000D00083168705831286108316861083120610F6
:1000E000831606108312A8012808023C031C8028EE
:1000F0000230B20024200330B8003920A80A742846
:100100000D30A000A00B82280230B80039200D303D
:10011000A000A00B8928A8012808023C031C9C28E9
:1001200028080420A900B6012908B7004E20023093
:10013000B2002420A80A8C288A119C291030A00023
:10014000A301AC01A90CA80C031CAC282A08A30726
:100150000318AC0A2B08AC07AC0CA30CA20CA10C26
:10016000A00BA2288A11B92901303202B400330849
:10017000023C031DBD284030B40734088038B50068
:10018000B6013508B7004E20003431080C3A031987
:10019000D328063A0319DB28073A0319E128053A60
:1001A0000319E628EB28B6010130B7004E200230D3
:1001B000B2002420F7280130B2000230B300B4208E
:1001C000F7280130B200B300B420F728B601103090
:1001D000B7004E20F72831081F3C031CF1280730D8
:1001E000B1050130B6003108B7004E20F7280034C1
:1001F0000408B0002A0EF038AC00AC07E23EAD00B7
:10020000323EAF002A080F39AD07AD07AF07E93E10
:10021000AE00AE07AE07290E0F39AE07AF07AE0D21
:10022000AF0DAF09AF0D29080F39AF07AC0D07307F
:10023000AB000A30AF07AE03031C1A29AE07AD03AB
:10024000031C1E29AD07AC03031C2229AC07AB031A
:10025000031C26292B3084000730300584072F30FB
:10026000040203194F290008A000031D3D29301A7C
:100270004D29B0193F29203040290830B0003030D6
:10028000A007AA010408A9002008AB002008B100BB
:10029000C520290884002B08A000840A2F29000803
:1002A000A0003030A0072008B100C5208A11D8294D
:1002B00084011F30830583161F149F141F159F117F
:1002C000FF308312A50083161F149F141F159F1162
:1002D00083121F109412A51225088316870083121B
:1002E00025162508831687008312A5112508831675
:1002F0008700003083129400831694000108C739E8
:10030000383881009730831290000030A1009200AD
:10031000003083169200831225112508831687006A
:10032000831207110C309700A51425088316870047
:1003300083129D019D0164288F018E010230A80067
:10034000FA30B2002420A80BA0290F08A3000E0841
:10035000A0000F082302031DA5292008A6002308DA
:10036000A7002708A9002608A800AB012830AA008A
:100370009E282208A7002108A6002608A00027081A
:10038000A300C2290230B200B300B420A80128089B
:100390000C20A80AA000B100C52007302802031DC8
:1003A000C729103084002708AA002608A900F828C9
:1003B0000A30A90029080C20A90AA000B100C52014
:0C03C00013302902031DDA299C29630078
:02400E00793FF8
:00000001FF
;PIC16F873
/programy/PIC_C/mereni/otmer/16F873/otmer.LST
0,0 → 1,762
CCS PCM C Compiler, Version 3.221, 27853 19-VIII-05 18:09
 
Filename: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.LST
 
ROM used: 486 words (12%)
Largest free fragment is 2048
RAM used: 10 (5%) at main() level
27 (14%) worst case
Stack: 5 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 158
0003: NOP
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h"
.................... #include <16F873.h>
.................... //////// Standard Header file for the PIC16F873 device ////////////////
.................... #device PIC16F873
.................... #list
....................
.................... #device adc=8
.................... #fuses NOWDT,XT, NOPUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG
.................... #use delay(clock=4000000)
*
0024: MOVLW 32
0025: MOVWF 04
0026: MOVF 00,W
0027: BTFSC 03.2
0028: GOTO 038
0029: MOVLW 01
002A: MOVWF 21
002B: CLRF 20
002C: DECFSZ 20,F
002D: GOTO 02C
002E: DECFSZ 21,F
002F: GOTO 02B
0030: MOVLW 4A
0031: MOVWF 20
0032: DECFSZ 20,F
0033: GOTO 032
0034: NOP
0035: NOP
0036: DECFSZ 00,F
0037: GOTO 029
0038: RETLW 00
....................
....................
....................
.................... //Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
....................
.................... #define LCD_RS PIN_B1 // rizeni registru LCD displeje
.................... #define LCD_E PIN_B0 // enable LCD displeje
.................... #define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
....................
.................... #include "LCD.C"
.................... // LCD modul pro ovladani dvouradkoveho LCD modulu se standardnim Hitachi radicem
.................... // (c)miho 2002,2005
.................... //
.................... // Historie:
.................... //
.................... // 0.00 Uvodni verze se snadnou definici portu LCD displeje
.................... // 0.01 Oprava portu (zapomenute stare identifikatory)
.................... // 0.02 Doplnena moznost pripojeni datoveho portu LCD na libovolne porty
.................... // 0.03 Doplnena procedura lcd_clr pro smazani displeje
.................... //
.................... //
.................... // Funkce:
.................... //
.................... // lcd_init() inicializuje LCD displej a porty, nutno volat jako prvni
.................... //
.................... // lcd_putc(c) zapis snaku do lcd displeje, zpracovava nasledujici ridici znaky
.................... // \f = \x0C - nova stranka - smazani displeje
.................... // \n = \x0A - odradkovani (prechod na druhou radku)
.................... // \b = \x08 - backspace - posunuti kurzoru o 1 pozici zpet
.................... // \r = \x0D - goto home to position 1,1
.................... // \0 .. \7 - definovatelne znaky v pozicich 0 az 7 v CGRAM
.................... // \20 .. \27 - alternativne zapsane znaky (oktalove) v pozicich 0 az 7 CGRAM
.................... // Pozor na to, ze funkce printf konci tisk pokud narazi na \0 (konec retezce)
.................... //
.................... // lcd_gotoxy(x,y) presune kurzor na uvedenou adresu
.................... // nekontroluje parametry
.................... //
.................... // lcd_cursor_on zapne kurzor
.................... // lcd_cursor_off vypne kurzor
.................... //
.................... // lcd_clr smaze displej
.................... //
.................... // lcd_define_char(Index, Def) Makro, ktere definuje znaky od pozice Index obsahem definicniho
.................... // retezce Def. Kazdych 8 znaku retezce Def definuje dalsi znak v CGRAM.
.................... // Kapacita CGRAM je celkem 8 znaku s indexem 0 az 7.
.................... // Na konci se provede lcd_gotoxy(1,1).
.................... // Na konci teto knihovny je priklad pouziti definovanych znaku
.................... //
.................... //
.................... // Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
.................... //
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje
.................... // #define LCD_E PIN_B1 // enable LCD displeje
.................... // #define LCD_DATA_LSB PIN_C2 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
.................... //
.................... //
.................... // Alternativni definice: // Datovy port displeje pripojeny na libovolne 4 bitove porty (vede na kod delsi asi o 25 slov)
.................... //
.................... // #define LCD_RS PIN_B2 // rizeni registru LCD displeje
.................... // #define LCD_E PIN_B1 // enable LCD displeje
.................... // #define LCD_D0 PIN_C2 // D0 - datove bity pripojene na libovolne porty
.................... // #define LCD_D1 PIN_C3 // D1
.................... // #define LCD_D2 PIN_C4 // D2
.................... // #define LCD_D3 PIN_C5 // D3
....................
....................
....................
....................
.................... // Privatni sekce, cist jen v pripade, ze neco nefunguje
....................
....................
....................
....................
.................... #ifdef LCD_DATA_LSB
.................... // Generovane defince portu pro ucely teto knihovny aby kod generoval spravne IO operace a soucasne
.................... // bylo mozne jednoduse deklarovat pripojene piny LCD displeje pri pouziti teto knihovny. Problem spociva
.................... // v tom, ze se musi spravne ridit smery portu a soucasne datovy port zabira jen 4 bity ze zadaneho portu
.................... //
.................... #define LCD_SHIFT (LCD_DATA_LSB&7) // pocet bitu posuvu datoveho kanalu v datovem portu
.................... #define LCD_PORT (LCD_DATA_LSB>>3) // adresa LCD datoveho portu
.................... #define LCD_TRIS (LCD_PORT+0x80) // adresa prislusneho TRIS registru
.................... #define LCD_MASK (0xF<<LCD_SHIFT) // maska platnych bitu
.................... //
.................... #if LCD_SHIFT>4 // kontrola mezi
.................... #error LCD data port LSB bit not in range 0..4
.................... #endif
.................... #endif
....................
....................
.................... // Definice konstant pro LCD display
.................... //
.................... #define LCD_CURSOR_ON_ 0x0E // kurzor jako blikajici radka pod znakem
.................... #define LCD_CURSOR_OFF_ 0x0C // zadny kurzor
.................... #define LCD_LINE_2 0x40 // adresa 1. znaku 2. radky
....................
....................
.................... // Definice rezimu LCD displeje
.................... //
.................... BYTE const LCD_INIT_STRING[4] =
.................... {
.................... 0x28, // intrfejs 4 bity, 2 radky, font 5x7
.................... LCD_CURSOR_OFF_, // display on, kurzor off,
.................... 0x01, // clear displeje
.................... 0x06 // inkrement pozice kurzoru (posun kurzoru doprava)
.................... };
....................
....................
.................... // Odesle nibble do displeje (posle data a klikne signalem e)
.................... //
.................... void lcd_send_nibble( BYTE n )
.................... {
.................... #ifdef LCD_DATA_LSB
.................... // data jsou za sebou na 4 bitech jednoho portu
.................... *LCD_PORT = (*LCD_PORT & ~LCD_MASK) | ((n << LCD_SHIFT) & LCD_MASK); // nastav datove bity portu a ostatni zachovej
0039: MOVF 07,W
003A: ANDLW 0F
003B: MOVWF 39
003C: SWAPF 38,W
003D: MOVWF 20
003E: MOVLW F0
003F: ANDWF 20,F
0040: MOVF 20,W
0041: ANDLW F0
0042: IORWF 39,W
0043: MOVWF 07
.................... #else
.................... // data jsou na libovolnych 4 bitech libovolnych portu
.................... output_bit(LCD_D0,bit_test(n,0));
.................... output_bit(LCD_D1,bit_test(n,1));
.................... output_bit(LCD_D2,bit_test(n,2));
.................... output_bit(LCD_D3,bit_test(n,3));
.................... #endif
.................... output_bit(LCD_E,1); // vzestupna hrana
0044: BSF 06.0
0045: BSF 03.5
0046: BCF 06.0
.................... delay_us(1); // pockej alespon 450ns od e nebo alespon 195ns od dat
0047: NOP
.................... output_bit(LCD_E,0); // sestupna hrana (minimalni perioda e je 1us)
0048: BCF 03.5
0049: BCF 06.0
004A: BSF 03.5
004B: BCF 06.0
.................... }
004C: BCF 03.5
004D: RETLW 00
....................
....................
.................... // Odesle bajt do registru LCD
.................... //
.................... // Pokud je Adr=0 .. instrukcni registr
.................... // Pokud je Adr=1 .. datovy registr
.................... //
.................... void lcd_send_byte( BOOLEAN Adr, BYTE n )
.................... {
.................... output_bit(LCD_RS,Adr); // vyber registr
004E: MOVF 36,F
004F: BTFSS 03.2
0050: GOTO 053
0051: BCF 06.1
0052: GOTO 054
0053: BSF 06.1
0054: BSF 03.5
0055: BCF 06.1
.................... swap(n);
0056: BCF 03.5
0057: SWAPF 37,F
.................... lcd_send_nibble(n); // posli horni pulku bajtu
0058: MOVF 37,W
0059: MOVWF 38
005A: CALL 039
.................... swap(n);
005B: SWAPF 37,F
.................... lcd_send_nibble(n); // posli spodni pulku bajtu
005C: MOVF 37,W
005D: MOVWF 38
005E: CALL 039
.................... delay_us(40); // minimalni doba na provedeni prikazu
005F: MOVLW 0D
0060: MOVWF 20
0061: DECFSZ 20,F
0062: GOTO 061
.................... }
0063: RETLW 00
....................
....................
.................... // Provede inicializaci LCD displeje, smaze obsah a nastavi mod displeje
.................... //
.................... // Tato procedura se musi volat pred pouzitim ostatnich lcd_ procedur
.................... //
.................... void lcd_init()
.................... {
....................
.................... int i; // pocitadlo cyklu
....................
.................... delay_ms(20); // spozdeni pro provedeni startu displeje po zapnuti napajeni
0064: MOVLW 14
0065: MOVWF 32
0066: CALL 024
....................
.................... #ifdef LCD_DATA_LSB
.................... // data jsou na 4 bitech za sebou, nastav smer pro vsechny dalsi prenosy
.................... *LCD_TRIS = *LCD_TRIS & ~LCD_MASK; // nuluj odpovidajici bity tris registru datoveho portu LCD
0067: MOVLW 0F
0068: BSF 03.5
0069: ANDWF 07,F
.................... #endif
....................
.................... output_bit(LCD_RS,0); // nastav jako vystup a nastav klidovy stav
006A: BCF 03.5
006B: BCF 06.1
006C: BSF 03.5
006D: BCF 06.1
.................... output_bit(LCD_E, 0); // nastav jako vystup a nastav klidovy stav
006E: BCF 03.5
006F: BCF 06.0
0070: BSF 03.5
0071: BCF 06.0
....................
.................... for (i=0; i<3; i++) // nastav lcd do rezimu 8 bitu sbernice
0072: BCF 03.5
0073: CLRF 28
0074: MOVF 28,W
0075: SUBLW 02
0076: BTFSS 03.0
0077: GOTO 080
.................... {
.................... delay_ms(2); // muze byt rozdelany prenos dat (2x 4 bity) nebo pomaly povel
0078: MOVLW 02
0079: MOVWF 32
007A: CALL 024
.................... lcd_send_nibble(3); // rezim 8 bitu
007B: MOVLW 03
007C: MOVWF 38
007D: CALL 039
.................... }
007E: INCF 28,F
007F: GOTO 074
....................
.................... delay_us(40); // cas na zpracovani
0080: MOVLW 0D
0081: MOVWF 20
0082: DECFSZ 20,F
0083: GOTO 082
.................... lcd_send_nibble(2); // nastav rezim 4 bitu (plati od nasledujiciho prenosu)
0084: MOVLW 02
0085: MOVWF 38
0086: CALL 039
.................... delay_us(40); // cas na zpracovani
0087: MOVLW 0D
0088: MOVWF 20
0089: DECFSZ 20,F
008A: GOTO 089
....................
.................... for (i=0;i<3;i++) // proved inicializaci (nastaveni modu, smazani apod)
008B: CLRF 28
008C: MOVF 28,W
008D: SUBLW 02
008E: BTFSS 03.0
008F: GOTO 09C
.................... {
.................... lcd_send_byte(0,LCD_INIT_STRING[i]);
0090: MOVF 28,W
0091: CALL 004
0092: MOVWF 29
0093: CLRF 36
0094: MOVF 29,W
0095: MOVWF 37
0096: CALL 04E
.................... delay_ms(2);
0097: MOVLW 02
0098: MOVWF 32
0099: CALL 024
.................... }
009A: INCF 28,F
009B: GOTO 08C
.................... }
009C: BCF 0A.3
009D: GOTO 19C (RETURN)
....................
....................
.................... // Proved presun kurzoru
.................... //
.................... // Pozice 1.1 je domu
.................... //
.................... void lcd_gotoxy( BYTE x, BYTE y)
.................... {
....................
.................... BYTE Adr;
....................
.................... Adr=x-1;
*
00B4: MOVLW 01
00B5: SUBWF 32,W
00B6: MOVWF 34
.................... if(y==2)
00B7: MOVF 33,W
00B8: SUBLW 02
00B9: BTFSS 03.2
00BA: GOTO 0BD
.................... Adr+=LCD_LINE_2;
00BB: MOVLW 40
00BC: ADDWF 34,F
....................
.................... lcd_send_byte(0,0x80|Adr);
00BD: MOVF 34,W
00BE: IORLW 80
00BF: MOVWF 35
00C0: CLRF 36
00C1: MOVF 35,W
00C2: MOVWF 37
00C3: CALL 04E
.................... }
00C4: RETLW 00
....................
....................
.................... // Zapis znaku na displej, zpracovani ridicich znaku
.................... //
.................... void lcd_putc( char c)
.................... {
....................
.................... switch (c)
.................... {
00C5: MOVF 31,W
00C6: XORLW 0C
00C7: BTFSC 03.2
00C8: GOTO 0D3
00C9: XORLW 06
00CA: BTFSC 03.2
00CB: GOTO 0DB
00CC: XORLW 07
00CD: BTFSC 03.2
00CE: GOTO 0E1
00CF: XORLW 05
00D0: BTFSC 03.2
00D1: GOTO 0E6
00D2: GOTO 0EB
.................... case '\f' : lcd_send_byte(0,1); // smaz displej
00D3: CLRF 36
00D4: MOVLW 01
00D5: MOVWF 37
00D6: CALL 04E
.................... delay_ms(2);
00D7: MOVLW 02
00D8: MOVWF 32
00D9: CALL 024
.................... break;
00DA: GOTO 0F7
.................... case '\n' : lcd_gotoxy(1,2); break; // presun se na 1. znak 2. radky
00DB: MOVLW 01
00DC: MOVWF 32
00DD: MOVLW 02
00DE: MOVWF 33
00DF: CALL 0B4
00E0: GOTO 0F7
.................... case '\r' : lcd_gotoxy(1,1); break; // presun home
00E1: MOVLW 01
00E2: MOVWF 32
00E3: MOVWF 33
00E4: CALL 0B4
00E5: GOTO 0F7
.................... case '\b' : lcd_send_byte(0,0x10); break; // posun kurzor o 1 zpet
00E6: CLRF 36
00E7: MOVLW 10
00E8: MOVWF 37
00E9: CALL 04E
00EA: GOTO 0F7
.................... default : if (c<0x20) c&=0x7; // preklopeni definovatelnych znaku na rozsah 0 az 0x1F
00EB: MOVF 31,W
00EC: SUBLW 1F
00ED: BTFSS 03.0
00EE: GOTO 0F1
00EF: MOVLW 07
00F0: ANDWF 31,F
.................... lcd_send_byte(1,c); break; // zapis znak
00F1: MOVLW 01
00F2: MOVWF 36
00F3: MOVF 31,W
00F4: MOVWF 37
00F5: CALL 04E
00F6: GOTO 0F7
.................... }
.................... }
00F7: RETLW 00
....................
....................
.................... // Zapni kurzor
.................... //
.................... void lcd_cursor_on()
.................... {
.................... lcd_send_byte(0,LCD_CURSOR_ON_);
.................... }
....................
....................
.................... // Vypni kurzor
.................... //
.................... void lcd_cursor_off()
.................... {
.................... lcd_send_byte(0,LCD_CURSOR_OFF_);
.................... }
....................
....................
.................... // Smaz displej
.................... //
.................... void lcd_clr()
.................... {
.................... lcd_putc('\f');
.................... }
....................
....................
.................... // Definice vlastnich fontu
.................... //
.................... // Vlastnich definic muze byt jen 8 do pozic 0 az 7 pameti CGRAM radice lcd displeje
.................... // Pro snadne definovani jsou pripraveny nasledujici definice a na konci souboru je uveden
.................... // priklad pouziti definovanych znaku.
....................
....................
.................... // Pomocna procedura pro posilani ridicich dat do radice displeje
.................... //
.................... void lcd_putc2(int Data)
.................... {
.................... lcd_send_byte(1,Data);
.................... }
....................
....................
.................... // Pomocne definice pro programovani obsahu CGRAM
.................... //
.................... #define lcd_define_start(Code) lcd_send_byte(0,0x40+(Code<<3)); delay_ms(2)
.................... #define lcd_define_def(String) printf(lcd_putc2,String);
.................... #define lcd_define_end() lcd_send_byte(0,3); delay_ms(2)
....................
....................
.................... // Vlastni vykonne makro pro definovani fontu do pozice Index CGRAM s definicnim retezcem Def
.................... //
.................... #define lcd_define_char(Index, Def) lcd_define_start(Index); lcd_define_def(Def); lcd_define_end();
....................
....................
.................... // Pripravene definice fontu vybranych znaku
.................... // V tabulce nesmi byt 00 (konec retezce v printf()), misto toho davame 80
.................... //
.................... #define LCD_CHAR_BAT100 "\x0E\x1F\x1F\x1F\x1F\x1F\x1F\x1F" /* symbol plne baterie */
.................... #define LCD_CHAR_BAT50 "\x0E\x1F\x11\x11\x13\x17\x1F\x1F" /* symbol polovicni baterie */
.................... #define LCD_CHAR_BAT0 "\x0E\x1F\x11\x11\x11\x11\x11\x1F" /* symbol vybite baterie */
.................... #define LCD_CHAR_UP "\x80\x04\x0E\x15\x04\x04\x04\x80" /* symbol sipka nahoru */
.................... #define LCD_CHAR_DOWN "\x80\x04\x04\x04\x15\x0E\x04\x80" /* symbol Sipka dolu */
.................... #define LCD_CHAR_LUA "\x04\x0E\x11\x11\x1F\x11\x11\x80" /* A s carkou */
.................... #define LCD_CHAR_LLA "\x01\x02\x0E\x01\x1F\x11\x0F\x80" /* a s carkou */
.................... #define LCD_CHAR_HUC "\x0A\x0E\x11\x10\x10\x11\x0E\x80" /* C s hackem */
.................... #define LCD_CHAR_HLC "\x0A\x04\x0E\x10\x10\x11\x0E\x80" /* c s hackem */
.................... #define LCD_CHAR_HUD "\x0A\x1C\x12\x11\x11\x12\x1C\x80" /* D s hackem */
.................... #define LCD_CHAR_HLD "\x05\x03\x0D\x13\x11\x11\x0F\x80" /* d s hackem */
.................... #define LCD_CHAR_LUE "\x04\x1F\x10\x10\x1E\x10\x1F\x80" /* E s carkou */
.................... #define LCD_CHAR_LLE "\x01\x02\x0E\x11\x1F\x10\x0E\x80" /* e s carkou */
.................... #define LCD_CHAR_HUE "\x0A\x1F\x10\x1E\x10\x10\x1F\x80" /* E s hackem */
.................... #define LCD_CHAR_HLE "\x0A\x04\x0E\x11\x1F\x10\x0E\x80" /* e s hackem */
.................... #define LCD_CHAR_LUI "\x04\x0E\x04\x04\x04\x04\x0E\x80" /* I s carkou */
.................... #define LCD_CHAR_LLI "\x02\x04\x80\x0C\x04\x04\x0E\x80" /* i s carkou */
.................... #define LCD_CHAR_HUN "\x0A\x15\x11\x19\x15\x13\x11\x80" /* N s hackem */
.................... #define LCD_CHAR_HLN "\x0A\x04\x16\x19\x11\x11\x11\x80" /* n s hackem */
.................... #define LCD_CHAR_LUO "\x04\x0E\x11\x11\x11\x11\x0E\x80" /* O s carkou */
.................... #define LCD_CHAR_LLO "\x02\x04\x0E\x11\x11\x11\x0E\x80" /* o s carkou */
.................... #define LCD_CHAR_HUR "\x0A\x1E\x11\x1E\x14\x12\x11\x80" /* R s hackem */
.................... #define LCD_CHAR_HLR "\x0A\x04\x16\x19\x10\x10\x10\x80" /* r s hackem */
.................... #define LCD_CHAR_HUS "\x0A\x0F\x10\x0E\x01\x01\x1E\x80" /* S s hackem */
.................... #define LCD_CHAR_HLS "\x0A\x04\x0E\x10\x0E\x01\x1E\x80" /* s s hackem */
.................... #define LCD_CHAR_HUT "\x0A\x1F\x04\x04\x04\x04\x04\x80" /* T s hackem */
.................... #define LCD_CHAR_HLT "\x0A\x0C\x1C\x08\x08\x09\x06\x80" /* t s hackem */
.................... #define LCD_CHAR_LUU "\x02\x15\x11\x11\x11\x11\x0E\x80" /* U s carkou */
.................... #define LCD_CHAR_LLU "\x02\x04\x11\x11\x11\x13\x0D\x80" /* u s carkou */
.................... #define LCD_CHAR_CUU "\x06\x17\x11\x11\x11\x11\x0E\x80" /* U s krouzkem */
.................... #define LCD_CHAR_CLU "\x06\x06\x11\x11\x11\x11\x0E\x80" /* u s krouzkem */
.................... #define LCD_CHAR_LUY "\x02\x15\x11\x0A\x04\x04\x04\x80" /* Y s carkou */
.................... #define LCD_CHAR_LLY "\x02\x04\x11\x11\x0F\x01\x0E\x80" /* y s carkou */
.................... #define LCD_CHAR_HUZ "\x0A\x1F\x01\x02\x04\x08\x1F\x80" /* Z s hackem */
.................... #define LCD_CHAR_HLZ "\x0A\x04\x1F\x02\x04\x08\x1F\x80" /* z s hackem */
....................
....................
.................... // Priklad pouziti definovanych znaku
.................... //
.................... //
.................... //void lcd_sample()
.................... //{
.................... // lcd_define_char(0,LCD_CHAR_BAT50); // Priklad definice znaku baterie do pozice 0
.................... // lcd_define_char(2,LCD_CHAR_HLE LCD_CHAR_LUI); // Priklad definice znaku e s hackem a I s carkou od pozice 2
.................... // // vsimnete si, ze neni carka mezi retezci s definici (oba retezce definuji
.................... // // jediny definicni retezec)
.................... // printf(lcd_putc,"\fZnaky:\20\22\23"); // priklad vypisu znaku z pozice 0, 2 a 3
.................... // delay_ms(1000);
.................... // lcd_define_char(0,LCD_CHAR_BAT0); // Predefinovani tvaru znaku v pozici 0
.................... // delay_ms(1000);
.................... //}
....................
....................
.................... #define DATA PIN_A1
.................... #define CP PIN_A0
.................... #define STROBE PIN_A2
....................
.................... #include "C:\library\kaklik\ccs\shift_reg.c"
.................... ////////////////////////////////////////////////////////////////////////////////
.................... // KNIHOVNA PRO OVLADANI POSUVNEHO REGISTRU
.................... //
.................... ////////////////////////////////////////////////////////////////////////////////
.................... // definice:
.................... //#define DATA PIN_A1
.................... //#define CP PIN_A0
.................... //#define STROBE PIN_A2
....................
.................... void putreg(unsigned int8 out) // zapise do registru 8bitovou promenou.
.................... {
.................... int8 i;
.................... output_low(STROBE);
....................
.................... for(i=0;i<=7;i++)
.................... {
.................... output_bit(DATA,bit_test(out,7-i));
.................... output_low(CP);
.................... output_high(CP);
.................... }
.................... output_high(STROBE);
.................... }
....................
.................... void reg_shift_left()
.................... {
.................... output_low(CP);
.................... output_high(CP);
....................
.................... }
....................
.................... void reg_shift_right()
.................... {
.................... }
....................
....................
.................... void main()
.................... {
*
0158: CLRF 04
0159: MOVLW 1F
015A: ANDWF 03,F
015B: BSF 03.5
015C: BSF 1F.0
015D: BSF 1F.1
015E: BSF 1F.2
015F: BCF 1F.3
.................... unsigned int16 otacky;
....................
.................... setup_adc_ports(NO_ANALOGS);
*
0163: BSF 03.5
0164: BSF 1F.0
0165: BSF 1F.1
0166: BSF 1F.2
0167: BCF 1F.3
.................... setup_adc(ADC_OFF);
0168: BCF 03.5
0169: BCF 1F.0
.................... setup_spi(FALSE);
*
0160: MOVLW FF
0161: BCF 03.5
0162: MOVWF 25
*
016A: BCF 14.5
016B: BCF 25.5
016C: MOVF 25,W
016D: BSF 03.5
016E: MOVWF 07
016F: BCF 03.5
0170: BSF 25.4
0171: MOVF 25,W
0172: BSF 03.5
0173: MOVWF 07
0174: BCF 03.5
0175: BCF 25.3
0176: MOVF 25,W
0177: BSF 03.5
0178: MOVWF 07
0179: MOVLW 00
017A: BCF 03.5
017B: MOVWF 14
017C: BSF 03.5
017D: MOVWF 14
.................... setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
017E: MOVF 01,W
017F: ANDLW C7
0180: IORLW 38
0181: MOVWF 01
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_2);
0182: MOVLW 97
0183: BCF 03.5
0184: MOVWF 10
.................... setup_timer_2(T2_DISABLED,0,1);
0185: MOVLW 00
0186: MOVWF 21
0187: MOVWF 12
0188: MOVLW 00
0189: BSF 03.5
018A: MOVWF 12
.................... setup_ccp1(CCP_PWM);
018B: BCF 03.5
018C: BCF 25.2
018D: MOVF 25,W
018E: BSF 03.5
018F: MOVWF 07
0190: BCF 03.5
0191: BCF 07.2
0192: MOVLW 0C
0193: MOVWF 17
.................... setup_ccp2(CCP_OFF);
0194: BSF 25.1
0195: MOVF 25,W
0196: BSF 03.5
0197: MOVWF 07
0198: BCF 03.5
0199: CLRF 1D
019A: CLRF 1D
....................
.................... lcd_init();
019B: GOTO 064
....................
.................... while (true)
.................... {
.................... set_timer1(0);
019C: CLRF 0F
019D: CLRF 0E
....................
.................... Delay_ms(500);
019E: MOVLW 02
019F: MOVWF 28
01A0: MOVLW FA
01A1: MOVWF 32
01A2: CALL 024
01A3: DECFSZ 28,F
01A4: GOTO 1A0
.................... otacky=get_timer1();
01A5: MOVF 0F,W
01A6: MOVWF 23
01A7: MOVF 0E,W
01A8: MOVWF 20
01A9: MOVF 0F,W
01AA: SUBWF 23,W
01AB: BTFSS 03.2
01AC: GOTO 1A5
01AD: MOVF 20,W
01AE: MOVWF 26
01AF: MOVF 23,W
01B0: MOVWF 27
.................... otacky=otacky*40;
01B1: MOVF 27,W
01B2: MOVWF 29
01B3: MOVF 26,W
01B4: MOVWF 28
01B5: CLRF 2B
01B6: MOVLW 28
01B7: MOVWF 2A
01B8: GOTO 09E
01B9: MOVF 22,W
01BA: MOVWF 27
01BB: MOVF 21,W
01BC: MOVWF 26
....................
.................... switch(otacky)
.................... {
01BD: MOVF 26,W
01BE: MOVWF 20
01BF: MOVF 27,W
01C0: MOVWF 23
01C1: GOTO 1C2
....................
.................... }
....................
.................... LCD_gotoxy(2,2);
01C2: MOVLW 02
01C3: MOVWF 32
01C4: MOVWF 33
01C5: CALL 0B4
.................... printf(lcd_putc,"otacky:%lu ot/min ",otacky);
01C6: CLRF 28
01C7: MOVF 28,W
01C8: CALL 00C
01C9: INCF 28,F
01CA: MOVWF 20
01CB: MOVWF 31
01CC: CALL 0C5
01CD: MOVLW 07
01CE: SUBWF 28,W
01CF: BTFSS 03.2
01D0: GOTO 1C7
01D1: MOVLW 10
01D2: MOVWF 04
01D3: MOVF 27,W
01D4: MOVWF 2A
01D5: MOVF 26,W
01D6: MOVWF 29
01D7: GOTO 0F8
01D8: MOVLW 0A
01D9: MOVWF 29
01DA: MOVF 29,W
01DB: CALL 00C
01DC: INCF 29,F
01DD: MOVWF 20
01DE: MOVWF 31
01DF: CALL 0C5
01E0: MOVLW 13
01E1: SUBWF 29,W
01E2: BTFSS 03.2
01E3: GOTO 1DA
.................... }
01E4: GOTO 19C
....................
.................... }
....................
01E5: SLEEP
 
Configuration Fuses:
Word 1: 3F79 XT NOWDT NOPUT NOPROTECT BROWNOUT NOLVP NOCPD NOWRT NODEBUG
/programy/PIC_C/mereni/otmer/16F873/otmer.PJT
0,0 → 1,39
[PROJECT]
Target=otmer.HEX
Development_Mode=
Processor=0x873F
ToolSuite=CCS
 
[Directories]
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\drivers\;C:\library\CCS;
Library=
LinkerScript=
 
[Target Data]
FileList=otmer.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[otmer.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=otmer.c
 
[Windows]
0=0000 otmer.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.c
2=D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h
3=C:\Program Files\PICC\devices\16F873.h
4=D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\LCD.C
5=C:\library\kaklik\ccs\shift_reg.c
6=
/programy/PIC_C/mereni/otmer/16F873/otmer.SYM
0,0 → 1,75
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-027 main.otacky
028 lcd_init.i
028-029 @MUL1616.P1
028 main.@SCRATCH
029-02A @PRINTF_LU_263.P1
029 lcd_init.@SCRATCH
029 main.@SCRATCH
02A-02B @MUL1616.P1
02B @PRINTF_LU_263.@SCRATCH
02C @MUL1616.@SCRATCH
02C @PRINTF_LU_263.@SCRATCH
02D @PRINTF_LU_263.@SCRATCH
02E @PRINTF_LU_263.@SCRATCH
02F @PRINTF_LU_263.@SCRATCH
030 @PRINTF_LU_263.@SCRATCH
031 lcd_putc.c
032 @delay_ms1.P1
032 lcd_gotoxy.x
033 lcd_gotoxy.y
034 lcd_gotoxy.Adr
035 lcd_gotoxy.@SCRATCH
036 lcd_send_byte.Adr
037 lcd_send_byte.n
038 lcd_send_nibble.n
039 lcd_send_nibble.@SCRATCH
03A lcd_send_nibble.@SCRATCH
 
0024 @delay_ms1
0004 @const28
0039 lcd_send_nibble
004E lcd_send_byte
0064 lcd_init
00B4 lcd_gotoxy
00C5 lcd_putc
0158 main
009E @MUL1616
000C @const10134
00F8 @PRINTF_LU_263
0158 @cinit
 
Project Files:
D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.c
D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h
C:\Program Files\PICC\devices\16F873.h
D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\LCD.C
C:\library\kaklik\ccs\shift_reg.c
 
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\programy\PIC_C\mereni\otmer\16F873\otmer.err
INHX8: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.HEX
Symbols: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.SYM
List: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.LST
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.cof
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.tre
Statistics: D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.sta
/programy/PIC_C/mereni/otmer/16F873/otmer.c
0,0 → 1,49
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h"
 
//Definice portu: // Datovy port displeje pripojeny na 4 bity za sebou na jeden port
 
#define LCD_RS PIN_B1 // rizeni registru LCD displeje
#define LCD_E PIN_B0 // enable LCD displeje
#define LCD_DATA_LSB PIN_C4 // pripojeni LSB bitu datoveho portu LCD displeje (celkem 4 bity vzestupne za sebou)
 
#include "LCD.C"
 
#define DATA PIN_A1
#define CP PIN_A0
#define STROBE PIN_A2
 
#include "C:\library\kaklik\ccs\shift_reg.c"
 
void main()
{
unsigned int16 otacky;
 
setup_adc_ports(NO_ANALOGS);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_EXT_H_TO_L|RTCC_DIV_1);
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_2);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_PWM);
setup_ccp2(CCP_OFF);
 
lcd_init();
 
while (true)
{
set_timer1(0);
 
Delay_ms(500);
otacky=get_timer1();
otacky=otacky*40;
switch(otacky)
{
}
 
LCD_gotoxy(2,2);
printf(lcd_putc,"otacky:%lu ot/min ",otacky);
}
 
}
/programy/PIC_C/mereni/otmer/16F873/otmer.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/PIC_C/mereni/otmer/16F873/otmer.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/otmer/16F873/otmer.h
0,0 → 1,5
#include <16F873.h>
#device adc=8
#fuses NOWDT,XT, NOPUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG
#use delay(clock=4000000)
 
/programy/PIC_C/mereni/otmer/16F873/otmer.sta
0,0 → 1,40
 
ROM used: 486 (12%)
486 (12%) including unused fragments
 
1 Average locations per line
7 Average locations per statement
 
RAM used: 10 (5%) at main() level
27 (14%) worst case
 
Lines Stmts % Files
----- ----- --- -----
50 18 24 D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.c
6 0 0 D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\otmer.h
240 0 0 C:\Program Files\PICC\devices\16F873.h
312 47 51 D:\KAKLIK\programy\PIC_C\mereni\otmer\16F873\LCD.C
34 9 6 C:\library\kaklik\ccs\shift_reg.c
----- -----
1284 148 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 4 1 @delay_ms1
0 8 2 0 @const28
0 21 4 3 lcd_send_nibble
0 22 5 2 lcd_send_byte
0 58 12 2 lcd_init
0 17 3 4 lcd_gotoxy
0 51 10 1 lcd_putc
0 142 29 4 main
0 22 5 5 @MUL1616
0 24 5 0 @const10134
0 96 20 8 @PRINTF_LU_263
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-007FF 482 1562
00800-00FFF 0 2048
 
/programy/PIC_C/mereni/otmer/16F873/otmer.tre
0,0 → 1,98
ÀÄotmer
ÀÄmain 0/142 Ram=4
ÃÄ??0??
ÃÄlcd_init 0/58 Ram=2
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@const28 0/8 Ram=0
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@MUL1616 0/22 Ram=5
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄ@const10134 0/24 Ram=0
ÃÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄ@PRINTF_LU_263 0/96 Ram=8
³ ÃÄlcd_putc 0/51 Ram=1
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄ@delay_ms1 0/21 Ram=1
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_putc 0/51 Ram=1
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄ@delay_ms1 0/21 Ram=1
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_gotoxy 0/17 Ram=4
³ ³ ÀÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÃÄlcd_send_byte 0/22 Ram=2
³ ³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ³ ÀÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄ@const10134 0/24 Ram=0
ÀÄlcd_putc 0/51 Ram=1
ÃÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_gotoxy 0/17 Ram=4
³ ÀÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÃÄlcd_send_byte 0/22 Ram=2
³ ÃÄlcd_send_nibble 0/21 Ram=3
³ ÀÄlcd_send_nibble 0/21 Ram=3
ÀÄlcd_send_byte 0/22 Ram=2
ÃÄlcd_send_nibble 0/21 Ram=3
ÀÄlcd_send_nibble 0/21 Ram=3
/programy/PIC_C/mereni/otmer/Kopie - otackomer.c
0,0 → 1,27
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otackomer.h"
 
#define DATA PIN_A1
#define CP PIN_A0
 
void main()
{
int i;
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
 
while(true)
{
output_high(DATA);
output_high(CP);
Delay_ms(100);
output_low(CP);
output_low(DATA);
 
for(i=7;i>0;i--)
{
Delay_ms(100);
output_high(CP);
Delay_ms(100);
output_low(CP);
}
}
}
/programy/PIC_C/mereni/otmer/Kopie - otmer.c
0,0 → 1,38
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h"
 
#define DATA PIN_A1
#define CP PIN_A0
#define STROBE PIN_A2
 
#include "shift_reg.c"
 
void main()
{
int n=0;
int i;
putreg(1);
while(true)
{
i=1;
for(n=0;n<=7;n++)
{
putreg(i);
i=i<<1;
Delay_ms(50);
};
i=0x80;
for(n=0;n<=7;n++)
{
putreg(i);
i=i>>1;
Delay_ms(50);
};
}
 
while(true)
{
putreg(~n);
Delay_ms(100);
n++;
}
}
/programy/PIC_C/mereni/otmer/otmer.BAK
0,0 → 1,38
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h"
 
#define DATA PIN_A1
#define CP PIN_A0
#define STROBE PIN_A2
 
#include "shift_reg.c"
 
void main()
{
int n=0;
int i;
putreg(1);
while(true)
{
i=1;
for(n=0;n<=7;n++)
{
putreg(~i);
i=i<<1;
Delay_ms(50);
};
i=0x80;
for(n=0;n<=7;n++)
{
putreg(~i);
i=i>>1;
Delay_ms(50);
};
}
 
while(true)
{
putreg(~n);
Delay_ms(100);
n++;
}
}
/programy/PIC_C/mereni/otmer/otmer.HEX
0,0 → 1,19
:1000000000308A0044280000831605118312051170
:1000100093011308073C031C2A281308073C94008B
:1000200012088C0014088D0003191A2803108C0C78
:100030008D0B16280C181E2885101F288514831672
:100040008510051083120510831605108312051400
:10005000930A0928831605118312051500341130FF
:10006000840000080319432801308D008C018C0B9B
:1000700037288D0B36284A308C008C0B3D28000029
:100080000000800B3428003484011F3083058F0169
:10009000013092000420013090008F010F08073CCE
:1000A000031C5C281008920004200310900D3230CD
:1000B00091002F208F0A4E28803090008F010F086A
:1000C000073C031C6D281008920004200310900CBC
:1000D000323091002F208F0A5F284B280F089100A3
:1000E0009109110892000420643091002F208F0A9A
:0400F0006E28630013
:02400E00F93F78
:00000001FF
;PIC16F84
/programy/PIC_C/mereni/otmer/otmer.LST
0,0 → 1,216
CCS PCM C Compiler, Version 3.221, 27853 14-VI-05 22:12
 
Filename: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.LST
 
ROM used: 122 words (12%)
Largest free fragment is 902
RAM used: 5 (7%) at main() level
8 (12%) worst case
Stack: 1 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 044
0003: NOP
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h"
.................... #include <16F84.h>
.................... //////// Standard Header file for the PIC16F84 device ////////////////
.................... #device PIC16F84
.................... #list
....................
.................... #fuses NOWDT,XT, NOPUT, NOPROTECT
.................... #use delay(clock=4000000)
*
002F: MOVLW 11
0030: MOVWF 04
0031: MOVF 00,W
0032: BTFSC 03.2
0033: GOTO 043
0034: MOVLW 01
0035: MOVWF 0D
0036: CLRF 0C
0037: DECFSZ 0C,F
0038: GOTO 037
0039: DECFSZ 0D,F
003A: GOTO 036
003B: MOVLW 4A
003C: MOVWF 0C
003D: DECFSZ 0C,F
003E: GOTO 03D
003F: NOP
0040: NOP
0041: DECFSZ 00,F
0042: GOTO 034
0043: RETLW 00
....................
....................
....................
.................... #define DATA PIN_A1
.................... #define CP PIN_A0
.................... #define STROBE PIN_A2
....................
.................... #include "shift_reg.c"
.................... ////////////////////////////////////////////////////////////////////////////////
.................... // KNIHOVNA PRO OVLADANI POSUVNEHO REGISTRU
.................... //
.................... ////////////////////////////////////////////////////////////////////////////////
.................... // definice
.................... //#define DATA PIN_A1
.................... //#define CP PIN_A0
.................... //#define STROBE PIN_A2
....................
.................... void putreg(unsigned int8 out) // zapise do registru 8bitovou promenou.
.................... {
.................... int8 i;
.................... output_low(STROBE);
*
0004: BSF 03.5
0005: BCF 05.2
0006: BCF 03.5
0007: BCF 05.2
....................
.................... for(i=0;i<=7;i++)
0008: CLRF 13
0009: MOVF 13,W
000A: SUBLW 07
000B: BTFSS 03.0
000C: GOTO 02A
.................... {
.................... output_bit(DATA,bit_test(out,7-i));
000D: MOVF 13,W
000E: SUBLW 07
000F: MOVWF 14
0010: MOVF 12,W
0011: MOVWF 0C
0012: MOVF 14,W
0013: MOVWF 0D
0014: BTFSC 03.2
0015: GOTO 01A
0016: BCF 03.0
0017: RRF 0C,F
0018: DECFSZ 0D,F
0019: GOTO 016
001A: BTFSC 0C.0
001B: GOTO 01E
001C: BCF 05.1
001D: GOTO 01F
001E: BSF 05.1
001F: BSF 03.5
0020: BCF 05.1
.................... output_low(CP);
0021: BCF 05.0
0022: BCF 03.5
0023: BCF 05.0
.................... output_high(CP);
0024: BSF 03.5
0025: BCF 05.0
0026: BCF 03.5
0027: BSF 05.0
.................... }
0028: INCF 13,F
0029: GOTO 009
.................... output_high(STROBE);
002A: BSF 03.5
002B: BCF 05.2
002C: BCF 03.5
002D: BSF 05.2
.................... }
002E: RETLW 00
.................... void reg_shift_left()
.................... {
.................... }
.................... void reg_shift_right()
.................... {
.................... }
....................
....................
.................... void main()
.................... {
*
0044: CLRF 04
0045: MOVLW 1F
0046: ANDWF 03,F
.................... int n=0;
0047: CLRF 0F
.................... int i;
.................... putreg(1);
0048: MOVLW 01
0049: MOVWF 12
004A: CALL 004
.................... while(true)
.................... {
.................... i=1;
004B: MOVLW 01
004C: MOVWF 10
.................... for(n=0;n<=7;n++)
004D: CLRF 0F
004E: MOVF 0F,W
004F: SUBLW 07
0050: BTFSS 03.0
0051: GOTO 05C
.................... {
.................... putreg(i);
0052: MOVF 10,W
0053: MOVWF 12
0054: CALL 004
.................... i=i<<1;
0055: BCF 03.0
0056: RLF 10,F
.................... Delay_ms(50);
0057: MOVLW 32
0058: MOVWF 11
0059: CALL 02F
.................... };
005A: INCF 0F,F
005B: GOTO 04E
.................... i=0x80;
005C: MOVLW 80
005D: MOVWF 10
.................... for(n=0;n<=7;n++)
005E: CLRF 0F
005F: MOVF 0F,W
0060: SUBLW 07
0061: BTFSS 03.0
0062: GOTO 06D
.................... {
.................... putreg(i);
0063: MOVF 10,W
0064: MOVWF 12
0065: CALL 004
.................... i=i>>1;
0066: BCF 03.0
0067: RRF 10,F
.................... Delay_ms(50);
0068: MOVLW 32
0069: MOVWF 11
006A: CALL 02F
.................... };
006B: INCF 0F,F
006C: GOTO 05F
.................... }
006D: GOTO 04B
....................
.................... while(true)
.................... {
.................... putreg(~n);
006E: MOVF 0F,W
006F: MOVWF 11
0070: COMF 11,F
0071: MOVF 11,W
0072: MOVWF 12
0073: CALL 004
.................... Delay_ms(100);
0074: MOVLW 64
0075: MOVWF 11
0076: CALL 02F
.................... n++;
0077: INCF 0F,F
.................... }
0078: GOTO 06E
.................... }
....................
0079: SLEEP
 
Configuration Fuses:
Word 1: 3FF9 XT NOWDT NOPUT NOPROTECT
/programy/PIC_C/mereni/otmer/otmer.PJT
0,0 → 1,38
[PROJECT]
Target=otmer.HEX
Development_Mode=
Processor=0x684A
ToolSuite=CCS
 
[Directories]
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr
Library=
LinkerScript=
 
[Target Data]
FileList=otmer.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[otmer.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=otmer.c
 
[Windows]
0=0000 otmer.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.c
2=D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h
3=C:\Program Files\PICC\devices\16F84.h
4=
5=
/programy/PIC_C/mereni/otmer/otmer.SYM
0,0 → 1,36
00C @SCRATCH
00D @SCRATCH
00D _RETURN_
00F main.n
010 main.i
011 @delay_ms1.P1
011 main.@SCRATCH
012 putreg.out
013 putreg.i
014 putreg.@SCRATCH
 
002F @delay_ms1
0004 putreg
0044 main
0044 @cinit
 
Project Files:
D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.c
D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h
C:\Program Files\PICC\devices\16F84.h
D:\KAKLIK\programy\PIC_C\mereni\otmer\shift_reg.c
 
Compiler Settings:
Processor: PIC16F84
Pointer Size: 8
Opt Level: 9
Short,Int,Long: 1,8,16
 
Output Files:
Errors: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.err
INHX8: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.HEX
Symbols: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.SYM
List: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.LST
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.cof
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.tre
Statistics: D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.sta
/programy/PIC_C/mereni/otmer/otmer.c
0,0 → 1,38
#include "D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h"
 
#define DATA PIN_A1
#define CP PIN_A0
#define STROBE PIN_A2
 
#include "shift_reg.c"
 
void main()
{
int n=0;
int i;
putreg(1);
while(true)
{
i=1;
for(n=0;n<=7;n++)
{
putreg(i);
i=i<<1;
Delay_ms(50);
};
i=0x80;
for(n=0;n<=7;n++)
{
putreg(i);
i=i>>1;
Delay_ms(50);
};
}
 
while(true)
{
putreg(~n);
Delay_ms(100);
n++;
}
}
/programy/PIC_C/mereni/otmer/otmer.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/PIC_C/mereni/otmer/otmer.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/otmer/otmer.h
0,0 → 1,4
#include <16F84.h>
#fuses NOWDT,XT, NOPUT, NOPROTECT
#use delay(clock=4000000)
 
/programy/PIC_C/mereni/otmer/otmer.sta
0,0 → 1,30
 
ROM used: 122 (12%)
122 (12%) including unused fragments
 
1 Average locations per line
4 Average locations per statement
 
RAM used: 5 (7%) at main() level
8 (12%) worst case
 
Lines Stmts % Files
----- ----- --- -----
39 22 76 D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.c
5 0 0 D:\KAKLIK\programy\PIC_C\mereni\otmer\otmer.h
111 0 0 C:\Program Files\PICC\devices\16F84.h
29 7 14 D:\KAKLIK\programy\PIC_C\mereni\otmer\shift_reg.c
----- -----
368 58 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 17 1 @delay_ms1
0 43 35 3 putreg
0 54 44 3 main
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-003FF 118 902
 
/programy/PIC_C/mereni/otmer/otmer.tre
0,0 → 1,10
ÀÄotmer
ÀÄmain 0/54 Ram=3
ÃÄ??0??
ÃÄputreg 0/43 Ram=3
ÃÄputreg 0/43 Ram=3
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄputreg 0/43 Ram=3
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄputreg 0/43 Ram=3
ÀÄ@delay_ms1 0/21 Ram=1
/programy/PIC_C/mereni/otmer/shift_reg.BAK
0,0 → 1,22
////////////////////////////////////////////////////////////////////////////////
// KNIHOVNA PRO OVLADANI POSUVNEHO REGISTRU
//
////////////////////////////////////////////////////////////////////////////////
// definice
//#define DATA PIN_A1
//#define CP PIN_A0
//#define STROBE PIN_A2
 
void putreg(unsigned int8 out) // zapise do registru 8bitovou promenou.
{
int8 i;
output_low(STROBE);
for(i=0;i<=7;i++)
{
output_bit(DATA,bit_test(out,7-i));
output_low(CP);
output_high(CP);
}
output_high(STROBE);
}
/programy/PIC_C/mereni/otmer/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
/programy/PIC_C/mereni/piezo_cidlo/PRG.BAT
0,0 → 1,10
@echo off
picpgr reset PIC16F84
picpgr erase PIC16F84
 
rem cls
picpgr program piezo.hex hex PIC16f84 XT_ON PWRTE_ON WDTE_OFF CP_OFF
picpgr run
pause
picpgr stop
pause
/programy/PIC_C/mereni/piezo_cidlo/PRG.PIF
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/PIC_C/mereni/piezo_cidlo/RUN.PIF
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/PIC_C/mereni/piezo_cidlo/Run.BAT
0,0 → 1,6
@echo off
picpgr reset PIC16F84
picpgr run
pause
picpgr stop
pause
/programy/PIC_C/mereni/piezo_cidlo/piezo.BAK
0,0 → 1,13
#include "D:\@Kaklik\programy\PIC_C\cidlo\piezo.h"
 
 
void main()
{
port_b_pullups(false);
setup_counters(RTCC_INTERNAL,WDT_18MS);
 
while (true)
{
if (input(PIN_B0)) output_high(PIN_A3); else output_low(PIN_A3);
}
}
/programy/PIC_C/mereni/piezo_cidlo/piezo.HEX
0,0 → 1,13
:1000000000308A001928000010308400000803190D
:10001000182801308D008C018C0B0C288D0B0B28BF
:100020004A308C008C0B122800000000800B09283D
:10003000402884011F3083058316811708308312FE
:100040008C008C1D2B280730810181308400000832
:10005000C0390F3880006400813084000008C03946
:100060000C048000831606148312061C4328831692
:1000700085118312851502308F00FA309000042814
:100080008F0B3D284728831685118312851132284E
:0200900063000B
:02400E00FE3F73
:00000001FF
;PIC16C84
/programy/PIC_C/mereni/piezo_cidlo/piezo.LST
0,0 → 1,112
CCS PCW C Compiler, Version 3.110, 15448
 
Filename: d:\@kaklik\programy\pic_c\cidlo\piezo.LST
 
ROM used: 73 (7%)
Largest free fragment is 951
RAM used: 3 (8%) at main() level
4 (11%) worst case
Stack: 1 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 019
0003: NOP
.................... #include "D:\@Kaklik\programy\PIC_C\cidlo\piezo.h"
.................... #include <16C84.h>
.................... //////// Standard Header file for the PIC16C84 device ////////////////
.................... #device PIC16C84
.................... #list
....................
.................... #use delay(clock=4000000)
0004: MOVLW 10
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: GOTO 040 (RETURN)
.................... #fuses HS,WDT
....................
....................
....................
....................
.................... void main()
.................... {
0019: CLRF 04
001A: MOVLW 1F
001B: ANDWF 03,F
.................... port_b_pullups(false);
001C: BSF 03.5
001D: BSF 01.7
.................... setup_counters(RTCC_INTERNAL,WDT_18MS);
001E: MOVLW 08
001F: BCF 03.5
0020: MOVWF 0C
0021: BTFSS 0C.3
0022: GOTO 02B
0023: MOVLW 07
0024: CLRF 01
0025: MOVLW 81
0026: MOVWF 04
0027: MOVF 00,W
0028: ANDLW C0
0029: IORLW 0F
002A: MOVWF 00
002B: CLRWDT
002C: MOVLW 81
002D: MOVWF 04
002E: MOVF 00,W
002F: ANDLW C0
0030: IORWF 0C,W
0031: MOVWF 00
....................
.................... while (true)
.................... {
.................... if (input(PIN_B0))
0032: BSF 03.5
0033: BSF 06.0
0034: BCF 03.5
0035: BTFSS 06.0
0036: GOTO 043
.................... {
.................... output_high(PIN_A3);
0037: BSF 03.5
0038: BCF 05.3
0039: BCF 03.5
003A: BSF 05.3
.................... delay_ms(500);
003B: MOVLW 02
003C: MOVWF 0F
003D: MOVLW FA
003E: MOVWF 10
003F: GOTO 004
0040: DECFSZ 0F,F
0041: GOTO 03D
.................... }
.................... else output_low(PIN_A3);
0042: GOTO 047
0043: BSF 03.5
0044: BCF 05.3
0045: BCF 03.5
0046: BCF 05.3
.................... }
0047: GOTO 032
.................... }
....................
0048: SLEEP
/programy/PIC_C/mereni/piezo_cidlo/piezo.PJT
0,0 → 1,32
[PROJECT]
Target=piezo.HEX
Development_Mode=
Processor=0x6C84
ToolSuite=CCS
 
[Directories]
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr
Library=
LinkerScript=
 
[Target Data]
FileList=piezo.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[piezo.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=piezo.c
 
[Windows]
0=0000 piezo.c 0 0 796 451 3 0
 
/programy/PIC_C/mereni/piezo_cidlo/piezo.SYM
0,0 → 1,14
00C @SCRATCH
00D @SCRATCH
00D _RETURN_
00F main.@SCRATCH
010 delay_ms.P1
delay_us.P1
 
0004 delay_ms
0019 main
 
Project Files:
d:\@kaklik\programy\pic_c\cidlo\piezo.c
D:\@Kaklik\programy\PIC_C\cidlo\piezo.h
C:\PROGRAM FILES\PICC\devices\16C84.h
/programy/PIC_C/mereni/piezo_cidlo/piezo.c
0,0 → 1,18
#include "D:\@Kaklik\programy\PIC_C\cidlo\piezo.h"
 
 
void main()
{
port_b_pullups(false);
setup_counters(RTCC_INTERNAL,WDT_18MS);
 
while (true)
{
if (input(PIN_B0))
{
output_high(PIN_A3);
delay_ms(500);
}
else output_low(PIN_A3);
}
}
/programy/PIC_C/mereni/piezo_cidlo/piezo.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/PIC_C/mereni/piezo_cidlo/piezo.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/piezo_cidlo/piezo.h
0,0 → 1,4
#include <16C84.h>
#use delay(clock=4000000)
#fuses HS,WDT
 
/programy/PIC_C/mereni/piezo_cidlo/piezo.sta
0,0 → 1,28
 
ROM used: 73 (7%)
951 (93%) including unused fragments
 
1 Average locations per line
8 Average locations per statement
 
RAM used: 3 (8%) at main() level
4 (11%) worst case
 
Lines Stmts % Files
----- ----- --- -----
19 9 100 d:\@kaklik\programy\pic_c\cidlo\piezo.c
5 0 0 D:\@Kaklik\programy\PIC_C\cidlo\piezo.h
111 0 0 C:\PROGRAM FILES\PICC\devices\16C84.h
----- -----
270 18 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 29 1 delay_ms
0 48 66 1 main
 
Segment Used Free
--------- ---- ----
0000-0003 4 0
0004-03FF 69 951
 
/programy/PIC_C/mereni/piezo_cidlo/piezo.tre
0,0 → 1,4
ÀÄpiezo
ÀÄmain 0/48 Ram=1
ÃÄ??0??
ÀÄdelay_ms 0/21 Ram=1
/programy/PIC_C/mereni/piezo_cidlo/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
/programy/PIC_C/mereni/serva/PIC16F84/main.BAK
0,0 → 1,80
#include "D:\@Kaklik\programy\PIC_C\mereni\serva\main.h"
#DEFINE servo1 PIN_A4
#DEFINE servo2 PIN_A3
#DEFINE servo3 PIN_A2
#DEFINE servo4 PIN_A0
#DEFINE SW PIN_A1
 
void main()
{
int i;
 
while(true)
{
While(input(SW))
{
output_high(servo1);
Delay_us(1500);
output_low(servo1);
output_high(servo2);
Delay_us(1500);
output_low(servo2);
output_high(servo3);
Delay_us(1500);
output_low(servo3);
output_high(servo4);
Delay_us(1500);
output_low(servo4);
Delay_ms(10);
}
While(!input(SW))
{
for(i=0; i<100; ++i)
{
output_high(servo1);
Delay_us(1000);
output_low(servo1);
output_high(servo2);
Delay_us(1000);
output_low(servo2);
output_high(servo3);
Delay_us(1000);
output_low(servo3);
output_high(servo4);
Delay_us(1000);
output_low(servo4);
Delay_ms(10);
}
for(i=0; i<100; ++i)
{
output_high(servo1);
Delay_us(2000);
output_low(servo1);
output_high(servo2);
Delay_us(2000);
output_low(servo2);
output_high(servo3);
Delay_us(2000);
output_low(servo3);
output_high(servo4);
Delay_us(2000);
output_low(servo4);
Delay_ms(10);
}
}
}
}
/programy/PIC_C/mereni/serva/PIC16F84/main.HEX
0,0 → 1,33
:1000000000308A00272800001030840000080319FF
:10001000182801308D008C018C0B0C288D0B0B28BF
:100020004A308C008C0B122800000000800B09283D
:10003000003411308400FC308005800C800C0008F6
:100040000319262824280000800B2328003484016B
:100050001F308305831685148312851C7B28831625
:100060000512831205160130900004200230900022
:10007000EC3091001920900B38288316051283125A
:100080000512831685118312851501309000042016
:1000900002309000EC3091001920900B4A28831612
:1000A0008511831285118316051183120515013000
:1000B0009000042002309000EC3091001920900B49
:1000C0005C2883160511831205118316051083120F
:1000D000051401309000042002309000EC309100B3
:1000E0001920900B6E2883160510831205100A3014
:1000F000900004202A288316851483128518ED2881
:100100008F010F08633C031CB62883160512831267
:100110000516013090000420831605128312051283
:1001200083168511831285150130900004208316F3
:10013000851183128511831605118312051501306F
:1001400090000420831605118312051183160510F3
:1001500083120514013090000420831605108312C9
:1001600005100A30900004208F0A81288F010F08A3
:10017000633C031CEC28831605128312051602301B
:100180009000042083160512831205128316851130
:100190008312851502309000042083168511831286
:1001A0008511831605118312051502309000042075
:1001B0008316051183120511831605108312051489
:1001C00002309000042083160510831205100A30B7
:0E01D000900004208F0AB7287B282A2863009D
:02400E00F93F78
:00000001FF
;PIC16F84
/programy/PIC_C/mereni/serva/PIC16F84/main.LST
0,0 → 1,340
CCS PCW C Compiler, Version 3.110, 15448
 
Filename: d:\@kaklik\programy\pic_c\mereni\serva\main.LST
 
ROM used: 239 (23%)
Largest free fragment is 785
RAM used: 4 (6%) at main() level
5 (7%) worst case
Stack: 1 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 027
0003: NOP
.................... #include "D:\@Kaklik\programy\PIC_C\mereni\serva\main.h"
.................... #include <16F84.h>
.................... //////// Standard Header file for the PIC16F84 device ////////////////
.................... #device PIC16F84
.................... #list
....................
.................... #use delay(clock=4000000)
0004: MOVLW 10
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
0019: MOVLW 11
001A: MOVWF 04
001B: MOVLW FC
001C: ANDWF 00,F
001D: RRF 00,F
001E: RRF 00,F
001F: MOVF 00,W
0020: BTFSC 03.2
0021: GOTO 026
0022: GOTO 024
0023: NOP
0024: DECFSZ 00,F
0025: GOTO 023
0026: RETLW 00
.................... #fuses XT,NOWDT
....................
....................
.................... #DEFINE servo1 PIN_A4
.................... #DEFINE servo2 PIN_A3
.................... #DEFINE servo3 PIN_A2
.................... #DEFINE servo4 PIN_A0
.................... #DEFINE SW PIN_A1
....................
.................... void main()
.................... {
.................... int i;
0027: CLRF 04
0028: MOVLW 1F
0029: ANDWF 03,F
....................
.................... while(true)
.................... {
.................... While(input(SW))
002A: BSF 03.5
002B: BSF 05.1
002C: BCF 03.5
002D: BTFSS 05.1
002E: GOTO 07B
.................... {
.................... output_high(servo1);
002F: BSF 03.5
0030: BCF 05.4
0031: BCF 03.5
0032: BSF 05.4
.................... Delay_us(1500);
0033: MOVLW 01
0034: MOVWF 10
0035: CALL 004
0036: MOVLW 02
0037: MOVWF 10
0038: MOVLW EC
0039: MOVWF 11
003A: CALL 019
003B: DECFSZ 10,F
003C: GOTO 038
.................... output_low(servo1);
003D: BSF 03.5
003E: BCF 05.4
003F: BCF 03.5
0040: BCF 05.4
....................
.................... output_high(servo2);
0041: BSF 03.5
0042: BCF 05.3
0043: BCF 03.5
0044: BSF 05.3
.................... Delay_us(1500);
0045: MOVLW 01
0046: MOVWF 10
0047: CALL 004
0048: MOVLW 02
0049: MOVWF 10
004A: MOVLW EC
004B: MOVWF 11
004C: CALL 019
004D: DECFSZ 10,F
004E: GOTO 04A
.................... output_low(servo2);
004F: BSF 03.5
0050: BCF 05.3
0051: BCF 03.5
0052: BCF 05.3
....................
.................... output_high(servo3);
0053: BSF 03.5
0054: BCF 05.2
0055: BCF 03.5
0056: BSF 05.2
.................... Delay_us(1500);
0057: MOVLW 01
0058: MOVWF 10
0059: CALL 004
005A: MOVLW 02
005B: MOVWF 10
005C: MOVLW EC
005D: MOVWF 11
005E: CALL 019
005F: DECFSZ 10,F
0060: GOTO 05C
.................... output_low(servo3);
0061: BSF 03.5
0062: BCF 05.2
0063: BCF 03.5
0064: BCF 05.2
....................
.................... output_high(servo4);
0065: BSF 03.5
0066: BCF 05.0
0067: BCF 03.5
0068: BSF 05.0
.................... Delay_us(1500);
0069: MOVLW 01
006A: MOVWF 10
006B: CALL 004
006C: MOVLW 02
006D: MOVWF 10
006E: MOVLW EC
006F: MOVWF 11
0070: CALL 019
0071: DECFSZ 10,F
0072: GOTO 06E
.................... output_low(servo4);
0073: BSF 03.5
0074: BCF 05.0
0075: BCF 03.5
0076: BCF 05.0
....................
.................... Delay_ms(10);
0077: MOVLW 0A
0078: MOVWF 10
0079: CALL 004
.................... }
007A: GOTO 02A
....................
.................... While(!input(SW))
007B: BSF 03.5
007C: BSF 05.1
007D: BCF 03.5
007E: BTFSC 05.1
007F: GOTO 0ED
.................... {
.................... for(i=0; i<100; ++i)
0080: CLRF 0F
0081: MOVF 0F,W
0082: SUBLW 63
0083: BTFSS 03.0
0084: GOTO 0B6
.................... {
.................... output_high(servo1);
0085: BSF 03.5
0086: BCF 05.4
0087: BCF 03.5
0088: BSF 05.4
.................... Delay_us(1000);
0089: MOVLW 01
008A: MOVWF 10
008B: CALL 004
.................... output_low(servo1);
008C: BSF 03.5
008D: BCF 05.4
008E: BCF 03.5
008F: BCF 05.4
....................
.................... output_high(servo2);
0090: BSF 03.5
0091: BCF 05.3
0092: BCF 03.5
0093: BSF 05.3
.................... Delay_us(1000);
0094: MOVLW 01
0095: MOVWF 10
0096: CALL 004
.................... output_low(servo2);
0097: BSF 03.5
0098: BCF 05.3
0099: BCF 03.5
009A: BCF 05.3
....................
.................... output_high(servo3);
009B: BSF 03.5
009C: BCF 05.2
009D: BCF 03.5
009E: BSF 05.2
.................... Delay_us(1000);
009F: MOVLW 01
00A0: MOVWF 10
00A1: CALL 004
.................... output_low(servo3);
00A2: BSF 03.5
00A3: BCF 05.2
00A4: BCF 03.5
00A5: BCF 05.2
....................
.................... output_high(servo4);
00A6: BSF 03.5
00A7: BCF 05.0
00A8: BCF 03.5
00A9: BSF 05.0
.................... Delay_us(1000);
00AA: MOVLW 01
00AB: MOVWF 10
00AC: CALL 004
.................... output_low(servo4);
00AD: BSF 03.5
00AE: BCF 05.0
00AF: BCF 03.5
00B0: BCF 05.0
....................
.................... Delay_ms(10);
00B1: MOVLW 0A
00B2: MOVWF 10
00B3: CALL 004
.................... }
00B4: INCF 0F,F
00B5: GOTO 081
....................
.................... for(i=0; i<100; ++i)
00B6: CLRF 0F
00B7: MOVF 0F,W
00B8: SUBLW 63
00B9: BTFSS 03.0
00BA: GOTO 0EC
.................... {
.................... output_high(servo1);
00BB: BSF 03.5
00BC: BCF 05.4
00BD: BCF 03.5
00BE: BSF 05.4
.................... Delay_us(2000);
00BF: MOVLW 02
00C0: MOVWF 10
00C1: CALL 004
.................... output_low(servo1);
00C2: BSF 03.5
00C3: BCF 05.4
00C4: BCF 03.5
00C5: BCF 05.4
....................
.................... output_high(servo2);
00C6: BSF 03.5
00C7: BCF 05.3
00C8: BCF 03.5
00C9: BSF 05.3
.................... Delay_us(2000);
00CA: MOVLW 02
00CB: MOVWF 10
00CC: CALL 004
.................... output_low(servo2);
00CD: BSF 03.5
00CE: BCF 05.3
00CF: BCF 03.5
00D0: BCF 05.3
....................
.................... output_high(servo3);
00D1: BSF 03.5
00D2: BCF 05.2
00D3: BCF 03.5
00D4: BSF 05.2
.................... Delay_us(2000);
00D5: MOVLW 02
00D6: MOVWF 10
00D7: CALL 004
.................... output_low(servo3);
00D8: BSF 03.5
00D9: BCF 05.2
00DA: BCF 03.5
00DB: BCF 05.2
....................
.................... output_high(servo4);
00DC: BSF 03.5
00DD: BCF 05.0
00DE: BCF 03.5
00DF: BSF 05.0
.................... Delay_us(2000);
00E0: MOVLW 02
00E1: MOVWF 10
00E2: CALL 004
.................... output_low(servo4);
00E3: BSF 03.5
00E4: BCF 05.0
00E5: BCF 03.5
00E6: BCF 05.0
....................
.................... Delay_ms(10);
00E7: MOVLW 0A
00E8: MOVWF 10
00E9: CALL 004
.................... }
00EA: INCF 0F,F
00EB: GOTO 0B7
.................... }
00EC: GOTO 07B
.................... }
00ED: GOTO 02A
.................... }
....................
00EE: SLEEP
/programy/PIC_C/mereni/serva/PIC16F84/main.PJT
0,0 → 1,35
[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
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F84\main.c
2=
/programy/PIC_C/mereni/serva/PIC16F84/main.SYM
0,0 → 1,16
00C @SCRATCH
00D @SCRATCH
00D _RETURN_
00F main.i
010 delay_ms.P1
010 main.@SCRATCH
011 delay_us.P1
 
0004 delay_ms
0019 delay_us
0027 main
 
Project Files:
d:\@kaklik\programy\pic_c\mereni\serva\main.c
D:\@Kaklik\programy\PIC_C\mereni\serva\main.h
C:\PROGRAM FILES\PICC\devices\16F84.h
/programy/PIC_C/mereni/serva/PIC16F84/main.c
0,0 → 1,81
#include "D:\@Kaklik\programy\PIC_C\mereni\serva\main.h"
#DEFINE servo1 PIN_A4
#DEFINE servo2 PIN_A3
#DEFINE servo3 PIN_A2
#DEFINE servo4 PIN_A0
#DEFINE SW PIN_A1
 
void main()
{
int i;
 
 
while(true)
{
While(input(SW))
{
output_high(servo1);
Delay_us(1500);
output_low(servo1);
output_high(servo2);
Delay_us(1500);
output_low(servo2);
output_high(servo3);
Delay_us(1500);
output_low(servo3);
output_high(servo4);
Delay_us(1500);
output_low(servo4);
Delay_ms(10);
}
While(!input(SW))
{
for(i=0; i<100; ++i)
{
output_high(servo1);
Delay_us(1000);
output_low(servo1);
output_high(servo2);
Delay_us(1000);
output_low(servo2);
output_high(servo3);
Delay_us(1000);
output_low(servo3);
output_high(servo4);
Delay_us(1000);
output_low(servo4);
Delay_ms(10);
}
for(i=0; i<100; ++i)
{
output_high(servo1);
Delay_us(2000);
output_low(servo1);
output_high(servo2);
Delay_us(2000);
output_low(servo2);
output_high(servo3);
Delay_us(2000);
output_low(servo3);
output_high(servo4);
Delay_us(2000);
output_low(servo4);
Delay_ms(10);
}
}
}
}
/programy/PIC_C/mereni/serva/PIC16F84/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/PIC_C/mereni/serva/PIC16F84/main.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/serva/PIC16F84/main.h
0,0 → 1,4
#include <16F84.h>
#use delay(clock=4000000)
#fuses XT,NOWDT
 
/programy/PIC_C/mereni/serva/PIC16F84/main.sta
0,0 → 1,29
 
ROM used: 239 (23%)
785 (77%) including unused fragments
 
1 Average locations per line
5 Average locations per statement
 
RAM used: 4 (6%) at main() level
5 (7%) worst case
 
Lines Stmts % Files
----- ----- --- -----
81 49 100 d:\@kaklik\programy\pic_c\mereni\serva\main.c
5 0 0 D:\@Kaklik\programy\PIC_C\mereni\serva\main.h
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h
----- -----
394 98 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 9 1 delay_ms
0 14 6 1 delay_us
0 200 84 2 main
 
Segment Used Free
--------- ---- ----
0000-0003 4 0
0004-03FF 235 785
 
/programy/PIC_C/mereni/serva/PIC16F84/main.tre
0,0 → 1,22
ÀÄmain
ÀÄmain 0/200 Ram=2
ÃÄ??0??
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_us 0/14 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_us 0/14 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_us 0/14 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_us 0/14 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÀÄdelay_ms 0/21 Ram=1
/programy/PIC_C/mereni/serva/PIC16F84/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/PIC_C/mereni/serva/PIC16F84/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
/programy/PIC_C/mereni/serva/PIC16F88/tester.BAK
0,0 → 1,93
#include "D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h"
 
#DEFINE servo1 PIN_A4
#DEFINE servo2 PIN_A3
#DEFINE servo3 PIN_A2
#DEFINE servo4 PIN_A0
#DEFINE SW PIN_A1
 
void main()
{
int i;
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
 
 
 
while(true)
{
While(input(SW))
{
output_high(servo1);
Delay_us(1500);
output_low(servo1);
output_high(servo2);
Delay_us(1500);
output_low(servo2);
output_high(servo3);
Delay_us(1500);
output_low(servo3);
output_high(servo4);
Delay_us(1500);
output_low(servo4);
Delay_ms(10);
}
While(!input(SW))
{
for(i=0; i<100; ++i)
{
output_high(servo1);
Delay_us(1000);
output_low(servo1);
output_high(servo2);
Delay_us(1000);
output_low(servo2);
output_high(servo3);
Delay_us(1000);
output_low(servo3);
output_high(servo4);
Delay_us(1000);
output_low(servo4);
Delay_ms(10);
}
for(i=0; i<100; ++i)
{
output_high(servo1);
Delay_us(2000);
output_low(servo1);
output_high(servo2);
Delay_us(2000);
output_low(servo2);
output_high(servo3);
Delay_us(2000);
output_low(servo3);
output_high(servo4);
Delay_us(2000);
output_low(servo4);
Delay_ms(10);
}
}
}
 
}
/programy/PIC_C/mereni/serva/PIC16F88/tester.HEX
0,0 → 1,41
:1000000000308A002C2800002230840000080319E8
:1000100018280130F800F701F70B0C28F80B0B2813
:100020004A30F700F70B122800000000800B092867
:1000300000341230A302031C2B2823308400FC3030
:1000400080050310800C800C000803192B28292838
:100050000000800B2828003484011F30830583169C
:100060001F129F121B0880399B0007309C001C0840
:1000700083120D13603083168F001F129F121B080E
:1000800080399B0083121F10941283160611861468
:100090000612003083129400831694000108C739B9
:1000A00008388100831290010030F800920000307F
:1000B0008316920007309C0005080330F700F70B09
:1000C0005F281C0883120D1383169D0106158312E9
:1000D000061DB82883168610831286140130A200EC
:1000E00004200230A200F730A3001920A20B7328CD
:1000F0008316861083128610831685118312851548
:100100000130A20004200230A200F730A300192021
:10011000A20B85288316851183128511831605117C
:10012000831205150130A20004200230A200F7302E
:10013000A3001920A20B972883160511831205111D
:1001400083160510831205140130A200042002302A
:10015000A200F730A3001920A20BA92883160510CE
:10016000831205100A30A200042083166628831229
:1001700083160615831206192A29A1012108633C5A
:10018000031CF32883168610831286140130A20004
:10019000042083168610831286108316851183121D
:1001A00085150130A2000420831685118312851164
:1001B00083160511831205150130A2000420831651
:1001C00005118312051183160510831205140130E1
:1001D000A200042083160510831205100A30A20025
:1001E0000420A10ABE28A1012108633C031C29297F
:1001F00083168610831286140230A2000420831610
:10020000861083128610831685118312851502309D
:10021000A20004208316851183128511831605110F
:10022000831205150230A2000420831605118312E3
:10023000051183160510831205140230A200042054
:1002400083160510831205100A30A2000420A10AAB
:0A025000F428B8288316662863001E
:04400E00F83FFF3F39
:00000001FF
;PIC16F88
/programy/PIC_C/mereni/serva/PIC16F88/tester.LST
0,0 → 1,420
CCS PCM C Compiler, Version 3.221, 27853 27-XI-05 00:06
 
Filename: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.LST
 
ROM used: 301 words (7%)
Largest free fragment is 2048
RAM used: 7 (4%) at main() level
8 (5%) worst case
Stack: 1 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 02C
0003: NOP
.................... #include "D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h"
.................... #include <16F88.h>
.................... //////// Standard Header file for the PIC16F88 device ////////////////
.................... #device PIC16F88
.................... #list
....................
.................... #device adc=8
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, BROWNOUT, LVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO
.................... #use delay(clock=4000000)
0004: MOVLW 22
0005: MOVWF 04
0006: MOVF 00,W
0007: BTFSC 03.2
0008: GOTO 018
0009: MOVLW 01
000A: MOVWF 78
000B: CLRF 77
000C: DECFSZ 77,F
000D: GOTO 00C
000E: DECFSZ 78,F
000F: GOTO 00B
0010: MOVLW 4A
0011: MOVWF 77
0012: DECFSZ 77,F
0013: GOTO 012
0014: NOP
0015: NOP
0016: DECFSZ 00,F
0017: GOTO 009
0018: RETLW 00
0019: MOVLW 12
001A: SUBWF 23,F
001B: BTFSS 03.0
001C: GOTO 02B
001D: MOVLW 23
001E: MOVWF 04
001F: MOVLW FC
0020: ANDWF 00,F
0021: BCF 03.0
0022: RRF 00,F
0023: RRF 00,F
0024: MOVF 00,W
0025: BTFSC 03.2
0026: GOTO 02B
0027: GOTO 029
0028: NOP
0029: DECFSZ 00,F
002A: GOTO 028
002B: RETLW 00
....................
....................
....................
.................... #DEFINE servo1 PIN_B1
.................... #DEFINE servo2 PIN_A3
.................... #DEFINE servo3 PIN_A2
.................... #DEFINE servo4 PIN_A0
.................... #DEFINE SW PIN_B2
....................
.................... void main()
.................... {
002C: CLRF 04
002D: MOVLW 1F
002E: ANDWF 03,F
002F: BSF 03.5
0030: BCF 1F.4
0031: BCF 1F.5
0032: MOVF 1B,W
0033: ANDLW 80
0034: MOVWF 1B
0035: MOVLW 07
0036: MOVWF 1C
0037: MOVF 1C,W
0038: BCF 03.5
0039: BCF 0D.6
003A: MOVLW 60
003B: BSF 03.5
003C: MOVWF 0F
.................... int i;
....................
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
003D: BCF 1F.4
003E: BCF 1F.5
003F: MOVF 1B,W
0040: ANDLW 80
0041: MOVWF 1B
.................... setup_adc(ADC_OFF);
0042: BCF 03.5
0043: BCF 1F.0
.................... setup_spi(FALSE);
0044: BCF 14.5
0045: BSF 03.5
0046: BCF 06.2
0047: BSF 06.1
0048: BCF 06.4
0049: MOVLW 00
004A: BCF 03.5
004B: MOVWF 14
004C: BSF 03.5
004D: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
004E: MOVF 01,W
004F: ANDLW C7
0050: IORLW 08
0051: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
0052: BCF 03.5
0053: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
0054: MOVLW 00
0055: MOVWF 78
0056: MOVWF 12
0057: MOVLW 00
0058: BSF 03.5
0059: MOVWF 12
.................... setup_comparator(NC_NC_NC_NC);
005A: MOVLW 07
005B: MOVWF 1C
005C: MOVF 05,W
005D: MOVLW 03
005E: MOVWF 77
005F: DECFSZ 77,F
0060: GOTO 05F
0061: MOVF 1C,W
0062: BCF 03.5
0063: BCF 0D.6
.................... setup_vref(FALSE);
0064: BSF 03.5
0065: CLRF 1D
....................
....................
....................
.................... while(true)
.................... {
.................... While(input(SW))
.................... {
0066: BSF 06.2
0067: BCF 03.5
0068: BTFSS 06.2
0069: GOTO 0B8
.................... output_high(servo1);
006A: BSF 03.5
006B: BCF 06.1
006C: BCF 03.5
006D: BSF 06.1
.................... Delay_us(1500);
006E: MOVLW 01
006F: MOVWF 22
0070: CALL 004
0071: MOVLW 02
0072: MOVWF 22
0073: MOVLW F7
0074: MOVWF 23
0075: CALL 019
0076: DECFSZ 22,F
0077: GOTO 073
.................... output_low(servo1);
0078: BSF 03.5
0079: BCF 06.1
007A: BCF 03.5
007B: BCF 06.1
....................
.................... output_high(servo2);
007C: BSF 03.5
007D: BCF 05.3
007E: BCF 03.5
007F: BSF 05.3
.................... Delay_us(1500);
0080: MOVLW 01
0081: MOVWF 22
0082: CALL 004
0083: MOVLW 02
0084: MOVWF 22
0085: MOVLW F7
0086: MOVWF 23
0087: CALL 019
0088: DECFSZ 22,F
0089: GOTO 085
.................... output_low(servo2);
008A: BSF 03.5
008B: BCF 05.3
008C: BCF 03.5
008D: BCF 05.3
....................
.................... output_high(servo3);
008E: BSF 03.5
008F: BCF 05.2
0090: BCF 03.5
0091: BSF 05.2
.................... Delay_us(1500);
0092: MOVLW 01
0093: MOVWF 22
0094: CALL 004
0095: MOVLW 02
0096: MOVWF 22
0097: MOVLW F7
0098: MOVWF 23
0099: CALL 019
009A: DECFSZ 22,F
009B: GOTO 097
.................... output_low(servo3);
009C: BSF 03.5
009D: BCF 05.2
009E: BCF 03.5
009F: BCF 05.2
....................
.................... output_high(servo4);
00A0: BSF 03.5
00A1: BCF 05.0
00A2: BCF 03.5
00A3: BSF 05.0
.................... Delay_us(1500);
00A4: MOVLW 01
00A5: MOVWF 22
00A6: CALL 004
00A7: MOVLW 02
00A8: MOVWF 22
00A9: MOVLW F7
00AA: MOVWF 23
00AB: CALL 019
00AC: DECFSZ 22,F
00AD: GOTO 0A9
.................... output_low(servo4);
00AE: BSF 03.5
00AF: BCF 05.0
00B0: BCF 03.5
00B1: BCF 05.0
....................
.................... Delay_ms(10);
00B2: MOVLW 0A
00B3: MOVWF 22
00B4: CALL 004
.................... }
00B5: BSF 03.5
00B6: GOTO 066
00B7: BCF 03.5
....................
.................... While(!input(SW))
.................... {
00B8: BSF 03.5
00B9: BSF 06.2
00BA: BCF 03.5
00BB: BTFSC 06.2
00BC: GOTO 12A
.................... for(i=0; i<100; ++i)
00BD: CLRF 21
00BE: MOVF 21,W
00BF: SUBLW 63
00C0: BTFSS 03.0
00C1: GOTO 0F3
.................... {
.................... output_high(servo1);
00C2: BSF 03.5
00C3: BCF 06.1
00C4: BCF 03.5
00C5: BSF 06.1
.................... Delay_us(1000);
00C6: MOVLW 01
00C7: MOVWF 22
00C8: CALL 004
.................... output_low(servo1);
00C9: BSF 03.5
00CA: BCF 06.1
00CB: BCF 03.5
00CC: BCF 06.1
....................
.................... output_high(servo2);
00CD: BSF 03.5
00CE: BCF 05.3
00CF: BCF 03.5
00D0: BSF 05.3
.................... Delay_us(1000);
00D1: MOVLW 01
00D2: MOVWF 22
00D3: CALL 004
.................... output_low(servo2);
00D4: BSF 03.5
00D5: BCF 05.3
00D6: BCF 03.5
00D7: BCF 05.3
....................
.................... output_high(servo3);
00D8: BSF 03.5
00D9: BCF 05.2
00DA: BCF 03.5
00DB: BSF 05.2
.................... Delay_us(1000);
00DC: MOVLW 01
00DD: MOVWF 22
00DE: CALL 004
.................... output_low(servo3);
00DF: BSF 03.5
00E0: BCF 05.2
00E1: BCF 03.5
00E2: BCF 05.2
....................
.................... output_high(servo4);
00E3: BSF 03.5
00E4: BCF 05.0
00E5: BCF 03.5
00E6: BSF 05.0
.................... Delay_us(1000);
00E7: MOVLW 01
00E8: MOVWF 22
00E9: CALL 004
.................... output_low(servo4);
00EA: BSF 03.5
00EB: BCF 05.0
00EC: BCF 03.5
00ED: BCF 05.0
....................
.................... Delay_ms(10);
00EE: MOVLW 0A
00EF: MOVWF 22
00F0: CALL 004
.................... }
00F1: INCF 21,F
00F2: GOTO 0BE
....................
.................... for(i=0; i<100; ++i)
00F3: CLRF 21
00F4: MOVF 21,W
00F5: SUBLW 63
00F6: BTFSS 03.0
00F7: GOTO 129
.................... {
.................... output_high(servo1);
00F8: BSF 03.5
00F9: BCF 06.1
00FA: BCF 03.5
00FB: BSF 06.1
.................... Delay_us(2000);
00FC: MOVLW 02
00FD: MOVWF 22
00FE: CALL 004
.................... output_low(servo1);
00FF: BSF 03.5
0100: BCF 06.1
0101: BCF 03.5
0102: BCF 06.1
....................
.................... output_high(servo2);
0103: BSF 03.5
0104: BCF 05.3
0105: BCF 03.5
0106: BSF 05.3
.................... Delay_us(2000);
0107: MOVLW 02
0108: MOVWF 22
0109: CALL 004
.................... output_low(servo2);
010A: BSF 03.5
010B: BCF 05.3
010C: BCF 03.5
010D: BCF 05.3
....................
.................... output_high(servo3);
010E: BSF 03.5
010F: BCF 05.2
0110: BCF 03.5
0111: BSF 05.2
.................... Delay_us(2000);
0112: MOVLW 02
0113: MOVWF 22
0114: CALL 004
.................... output_low(servo3);
0115: BSF 03.5
0116: BCF 05.2
0117: BCF 03.5
0118: BCF 05.2
....................
.................... output_high(servo4);
0119: BSF 03.5
011A: BCF 05.0
011B: BCF 03.5
011C: BSF 05.0
.................... Delay_us(2000);
011D: MOVLW 02
011E: MOVWF 22
011F: CALL 004
.................... output_low(servo4);
0120: BSF 03.5
0121: BCF 05.0
0122: BCF 03.5
0123: BCF 05.0
....................
.................... Delay_ms(10);
0124: MOVLW 0A
0125: MOVWF 22
0126: CALL 004
.................... }
0127: INCF 21,F
0128: GOTO 0F4
.................... }
0129: GOTO 0B8
.................... }
012A: BSF 03.5
012B: GOTO 066
....................
.................... }
....................
012C: SLEEP
 
Configuration Fuses:
Word 1: 3FF8 NOWDT NOPUT MCLR BROWNOUT LVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT INTRC_IO
Word 2: 3FFF FCMEN IESO
/programy/PIC_C/mereni/serva/PIC16F88/tester.PJT
0,0 → 1,35
[PROJECT]
Target=tester.HEX
Development_Mode=
Processor=0x688F
ToolSuite=CCS
 
[Directories]
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\dr
Library=
LinkerScript=
 
[Target Data]
FileList=tester.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[tester.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=tester.c
 
[Windows]
0=0000 tester.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.c
2=
/programy/PIC_C/mereni/serva/PIC16F88/tester.SYM
0,0 → 1,41
015 CCP_1_LOW
015-016 CCP_1
016 CCP_1_HIGH
021 main.i
022 @delay_ms1.P1
022 main.@SCRATCH
023 @delay_us1.P1
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
079 @SCRATCH
07A @SCRATCH
07B @SCRATCH
09C.6 C1OUT
09C.7 C2OUT
 
0004 @delay_ms1
0019 @delay_us1
002C main
002C @cinit
 
Project Files:
D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.c
D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h
C:\Program Files\PICC\devices\16F88.h
 
Compiler Settings:
Processor: PIC16F88
Pointer Size: 8
ADC Range: 0-255
Opt Level: 9
Short,Int,Long: 1,8,16
 
Output Files:
Errors: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.err
INHX8: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.HEX
Symbols: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.SYM
List: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.LST
Debug/COFF: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.cof
Call Tree: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.tre
Statistics: D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.sta
/programy/PIC_C/mereni/serva/PIC16F88/tester.c
0,0 → 1,93
#include "D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h"
 
#DEFINE servo1 PIN_B1
#DEFINE servo2 PIN_A3
#DEFINE servo3 PIN_A2
#DEFINE servo4 PIN_A0
#DEFINE SW PIN_B2
 
void main()
{
int i;
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
 
 
 
while(true)
{
While(input(SW))
{
output_high(servo1);
Delay_us(1500);
output_low(servo1);
output_high(servo2);
Delay_us(1500);
output_low(servo2);
output_high(servo3);
Delay_us(1500);
output_low(servo3);
output_high(servo4);
Delay_us(1500);
output_low(servo4);
Delay_ms(10);
}
While(!input(SW))
{
for(i=0; i<100; ++i)
{
output_high(servo1);
Delay_us(1000);
output_low(servo1);
output_high(servo2);
Delay_us(1000);
output_low(servo2);
output_high(servo3);
Delay_us(1000);
output_low(servo3);
output_high(servo4);
Delay_us(1000);
output_low(servo4);
Delay_ms(10);
}
for(i=0; i<100; ++i)
{
output_high(servo1);
Delay_us(2000);
output_low(servo1);
output_high(servo2);
Delay_us(2000);
output_low(servo2);
output_high(servo3);
Delay_us(2000);
output_low(servo3);
output_high(servo4);
Delay_us(2000);
output_low(servo4);
Delay_ms(10);
}
}
}
 
}
/programy/PIC_C/mereni/serva/PIC16F88/tester.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/PIC_C/mereni/serva/PIC16F88/tester.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/serva/PIC16F88/tester.h
0,0 → 1,5
#include <16F88.h>
#device adc=8
#fuses NOWDT,INTRC_IO, NOPUT, MCLR, BROWNOUT, LVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, FCMEN, IESO
#use delay(clock=4000000)
 
/programy/PIC_C/mereni/serva/PIC16F88/tester.sta
0,0 → 1,30
 
ROM used: 301 (7%)
301 (7%) including unused fragments
 
1 Average locations per line
5 Average locations per statement
 
RAM used: 7 (4%) at main() level
8 (5%) worst case
 
Lines Stmts % Files
----- ----- --- -----
94 57 100 D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.c
6 0 0 D:\KAKLIK\programy\PIC_C\mereni\serva\PIC16F88\tester.h
275 0 0 C:\Program Files\PICC\devices\16F88.h
----- -----
750 114 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 7 1 @delay_ms1
0 19 6 1 @delay_us1
0 257 85 2 main
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-007FF 297 1747
00800-00FFF 0 2048
 
/programy/PIC_C/mereni/serva/PIC16F88/tester.tre
0,0 → 1,22
ÀÄtester
ÀÄmain 0/257 Ram=2
ÃÄ??0??
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_us1 0/19 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_us1 0/19 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_us1 0/19 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_us1 0/19 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÃÄ@delay_ms1 0/21 Ram=1
ÀÄ@delay_ms1 0/21 Ram=1
/programy/PIC_C/mereni/tester serv/PRG.BAT
0,0 → 1,10
@echo off
picpgr reset PIC16F84
picpgr erase PIC16F84
pause
rem cls
picpgr program blikac.hex hex PIC16f84 LP_ON PWRTE_ON WDTE_OFF CP_OFF
picpgr run
pause
picpgr stop
pause
/programy/PIC_C/mereni/tester serv/Run.BAT
0,0 → 1,6
@echo off
picpgr reset PIC16F873
picpgr run lpt2
pause
picpgr stop lpt2
pause
/programy/PIC_C/mereni/tester serv/ble
--- tester serv/blikac.BAK (nonexistent)
+++ tester serv/blikac.BAK (revision 6)
@@ -0,0 +1,40 @@
+#include "D:\@Kaklik\programy\PIC_C\prenos\blikac.h"
+#DEFINE SERVO_X PIN_A2 // piny na ktere jsou pripojena serva
+#DEFINE SERVO_Y PIN_B0
+#DEFINE TL1 PIN_B1
+
+void main()
+{
+ int i;
+ while (true)
+ {
+ while(input(TL1))
+ {
+ for(i=0;i<=100;i++)
+ {
+ output_high(servo_y);
+ output_high(servo_x);
+ delay_us(1000);
+ output_low(servo_y);
+ output_low(servo_x);
+ delay_ms(20);
+ }
+
+ for(i=0;i<=100;i++)
+ {
+ output_high(servo_y);
+ output_high(servo_x);
+ delay_us(20`00);
+ output_low(servo_y);
+ output_low(servo_x);
+ delay_ms(20);
+ }
+ }
+ output_high(servo_y);
+ output_high(servo_x);
+ delay_us(1500);
+ output_low(servo_y);
+ output_low(servo_x);
+ delay_ms(20);
+ }
+}
/programy/PIC_C/mereni/tester serv/blikac.HEX
0,0 → 1,21
:1000000000308A00272800001030840000080319FF
:10001000182801308D008C018C0B0C288D0B0B28BF
:100020004A308C008C0B122800000000800B09283D
:10003000003411308400FC308005800C800C0008F6
:100040000319262824280000800B23287A288401FD
:100050001F308305831686148312861C6A288F013D
:100060000F08643C031C4C288316061083120614E8
:1000700083160511831205150130900004208316A4
:100080000610831206108316051183120511143011
:10009000900004208F0A30288F010F08643C031C55
:1000A000692883160610831206148316051183121D
:1000B00005150230900004208316061083120610E6
:1000C00083160511831205111430900004208F0A45
:1000D0004D282A288316061083120614831605114C
:1000E0008312051501309000042002309000EC309E
:1000F00091001928900B772883160610831206109A
:1001000083160511831205111430900004202A284B
:0201100063008A
:02400E00F93F78
:00000001FF
;PIC16C84
/programy/PIC_C/mereni/tester serv/blikac.LST
0,0 → 1,198
CCS PCW C Compiler, Version 3.110, 15448
 
Filename: d:\@kaklik\programy\pic_c\prenos\blikac.LST
 
ROM used: 137 (13%)
Largest free fragment is 887
RAM used: 4 (11%) at main() level
5 (14%) worst case
Stack: 1 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 027
0003: NOP
.................... #include "D:\@Kaklik\programy\PIC_C\prenos\blikac.h"
.................... #include <16C84.h>
.................... //////// Standard Header file for the PIC16C84 device ////////////////
.................... #device PIC16C84
.................... #list
....................
.................... #use delay(clock=4000000)
0004: MOVLW 10
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
0019: MOVLW 11
001A: MOVWF 04
001B: MOVLW FC
001C: ANDWF 00,F
001D: RRF 00,F
001E: RRF 00,F
001F: MOVF 00,W
0020: BTFSC 03.2
0021: GOTO 026
0022: GOTO 024
0023: NOP
0024: DECFSZ 00,F
0025: GOTO 023
0026: GOTO 07A (RETURN)
.................... #fuses XT,PUT,NOWDT
....................
....................
.................... #DEFINE SERVO_X PIN_A2 // piny na ktere jsou pripojena serva
.................... #DEFINE SERVO_Y PIN_B0
.................... #DEFINE TL1 PIN_B1
....................
.................... void main()
.................... {
.................... int i;
0027: CLRF 04
0028: MOVLW 1F
0029: ANDWF 03,F
.................... while (true)
.................... {
.................... while(input(TL1))
002A: BSF 03.5
002B: BSF 06.1
002C: BCF 03.5
002D: BTFSS 06.1
002E: GOTO 06A
.................... {
.................... for(i=0;i<=100;i++)
002F: CLRF 0F
0030: MOVF 0F,W
0031: SUBLW 64
0032: BTFSS 03.0
0033: GOTO 04C
.................... {
.................... output_high(servo_y);
0034: BSF 03.5
0035: BCF 06.0
0036: BCF 03.5
0037: BSF 06.0
.................... output_high(servo_x);
0038: BSF 03.5
0039: BCF 05.2
003A: BCF 03.5
003B: BSF 05.2
.................... delay_us(1000);
003C: MOVLW 01
003D: MOVWF 10
003E: CALL 004
.................... output_low(servo_y);
003F: BSF 03.5
0040: BCF 06.0
0041: BCF 03.5
0042: BCF 06.0
.................... output_low(servo_x);
0043: BSF 03.5
0044: BCF 05.2
0045: BCF 03.5
0046: BCF 05.2
.................... delay_ms(20);
0047: MOVLW 14
0048: MOVWF 10
0049: CALL 004
.................... }
004A: INCF 0F,F
004B: GOTO 030
....................
.................... for(i=0;i<=100;i++)
004C: CLRF 0F
004D: MOVF 0F,W
004E: SUBLW 64
004F: BTFSS 03.0
0050: GOTO 069
.................... {
.................... output_high(servo_y);
0051: BSF 03.5
0052: BCF 06.0
0053: BCF 03.5
0054: BSF 06.0
.................... output_high(servo_x);
0055: BSF 03.5
0056: BCF 05.2
0057: BCF 03.5
0058: BSF 05.2
.................... delay_us(2000);
0059: MOVLW 02
005A: MOVWF 10
005B: CALL 004
.................... output_low(servo_y);
005C: BSF 03.5
005D: BCF 06.0
005E: BCF 03.5
005F: BCF 06.0
.................... output_low(servo_x);
0060: BSF 03.5
0061: BCF 05.2
0062: BCF 03.5
0063: BCF 05.2
.................... delay_ms(20);
0064: MOVLW 14
0065: MOVWF 10
0066: CALL 004
.................... }
0067: INCF 0F,F
0068: GOTO 04D
.................... }
0069: GOTO 02A
.................... output_high(servo_y);
006A: BSF 03.5
006B: BCF 06.0
006C: BCF 03.5
006D: BSF 06.0
.................... output_high(servo_x);
006E: BSF 03.5
006F: BCF 05.2
0070: BCF 03.5
0071: BSF 05.2
.................... delay_us(1500);
0072: MOVLW 01
0073: MOVWF 10
0074: CALL 004
0075: MOVLW 02
0076: MOVWF 10
0077: MOVLW EC
0078: MOVWF 11
0079: GOTO 019
007A: DECFSZ 10,F
007B: GOTO 077
.................... output_low(servo_y);
007C: BSF 03.5
007D: BCF 06.0
007E: BCF 03.5
007F: BCF 06.0
.................... output_low(servo_x);
0080: BSF 03.5
0081: BCF 05.2
0082: BCF 03.5
0083: BCF 05.2
.................... delay_ms(20);
0084: MOVLW 14
0085: MOVWF 10
0086: CALL 004
.................... }
0087: GOTO 02A
.................... }
....................
0088: SLEEP
/programy/PIC_C/mereni/tester serv/blikac.PJT
0,0 → 1,32
[PROJECT]
Target=blikac.HEX
Development_Mode=
Processor=0x6C84
ToolSuite=CCS
 
[Directories]
Include=C:\PROGRAM FILES\PICC\devices\;C:\PROGRAM FILES\PICC\dr
Library=
LinkerScript=
 
[Target Data]
FileList=blikac.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[blikac.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=blikac.c
 
[Windows]
0=0000 blikac.c 0 0 796 451 3 0
 
/programy/PIC_C/mereni/tester serv/blikac.SYM
0,0 → 1,16
00C @SCRATCH
00D @SCRATCH
00D _RETURN_
00F main.i
010 delay_ms.P1
010 main.@SCRATCH
011 delay_us.P1
 
0004 delay_ms
0019 delay_us
0027 main
 
Project Files:
d:\@kaklik\programy\pic_c\prenos\blikac.c
D:\@Kaklik\programy\PIC_C\prenos\blikac.h
C:\PROGRAM FILES\PICC\devices\16C84.h
/programy/PIC_C/mereni/tester serv/blikac.c
0,0 → 1,40
#include "D:\@Kaklik\programy\PIC_C\prenos\blikac.h"
#DEFINE SERVO_X PIN_A2 // piny na ktere jsou pripojena serva
#DEFINE SERVO_Y PIN_B0
#DEFINE TL1 PIN_B1
 
void main()
{
int i;
while (true)
{
while(input(TL1))
{
for(i=0;i<=100;i++)
{
output_high(servo_y);
output_high(servo_x);
delay_us(1000);
output_low(servo_y);
output_low(servo_x);
delay_ms(20);
}
 
for(i=0;i<=100;i++)
{
output_high(servo_y);
output_high(servo_x);
delay_us(2000);
output_low(servo_y);
output_low(servo_x);
delay_ms(20);
}
}
output_high(servo_y);
output_high(servo_x);
delay_us(1500);
output_low(servo_y);
output_low(servo_x);
delay_ms(20);
}
}
/programy/PIC_C/mereni/tester serv/blikac.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/PIC_C/mereni/tester serv/blikac.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/tester serv/blikac.h
0,0 → 1,4
#include <16C84.h>
#use delay(clock=4000000)
#fuses XT,PUT,NOWDT
 
/programy/PIC_C/mereni/tester serv/blikac.sta
0,0 → 1,29
 
ROM used: 137 (13%)
887 (87%) including unused fragments
 
1 Average locations per line
5 Average locations per statement
 
RAM used: 4 (11%) at main() level
5 (14%) worst case
 
Lines Stmts % Files
----- ----- --- -----
41 26 100 d:\@kaklik\programy\pic_c\prenos\blikac.c
5 0 0 D:\@Kaklik\programy\PIC_C\prenos\blikac.h
111 0 0 C:\PROGRAM FILES\PICC\devices\16C84.h
----- -----
314 52 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 15 1 delay_ms
0 14 10 1 delay_us
0 98 72 2 main
 
Segment Used Free
--------- ---- ----
0000-0003 4 0
0004-03FF 133 887
 
/programy/PIC_C/mereni/tester serv/blikac.tre
0,0 → 1,10
ÀÄblikac
ÀÄmain 0/98 Ram=2
ÃÄ??0??
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_ms 0/21 Ram=1
ÃÄdelay_us 0/14 Ram=1
ÀÄdelay_ms 0/21 Ram=1
/programy/PIC_C/mereni/tester serv/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
/programy/PIC_C/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/PIC_C/mereni/vyskomer_drak/main.HEX
0,0 → 1,10
:1000000000308A001928000012308400000803190B
:10001000182801308D008C018C0B0C288D0B0B28BF
:100020004A308C008C0B122800000000800B09283D
:10003000003484011F3083058316061183120615D0
:1000400083168614831286182D2883168511831231
:1000500085153230920004202028831685118312E2
:0C0060008511323092000420202863003B
:02400E00F93F78
:00000001FF
;PIC16F84
/programy/PIC_C/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/PIC_C/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/PIC_C/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/PIC_C/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/PIC_C/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/PIC_C/mereni/vyskomer_drak/main.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/vyskomer_drak/main.h
0,0 → 1,4
#include <16F84.h>
#use delay(clock=4000000)
#fuses XT,NOWDT
 
/programy/PIC_C/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/PIC_C/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/PIC_C/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/PIC_C/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/PIC_C/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/PIC_C/mereni/vyskomer_drak/run.bat
0,0 → 1,5
call picpgr run
pause
call picpgr stop
pause
run.bat
/programy/PIC_C/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
/programy/PIC_C/mereni/zavora/main.BAK
0,0 → 1,16
#include "D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h"
 
 
void main()
{
output_high(PIN_A3);
Delay_ms(250);
output_low(PIN_A3);
Delay_ms(250);
while(true)
{
if(input(PIN_A4)) output_high(PIN_A3);
else output_low(PIN_A3);
}
}
/programy/PIC_C/mereni/zavora/main.HEX
0,0 → 1,11
:1000000000308A00192800000F308400000803190E
:10001000182801308D008C018C0B0C288D0B0B28BF
:100020004A308C008C0B122800000000800B09283D
:10003000003484011F3083058316851183128515D2
:10004000FA308F0004208316851183128511FA304F
:100050008F000420831605168312051E342883168C
:100060008511831285113828831685118312851511
:040070002A286300D7
:02400E00F93F78
:00000001FF
;PIC16F84
/programy/PIC_C/mereni/zavora/main.LST
0,0 → 1,95
CCS PCW C Compiler, Version 3.110, 15448
 
Filename: d:\@kaklik\programy\pic_c\mereni\zavora\main.LST
 
ROM used: 58 (6%)
Largest free fragment is 966
RAM used: 2 (3%) at main() level
3 (4%) worst case
Stack: 1 locations
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 019
0003: NOP
.................... #include "D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h"
.................... #include <16F84.h>
.................... //////// Standard Header file for the PIC16F84 device ////////////////
.................... #device PIC16F84
.................... #list
....................
.................... #use delay(clock=4000000)
0004: MOVLW 0F
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
....................
....................
....................
....................
.................... void main()
.................... {
0019: CLRF 04
001A: MOVLW 1F
001B: ANDWF 03,F
.................... output_high(PIN_A3);
001C: BSF 03.5
001D: BCF 05.3
001E: BCF 03.5
001F: BSF 05.3
.................... Delay_ms(250);
0020: MOVLW FA
0021: MOVWF 0F
0022: CALL 004
.................... output_low(PIN_A3);
0023: BSF 03.5
0024: BCF 05.3
0025: BCF 03.5
0026: BCF 05.3
.................... Delay_ms(250);
0027: MOVLW FA
0028: MOVWF 0F
0029: CALL 004
....................
.................... while(true)
.................... {
.................... if(input(PIN_A4)) output_low(PIN_A3);
002A: BSF 03.5
002B: BSF 05.4
002C: BCF 03.5
002D: BTFSS 05.4
002E: GOTO 034
002F: BSF 03.5
0030: BCF 05.3
0031: BCF 03.5
0032: BCF 05.3
.................... else output_high(PIN_A3);
0033: GOTO 038
0034: BSF 03.5
0035: BCF 05.3
0036: BCF 03.5
0037: BSF 05.3
.................... }
0038: GOTO 02A
.................... }
....................
0039: SLEEP
/programy/PIC_C/mereni/zavora/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/PIC_C/mereni/zavora/main.SYM
0,0 → 1,13
00C @SCRATCH
00D @SCRATCH
00D _RETURN_
00F delay_ms.P1
delay_us.P1
 
0004 delay_ms
0019 main
 
Project Files:
d:\@kaklik\programy\pic_c\mereni\zavora\main.c
D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h
C:\PROGRAM FILES\PICC\devices\16F84.h
/programy/PIC_C/mereni/zavora/main.c
0,0 → 1,16
#include "D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h"
 
 
void main()
{
output_high(PIN_A3);
Delay_ms(250);
output_low(PIN_A3);
Delay_ms(250);
while(true)
{
if(input(PIN_A4)) output_low(PIN_A3);
else output_high(PIN_A3);
}
}
/programy/PIC_C/mereni/zavora/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/PIC_C/mereni/zavora/main.err
0,0 → 1,0
No Errors
/programy/PIC_C/mereni/zavora/main.h
0,0 → 1,4
#include <16F84.h>
#use delay(clock=4000000)
#fuses XT,NOWDT
 
/programy/PIC_C/mereni/zavora/main.sta
0,0 → 1,28
 
ROM used: 58 (6%)
966 (94%) including unused fragments
 
0 Average locations per line
6 Average locations per statement
 
RAM used: 2 (3%) at main() level
3 (4%) worst case
 
Lines Stmts % Files
----- ----- --- -----
17 9 100 d:\@kaklik\programy\pic_c\mereni\zavora\main.c
5 0 0 D:\@Kaklik\programy\PIC_C\mereni\zavora\main.h
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h
----- -----
266 18 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 21 36 1 delay_ms
0 33 57 0 main
 
Segment Used Free
--------- ---- ----
0000-0003 4 0
0004-03FF 54 966
 
/programy/PIC_C/mereni/zavora/main.tre
0,0 → 1,5
ÀÄmain
ÀÄmain 0/33 Ram=0
ÃÄ??0??
ÃÄdelay_ms 0/21 Ram=1
ÀÄdelay_ms 0/21 Ram=1
/programy/PIC_C/mereni/zavora/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/PIC_C/mereni/zavora/run.bat
0,0 → 1,5
call picpgr run
pause
call picpgr stop
pause
run.bat
/programy/PIC_C/mereni/zavora/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