/programy/PIC_C/test/PIC16F84A/blik/blik.BAK |
---|
0,0 → 1,9 |
#include "blik.h" |
void main() |
{ |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
} |
/programy/PIC_C/test/PIC16F84A/blik/blik.c |
---|
0,0 → 1,17 |
#include "blik.h" |
void main() |
{ |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
while(true) |
{ |
output_high(PIN_B0); |
Delay_ms(700); |
output_low(PIN_B0); |
Delay_ms(50); |
} |
} |
/programy/PIC_C/test/PIC16F84A/blik/blik.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/test/PIC16F84A/blik/blik.err |
---|
0,0 → 1,2 |
No Errors |
0 Errors, 0 Warnings. |
/programy/PIC_C/test/PIC16F84A/blik/blik.h |
---|
0,0 → 1,9 |
#include <16F84A.h> |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES XT //Crystal osc <= 4mhz |
#FUSES NOPUT //No Power Up Timer |
#FUSES NOPROTECT //Code not protected from reading |
#use delay(clock=4000000) |
/programy/PIC_C/test/PIC16F84A/blik/blik.hex |
---|
0,0 → 1,10 |
:1000000000308A001928000010308400000803190D |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003484011F30830583160108C73908384E |
:10004000810006108312061404308F00AF30900038 |
:1000500004208F0B262883160610831206103230D8 |
:0A006000900004208316212863009D |
:02400E00F93F78 |
:00000001FF |
;PIC16F84A |
/programy/PIC_C/test/PIC16F84A/blik/blik.lst |
---|
0,0 → 1,98 |
CCS PCM C Compiler, Version 3.245, 27853 05-XI-06 21:34 |
Filename: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.lst |
ROM used: 53 words (5%) |
Largest free fragment is 971 |
RAM used: 3 (4%) at main() level |
4 (6%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 019 |
0003: NOP |
.................... #include "blik.h" |
.................... #include <16F84A.h> |
.................... //////// Standard Header file for the PIC16F84A device //////////////// |
.................... #device PIC16F84A |
.................... #list |
.................... |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES XT //Crystal osc <= 4mhz |
.................... #FUSES NOPUT //No Power Up Timer |
.................... #FUSES NOPROTECT //Code not protected from reading |
.................... |
.................... #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 |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
.................... |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
001C: BSF 03.5 |
001D: MOVF 01,W |
001E: ANDLW C7 |
001F: IORLW 08 |
0020: MOVWF 01 |
.................... |
.................... while(true) |
.................... { |
.................... output_high(PIN_B0); |
0021: BCF 06.0 |
0022: BCF 03.5 |
0023: BSF 06.0 |
.................... Delay_ms(700); |
0024: MOVLW 04 |
0025: MOVWF 0F |
0026: MOVLW AF |
0027: MOVWF 10 |
0028: CALL 004 |
0029: DECFSZ 0F,F |
002A: GOTO 026 |
.................... output_low(PIN_B0); |
002B: BSF 03.5 |
002C: BCF 06.0 |
002D: BCF 03.5 |
002E: BCF 06.0 |
.................... Delay_ms(50); |
002F: MOVLW 32 |
0030: MOVWF 10 |
0031: CALL 004 |
.................... } |
0032: BSF 03.5 |
0033: GOTO 021 |
.................... |
.................... } |
0034: SLEEP |
Configuration Fuses: |
Word 1: 3FF9 XT NOWDT NOPUT NOPROTECT |
/programy/PIC_C/test/PIC16F84A/blik/blik.sta |
---|
0,0 → 1,28 |
ROM used: 53 (5%) |
53 (5%) including unused fragments |
0 Average locations per line |
8 Average locations per statement |
RAM used: 3 (4%) at main() level |
4 (6%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
18 7 100 D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.c |
10 0 0 D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.h |
113 0 0 C:\Program Files\PICC\devices\16F84A.h |
----- ----- |
282 14 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 40 1 @delay_ms1 |
0 28 53 1 main |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-003FF 49 971 |
/programy/PIC_C/test/PIC16F84A/blik/blik.sym |
---|
0,0 → 1,32 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F main.@SCRATCH |
010 @delay_ms1.P1 |
0004 @delay_ms1 |
0019 main |
0019 @cinit |
Project Files: |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.c |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.h |
C:\Program Files\PICC\devices\16F84A.h |
Units: |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.c (main) |
Compiler Settings: |
Processor: PIC16F84A |
Pointer Size: 8 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
Output Files: |
Errors: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.err |
INHX8: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.hex |
Symbols: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.sym |
List: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.lst |
Debug/COFF: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.cof |
Call Tree: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.tre |
Statistics: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F84A\blik\blik.sta |
/programy/PIC_C/test/PIC16F84A/blik/blik.tre |
---|
0,0 → 1,5 |
ÀÄblik |
ÀÄmain 0/28 Ram=1 |
ÃÄ??0?? |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÀÄ@delay_ms1 0/21 Ram=1 |
/programy/PIC_C/test/PIC16F84A/blik/prg.bat |
---|
0,0 → 1,6 |
call picpgr stop LPT2 |
call picpgr erase pic16f84a LPT2 |
call picpgr program blik.hex hex pic16f84a LPT2 |
call picpgr run LPT2 |
pause |
call picpgr stop LPT2 |
/programy/PIC_C/test/PIC16F88/blik/blik.BAK |
---|
0,0 → 1,25 |
#include "blik.h" |
void main() |
{ |
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); |
setup_oscillator(False); |
while(true) // nekonecny cyklus |
{ |
output_high(PIN_B0); // nastav B0 na 1 |
Delay_ms(700); // pockej 700ms |
output_low(PIN_B0); //nastav B0 na 0 |
Delay_ms(50); // pockej 50ms |
} // opakuj cyklus |
} |
/programy/PIC_C/test/PIC16F88/blik/blik.c |
---|
0,0 → 1,25 |
#include "blik.h" |
void main() |
{ |
setup_adc_ports(NO_ANALOGS|VSS_VDD); // parametry |
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); |
setup_oscillator(False); |
while(true) // nekonecny cyklus |
{ |
output_high(PIN_B0); // nastav B0 na 1 |
Delay_ms(700); // pockej 700ms |
output_low(PIN_B0); //nastav B0 na 0 |
Delay_ms(50); // pockej 50ms |
} // opakuj cyklus |
} |
/programy/PIC_C/test/PIC16F88/blik/blik.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/test/PIC16F88/blik/blik.err |
---|
0,0 → 1,2 |
No Errors |
0 Errors, 0 Warnings. |
/programy/PIC_C/test/PIC16F88/blik/blik.h |
---|
0,0 → 1,18 |
#include <16F88.h> |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES XT //Crystal osc <= 4mhz |
#FUSES NOPUT //No Power Up Timer |
#FUSES NOMCLR //Master Clear pin used for I/O |
#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=4000000) |
/programy/PIC_C/test/PIC16F88/blik/blik.hex |
---|
0,0 → 1,16 |
:1000000000308A00192800002230840000080319FB |
:1000100018280130F800F701F70B0C28F80B0B2813 |
:100020004A30F700F70B122800000000800B092867 |
:10003000003484011F30830583161F129F121B0892 |
:1000400080399B0007309C001F129F121B088039CB |
:100050009B0083121F109412831606118614061239 |
:10006000003083129400831694000108C7390838C1 |
:100070008100831290010030F80092000030831656 |
:10008000920007309C0005080330F700F70B462864 |
:100090001C0883120D1383169D018F010F08061093 |
:1000A000831206140430A100AF30A2000420A10B7B |
:1000B000542883160610831206103230A200042042 |
:0600C00083164F286300C7 |
:04400E00093FFC3F2B |
:00000001FF |
;PIC16F88 |
/programy/PIC_C/test/PIC16F88/blik/blik.lst |
---|
0,0 → 1,162 |
CCS PCM C Compiler, Version 3.245, 27853 05-XI-06 22:19 |
Filename: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.lst |
ROM used: 99 words (2%) |
Largest free fragment is 2048 |
RAM used: 6 (3%) at main() level |
7 (4%) worst case |
Stack: 1 locations |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 019 |
0003: NOP |
.................... #include "blik.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... #device adc=8 |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES XT //Crystal osc <= 4mhz |
.................... #FUSES NOPUT //No Power Up Timer |
.................... #FUSES NOMCLR //Master Clear pin used for I/O |
.................... #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=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 |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
001C: BSF 03.5 |
001D: BCF 1F.4 |
001E: BCF 1F.5 |
001F: MOVF 1B,W |
0020: ANDLW 80 |
0021: MOVWF 1B |
0022: MOVLW 07 |
0023: MOVWF 1C |
.................... |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); // parametry |
0024: BCF 1F.4 |
0025: BCF 1F.5 |
0026: MOVF 1B,W |
0027: ANDLW 80 |
0028: MOVWF 1B |
.................... setup_adc(ADC_OFF); |
0029: BCF 03.5 |
002A: BCF 1F.0 |
.................... setup_spi(FALSE); |
002B: BCF 14.5 |
002C: BSF 03.5 |
002D: BCF 06.2 |
002E: BSF 06.1 |
002F: BCF 06.4 |
0030: MOVLW 00 |
0031: BCF 03.5 |
0032: MOVWF 14 |
0033: BSF 03.5 |
0034: MOVWF 14 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
0035: MOVF 01,W |
0036: ANDLW C7 |
0037: IORLW 08 |
0038: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
0039: BCF 03.5 |
003A: CLRF 10 |
.................... setup_timer_2(T2_DISABLED,0,1); |
003B: MOVLW 00 |
003C: MOVWF 78 |
003D: MOVWF 12 |
003E: MOVLW 00 |
003F: BSF 03.5 |
0040: MOVWF 12 |
.................... setup_comparator(NC_NC_NC_NC); |
0041: MOVLW 07 |
0042: MOVWF 1C |
0043: MOVF 05,W |
0044: MOVLW 03 |
0045: MOVWF 77 |
0046: DECFSZ 77,F |
0047: GOTO 046 |
0048: MOVF 1C,W |
0049: BCF 03.5 |
004A: BCF 0D.6 |
.................... setup_vref(FALSE); |
004B: BSF 03.5 |
004C: CLRF 1D |
.................... setup_oscillator(False); |
004D: CLRF 0F |
004E: MOVF 0F,W |
.................... |
.................... while(true) // nekonecny cyklus |
.................... { |
.................... output_high(PIN_B0); // nastav B0 na 1 |
004F: BCF 06.0 |
0050: BCF 03.5 |
0051: BSF 06.0 |
.................... Delay_ms(700); // pockej 700ms |
0052: MOVLW 04 |
0053: MOVWF 21 |
0054: MOVLW AF |
0055: MOVWF 22 |
0056: CALL 004 |
0057: DECFSZ 21,F |
0058: GOTO 054 |
.................... output_low(PIN_B0); //nastav B0 na 0 |
0059: BSF 03.5 |
005A: BCF 06.0 |
005B: BCF 03.5 |
005C: BCF 06.0 |
.................... Delay_ms(50); // pockej 50ms |
005D: MOVLW 32 |
005E: MOVWF 22 |
005F: CALL 004 |
.................... } // opakuj cyklus |
0060: BSF 03.5 |
0061: GOTO 04F |
.................... |
.................... } |
0062: SLEEP |
Configuration Fuses: |
Word 1: 3F09 XT NOWDT NOPUT NOMCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT |
Word 2: 3FFC NOFCMEN NOIESO |
/programy/PIC_C/test/PIC16F88/blik/blik.sta |
---|
0,0 → 1,29 |
ROM used: 99 (2%) |
99 (2%) including unused fragments |
0 Average locations per line |
7 Average locations per statement |
RAM used: 6 (3%) at main() level |
7 (4%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
26 15 100 D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.c |
19 0 0 D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.h |
279 0 0 C:\Program Files\PICC\devices\16F88.h |
----- ----- |
648 30 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 21 1 @delay_ms1 |
0 74 75 1 main |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-007FF 95 1949 |
00800-00FFF 0 2048 |
/programy/PIC_C/test/PIC16F88/blik/blik.sym |
---|
0,0 → 1,41 |
015 CCP_1_LOW |
015-016 CCP_1 |
016 CCP_1_HIGH |
021 main.@SCRATCH |
022 @delay_ms1.P1 |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
0004 @delay_ms1 |
0019 main |
0019 @cinit |
Project Files: |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.c |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.h |
C:\Program Files\PICC\devices\16F88.h |
Units: |
D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.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\projekty\programy\PIC_C\test\PIC16F88\blik\blik.err |
INHX8: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.hex |
Symbols: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.sym |
List: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.lst |
Debug/COFF: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.cof |
Call Tree: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.tre |
Statistics: D:\KAKLIK\projekty\programy\PIC_C\test\PIC16F88\blik\blik.sta |
/programy/PIC_C/test/PIC16F88/blik/blik.tre |
---|
0,0 → 1,5 |
ÀÄblik |
ÀÄmain 0/74 Ram=1 |
ÃÄ??0?? |
ÃÄ@delay_ms1 0/21 Ram=1 |
ÀÄ@delay_ms1 0/21 Ram=1 |
/programy/PIC_C/test/PIC16F88/blik/prg.bat |
---|
0,0 → 1,6 |
call picpgr stop LPT2 |
call picpgr erase pic16f88 LPT2 |
call picpgr program blik.hex hex pic16f88 LPT2 |
call picpgr run LPT2 |
pause |
call picpgr stop LPT2 |
/programy/PIC_C/hack/hack.BAK |
---|
0,0 → 1,11 |
#include <16F88.h> |
#device *=16 |
#device ICD=TRUE |
#device adc=8 |
#fuses NOWDT,INTRC , NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
//#fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
#use delay(clock=4000000,RESTART_WDT) |
//#use rs232(baud=2400,xmit=PIN_B3) |
//#use rs232(DEBUGGER) |
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) |
/programy/PIC_C/hack/hack.HEX |
---|
0,0 → 1,202 |
:10000000000000308A00422BFF00030E8301A10094 |
:100010007F08A0000A08A8008A01A00E0408A20018 |
:100020007708A3007808A4007908A5007A08A6003C |
:100030007B08A700831383128C308400001C2228C5 |
:100040000C183B288C308400801C28288C183D28F4 |
:10005000220884002308F7002408F8002508F90086 |
:100060002608FA002708FB0028088A00210E8300D2 |
:10007000FF0E7F0E09008A11E0288A11E3280A107A |
:100080008A100A1182074834413443344B342034F7 |
:10009000763431342E343034003400340A108A106F |
:1000A0000A1182070A340D340A340D3425347334AE |
:1000B00000340A108A100A11820725344C34753432 |
:1000C0006534343420342B34203425344C347534A6 |
:1000D000203447344F3400340A108A100A11820742 |
:1000E00025344C3475346534343420342B34203486 |
:1000F00025344C347534203452344534503445342E |
:10010000413454342034253475340A340D340034E9 |
:100110000A108A100A11820725344C34753465346C |
:10012000343420342B34203425344C34753420348A |
:100130004834413443344B3400340A108A100A11D5 |
:10014000820725344C3475346534343420342B34F0 |
:10015000203425344C347534203474346934633499 |
:100160006B34733400340A108A100A118207253464 |
:100170004C347534203478342034313420347034A5 |
:10018000723465347334633461346C3465340034F0 |
:100190000A108A100A1182074534723472346F349F |
:1001A000723400340A108A100A11820725344C3444 |
:1001B000753420347434693463346B3473340034EC |
:1001C0000C108A1128288C108A11282842308400AB |
:1001D000831300080319FD280130F800BF30F70031 |
:1001E0006400F70BF028F80BEE284A30F700F70B05 |
:1001F000F72800006400800BEC2800348316861179 |
:10020000831286110830F800000000000000F81783 |
:100210001829F813CC0C03188615031C86117817BF |
:1002200018297813F80B0A29000000000000861531 |
:100230000130F7008401840B1B29F70B1A290D30BC |
:100240008400840B212900000000F81B0929781B79 |
:10025000112900340408F8000830F7008316061549 |
:100260008312061D352983163029C101F717482945 |
:10027000F7134829031006190314C10C77174829EE |
:100280007713F70B3A29780884004108F8005D29B4 |
:10029000013084000030F71B5530F800F80B4E2970 |
:1002A000840B4A290D30F71B0330F800F80B562950 |
:1002B000F71B3829771B40293A298A11C12BCB011A |
:1002C0000408CA004B10831B4B14440EF038C600C0 |
:1002D000C607E23EC700323EC90044080F39C707CF |
:1002E000C707C907E93EC800C807C807430E0F394A |
:1002F000C807C907C80DC90DC909C90D43080F3979 |
:10030000C907C60D0730C5000A30C907C803031C5A |
:100310008529C807C703031C8929C707C603031C0F |
:100320008D29C607C503031C91294530840083131A |
:1003300007304A058407493004020319C12900081F |
:10034000F700031DA9294A1ABF29CA19AB29203071 |
:10035000AC290830CA003030F707C4010408C300D4 |
:100360004410831B44147708C5007708CC00FE2096 |
:10037000430884008313441883174508F700840A50 |
:100380009B290008F7003030F7077708CC00FE20E3 |
:1003900000344708F80146020318D1294608F7003F |
:1003A000DD29F7010830C800C60DF70D47087702B0 |
:1003B0000318F700F80DC80BD42900344513C512F3 |
:1003C0004408C6006430C700C9217708C400780813 |
:1003D000031D082AC51A082AC519162A451BF6291D |
:1003E0004518F6294519F629C51B162A451C022A67 |
:1003F000C51B162A451B022A4518162A4519022A2A |
:10040000C51B162A2030451E3030CC00FE20162A8F |
:10041000C516C51F122A78088000F8002D30CC00C0 |
:10042000FE20C51330307807CC00FE20451B212A62 |
:100430004408C6000A30C700C9217708C400451720 |
:10044000E729C51F262A2D30CC00FE203030440776 |
:10045000CC00FE208A118F2C1030F700FA01CD015C |
:10046000CA0CC90C031C3A2A4B08FA070318CD0A18 |
:100470004C08CD07CD0CFA0CF90CF80CF70B302A10 |
:100480008A11B62AC701C5010A30C600C401C301DA |
:1004900041084204031D502A0030F800F900412BA6 |
:1004A0004708C70A410784008313421883170008CE |
:1004B000C80048082D3C031D692A0130C5004708C3 |
:1004C000C70A410784008313421883170008C80035 |
:1004D000762A48082B3C031D762A4708C70A41079D |
:1004E00084008313421883170008C80048082F3C73 |
:1004F0000318322B4808393C031C322B4808303C87 |
:10050000031DA22A4708410784008313421883175A |
:100510000008783C0319962A470841078400831392 |
:10052000421883170008583C031DA22A1030C60049 |
:10053000C70A4708C70A4107840083134218831774 |
:100540000008C80046080A3C031DC92A48082F3C79 |
:100550000318C82A4808393C031CC82ACA010A30B3 |
:10056000C9004408CC004308CB002C2A3030480294 |
:100570007807C3007908C4000318C40A4708C70AEB |
:10058000410784008313421883170008C800A62A75 |
:10059000322B4608103C031D322B4808603C0318E0 |
:1005A000D82A48087A3C031CD82A4808DF39D92AB7 |
:1005B0004808C80048082F3C0318E22A4808393C7C |
:1005C0000318EA2A4808403C0318322B4808463CE6 |
:1005D000031C322B48082F3C0318072B4808393CD2 |
:1005E000031C072B430DC900440DCA00C90DCA0DD9 |
:1005F000C90DCA0DC90DCA0DF030C9053030480209 |
:100600004907C3004A08C4000318C40A1C2B430D41 |
:10061000C900440DCA00C90DCA0DC90DCA0DC90DC6 |
:10062000CA0DF030C905413048020A3E4907C300EF |
:100630004A08C4000318C40A4708C70A41078400CF |
:100640008313421883170008C800603C03182F2B3F |
:1006500048087A3C031C2F2B4808DF39302B480808 |
:10066000C800DA2A46080A3C031D3D2B450B3D2BEA |
:10067000C309C409C30A0319C40A4308F80044089B |
:10068000F9000034840183131F30830583161F1281 |
:100690009F121B0880399B0007309C0005086400EE |
:1006A0001C0883120D13603083168F00861183128D |
:1006B0008615A901AA010130AB00AC01AD01AE0164 |
:1006C00083161F129F121B0880399B0083121F1074 |
:1006D00094128316061186140612003083129400B9 |
:1006E000831694000108C7392838810087308312A7 |
:1006F00090000030F800920000308316920007301E |
:100700009C00050864000230F700F70B852B000001 |
:1007100000001C0883120D1383169D0162308F00A8 |
:1007200064308312C200E620C10141084E20C10A94 |
:10073000F700CC00FE2004304102031D952BC201BE |
:1007400042083F2000380319A92BC20ACC00FE2022 |
:10075000A02B8316061283120612831686128312AA |
:100760008612BF010130BE00BD01BC010A30CC00C1 |
:10077000FE200D30CC00FE203E30CC00FE20C0011B |
:100780002A297808B1003108CC00FE204008C00AB0 |
:10079000323E840083133108800031080D3C031978 |
:1007A000D52B4008093C0318C02B32304007840089 |
:1007B000831380010A30CC00FE200D30CC00FE20D7 |
:1007C0003208673A0319F12B153A0319602C1A3ACB |
:1007D0000319E92C013A0319712D193A0319A82DAF |
:1007E000EB2D103084003D08C4003C08C3005F219D |
:1007F0000330C10041085920C10AF700CC00FE2097 |
:1008000008304102031DFA2B103084003F08C40059 |
:100810003E08C3005F212030CC00FE204730CC00D2 |
:10082000FE204F30CC00FE20B001AF0130083D0269 |
:10083000031C3C2C031D202C3C082F0203183C2CCD |
:100840008F018E010F08FA000E08F7000F087A02D8 |
:10085000031D222C7708C1007A08C2004208273CF9 |
:10086000031C382C031D222C41080F3C0318222C9A |
:10087000AF0A0319B00A162C8F018E010F08FA0077 |
:100880000E08F7000F087A02031D3E2C7708C100FE |
:100890007A08C20042083F02031C542C031D3E2C60 |
:1008A0003E084102031C3E2C8316061283120616D4 |
:1008B0000130C200E62083160612831206121A2E99 |
:1008C000C0014008C00AC100103084003D08C400C7 |
:1008D0003C08C3005F210330C20042086C20C20AFA |
:1008E000F700CC00FE2008304202031D6D2C1030B2 |
:1008F00084003F08C4003E08C3005F210B30C300E2 |
:1009000043086C20C30AF700CC00FE2013304302DA |
:10091000031D802C4108C4001830C500DE290A30B0 |
:10092000CC00FE200D30CC00FE20B001AF0130081D |
:100930003D02031CBD2C031DA12C3C082F020318F3 |
:10094000BD2C8F018E010F08FA000E08F7000F086A |
:100950007A02031DA32C7708C1007A08C20042085E |
:10096000273C031CB92C031DA32C41080F3C031882 |
:10097000A32CAF0A0319B00A972C8F018E010F0820 |
:10098000FA000E08F7000F087A02031DBF2C770843 |
:10099000C1007A08C20042083F02031CD52C031D87 |
:1009A000BF2C3E084102031CBF2C83160612831283 |
:1009B00006161430C200E6208316061283120612B1 |
:1009C0000830C100FA30C200E620C10BE22C612CD5 |
:1009D0001A2E103084003D08C4003C08C3005F217B |
:1009E0000330C10041088820C10AF700CC00FE2076 |
:1009F00008304102031DF22C103084003F08C4006F |
:100A00003E08C3005F210B30C20042088820C20AA2 |
:100A1000F700CC00FE2010304202031D052DB0016E |
:100A2000AF0130083D02031C372D031D1B2D3C0870 |
:100A30002F020318372D8F018E010F08FA000E08C0 |
:100A4000F7000F087A02031D1D2D7708C1007A08F0 |
:100A5000C2004208273C031C332D031D1D2D4108F5 |
:100A60000F3C03181D2DAF0A0319B00A112D8F0179 |
:100A70008E010F08FA000E08F7000F087A02031D16 |
:100A8000392D7708C1007A08C20042083F02031CD2 |
:100A90004F2D031D392D3E084102031C392D8316AD |
:100AA00006128312061683160613831206130A30E3 |
:100AB000C200E62083168612831286162830C100F3 |
:100AC000FA30C200E620C10B602D83168612831215 |
:100AD00086128316061283120612831606178312D5 |
:100AE0001A2EC10141083F20003803197B2DC10A8D |
:100AF000CC00FE20722D0A30CC00FE200D30CC0040 |
:100B0000FE20103084003D08C4003C08C3005F2173 |
:100B10000330C10041089D20C10AF700CC00FE202F |
:100B200008304102031D8A2D103084003F08C400A4 |
:100B30003E08C3005F210B30C20042089D20C20A5C |
:100B4000F700CC00FE2011304202031D9D2D1A2E0D |
:100B500033082F3C0318DF2D3308393C031CDF2DED |
:100B6000C2013330C10042227908BD007808BC00C0 |
:100B7000103084003D08C4003C08C3005F210330EE |
:100B8000C1004108B320C10AF700CC00FE200730A5 |
:100B90004102031DC12D0430C2003030CC00FE20C4 |
:100BA000C20BCD2D0730C3004308B320C30AF700A2 |
:100BB000CC00FE2010304302031DD42DEA2DC101CC |
:100BC0004108C820C10AF700CC00FE2005304102D0 |
:100BD000031DE02D1A2E32082F3C03180F2E320869 |
:100BE000393C031C0F2EC2013230C1004222790869 |
:100BF000BF007808BE00103084003F08C4003E08E3 |
:100C0000C3005F210330C1004108D220C10AF700B0 |
:100C1000CC00FE2009304102031D042E1A2EC10112 |
:100C20004108C820C10AF700CC00FE20053041026F |
:100C3000031D102EB62B83160612831206120230E5 |
:100C4000C1009630C200E620C10B212E8316061289 |
:100C5000831206160230C1009630C200E620C10B96 |
:060C60002C2E1B2E322E8B |
:04400E003137FC3F0B |
:00000001FF |
;PIC16F88 |
/programy/PIC_C/hack/hack.LST |
---|
0,0 → 1,2662 |
CCS PCM C Compiler, Version 3.221, 27853 12-III-06 16:36 |
Filename: D:\KAKLIK\programy\PIC_C\hack\hack.LST |
ROM used: 1587 words (41%) |
Largest free fragment is 1792 |
RAM used: 41 (11%) at main() level |
51 (14%) worst case |
Stack: 3 worst case (2 in main + 1 for interrupts) |
* |
0000: NOP |
0001: MOVLW 00 |
0002: MOVWF 0A |
0003: GOTO 342 |
0004: MOVWF 7F |
0005: SWAPF 03,W |
0006: CLRF 03 |
0007: MOVWF 21 |
0008: MOVF 7F,W |
0009: MOVWF 20 |
000A: MOVF 0A,W |
000B: MOVWF 28 |
000C: CLRF 0A |
000D: SWAPF 20,F |
000E: MOVF 04,W |
000F: MOVWF 22 |
0010: MOVF 77,W |
0011: MOVWF 23 |
0012: MOVF 78,W |
0013: MOVWF 24 |
0014: MOVF 79,W |
0015: MOVWF 25 |
0016: MOVF 7A,W |
0017: MOVWF 26 |
0018: MOVF 7B,W |
0019: MOVWF 27 |
001A: BCF 03.7 |
001B: BCF 03.5 |
001C: MOVLW 8C |
001D: MOVWF 04 |
001E: BTFSS 00.0 |
001F: GOTO 022 |
0020: BTFSC 0C.0 |
0021: GOTO 03B |
0022: MOVLW 8C |
0023: MOVWF 04 |
0024: BTFSS 00.1 |
0025: GOTO 028 |
0026: BTFSC 0C.1 |
0027: GOTO 03D |
0028: MOVF 22,W |
0029: MOVWF 04 |
002A: MOVF 23,W |
002B: MOVWF 77 |
002C: MOVF 24,W |
002D: MOVWF 78 |
002E: MOVF 25,W |
002F: MOVWF 79 |
0030: MOVF 26,W |
0031: MOVWF 7A |
0032: MOVF 27,W |
0033: MOVWF 7B |
0034: MOVF 28,W |
0035: MOVWF 0A |
0036: SWAPF 21,W |
0037: MOVWF 03 |
0038: SWAPF 7F,F |
0039: SWAPF 7F,W |
003A: RETFIE |
003B: BCF 0A.3 |
003C: GOTO 0E0 |
003D: BCF 0A.3 |
003E: GOTO 0E3 |
.................... #include ".\hack.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... #device *=16 |
.................... #device ICD=TRUE |
.................... #device adc=8 |
.................... #fuses NOWDT,INTRC , NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
.................... //#fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
.................... #use delay(clock=4000000,RESTART_WDT) |
* |
00E6: MOVLW 42 |
00E7: MOVWF 04 |
00E8: BCF 03.7 |
00E9: MOVF 00,W |
00EA: BTFSC 03.2 |
00EB: GOTO 0FD |
00EC: MOVLW 01 |
00ED: MOVWF 78 |
00EE: MOVLW BF |
00EF: MOVWF 77 |
00F0: CLRWDT |
00F1: DECFSZ 77,F |
00F2: GOTO 0F0 |
00F3: DECFSZ 78,F |
00F4: GOTO 0EE |
00F5: MOVLW 4A |
00F6: MOVWF 77 |
00F7: DECFSZ 77,F |
00F8: GOTO 0F7 |
00F9: NOP |
00FA: CLRWDT |
00FB: DECFSZ 00,F |
00FC: GOTO 0EC |
00FD: RETLW 00 |
.................... //#use rs232(baud=2400,xmit=PIN_B3) |
.................... //#use rs232(DEBUGGER) |
.................... #use rs232(baud=1200,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) |
00FE: BSF 03.5 |
00FF: BCF 06.3 |
0100: BCF 03.5 |
0101: BCF 06.3 |
0102: MOVLW 08 |
0103: MOVWF 78 |
0104: NOP |
0105: NOP |
0106: NOP |
0107: BSF 78.7 |
0108: GOTO 118 |
0109: BCF 78.7 |
010A: RRF 4C,F |
010B: BTFSC 03.0 |
010C: BSF 06.3 |
010D: BTFSS 03.0 |
010E: BCF 06.3 |
010F: BSF 78.6 |
0110: GOTO 118 |
0111: BCF 78.6 |
0112: DECFSZ 78,F |
0113: GOTO 10A |
0114: NOP |
0115: NOP |
0116: NOP |
0117: BSF 06.3 |
0118: MOVLW 01 |
0119: MOVWF 77 |
011A: CLRF 04 |
011B: DECFSZ 04,F |
011C: GOTO 11B |
011D: DECFSZ 77,F |
011E: GOTO 11A |
011F: MOVLW 0D |
0120: MOVWF 04 |
0121: DECFSZ 04,F |
0122: GOTO 121 |
0123: NOP |
0124: NOP |
0125: BTFSC 78.7 |
0126: GOTO 109 |
0127: BTFSC 78.6 |
0128: GOTO 111 |
0129: RETLW 00 |
012A: MOVF 04,W |
012B: MOVWF 78 |
012C: MOVLW 08 |
012D: MOVWF 77 |
012E: BSF 03.5 |
012F: BSF 06.2 |
0130: BCF 03.5 |
0131: BTFSS 06.2 |
0132: GOTO 135 |
0133: BSF 03.5 |
0134: GOTO 130 |
0135: CLRF 41 |
0136: BSF 77.7 |
0137: GOTO 148 |
0138: BCF 77.7 |
0139: GOTO 148 |
013A: BCF 03.0 |
013B: BTFSC 06.2 |
013C: BSF 03.0 |
013D: RRF 41,F |
013E: BSF 77.6 |
013F: GOTO 148 |
0140: BCF 77.6 |
0141: DECFSZ 77,F |
0142: GOTO 13A |
0143: MOVF 78,W |
0144: MOVWF 04 |
0145: MOVF 41,W |
0146: MOVWF 78 |
0147: GOTO 15D |
0148: MOVLW 01 |
0149: MOVWF 04 |
014A: MOVLW 00 |
014B: BTFSC 77.7 |
014C: MOVLW 55 |
014D: MOVWF 78 |
014E: DECFSZ 78,F |
014F: GOTO 14E |
0150: DECFSZ 04,F |
0151: GOTO 14A |
0152: MOVLW 0D |
0153: BTFSC 77.7 |
0154: MOVLW 03 |
0155: MOVWF 78 |
0156: DECFSZ 78,F |
0157: GOTO 156 |
0158: BTFSC 77.7 |
0159: GOTO 138 |
015A: BTFSC 77.6 |
015B: GOTO 140 |
015C: GOTO 13A |
015D: BCF 0A.3 |
015E: GOTO 3C1 (RETURN) |
.................... |
.................... |
.................... #include <stdlib.h> |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STDLIB |
.................... #define _STDLIB |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Definitions and types |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... #ifndef RAND_MAX |
.................... #define RAND_MAX 32767 // The value of which is the maximum value |
.................... // ... returned by the rand function |
.................... #endif |
.................... |
.................... typedef struct { |
.................... signed int quot; |
.................... signed int rem; |
.................... } div_t; |
.................... |
.................... typedef struct { |
.................... signed long quot; |
.................... signed long rem; |
.................... } ldiv_t; |
.................... |
.................... #include <stddef.h> |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STDDEF |
.................... |
.................... #define _STDDEF |
.................... |
.................... #if sizeof(int *)==1 |
.................... #define ptrdiff_t int |
.................... #else |
.................... #define ptrdiff_t long |
.................... #endif |
.................... |
.................... #define size_t int |
.................... #define wchar_t char |
.................... #define NULL 0 |
.................... |
.................... #define offsetof(s,f) (offsetofbit(s,f)/8) |
.................... |
.................... #endif |
.................... |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // String conversion functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... /* Standard template: float atof(char * s) |
.................... * converts the initial portion of the string s to a float. |
.................... * returns the converted value if any, 0 otherwise |
.................... */ |
.................... float atof(char * s); |
.................... |
.................... /* Standard template: signed int atoi(char * s) |
.................... * converts the initial portion of the string s to a signed int |
.................... * returns the converted value if any, 0 otherwise |
.................... */ |
.................... signed int atoi(char *s); |
.................... |
.................... /* Syntax: signed int32 atoi32(char * s) |
.................... converts the initial portion of the string s to a signed int32 |
.................... returns the converted value if any, 0 otherwise*/ |
.................... signed int32 atoi32(char *s); |
.................... |
.................... /* Standard template: signed long atol(char * s) |
.................... * converts the initial portion of the string s to a signed long |
.................... * returns the converted value if any, 0 otherwise |
.................... */ |
.................... signed long atol(char *s); |
.................... |
.................... /* Standard template: float strtol(char * s,char *endptr) |
.................... * converts the initial portion of the string s to a float |
.................... * returns the converted value if any, 0 otherwise |
.................... * the final string is returned in the endptr, if endptr is not null |
.................... */ |
.................... float strtod(char *s,char *endptr); |
.................... |
.................... /* Standard template: long strtoul(char * s,char *endptr,signed int base) |
.................... * converts the initial portion of the string s, represented as an |
.................... * integral value of radix base to a signed long. |
.................... * Returns the converted value if any, 0 otherwise |
.................... * the final string is returned in the endptr, if endptr is not null |
.................... */ |
.................... signed long strtol(char *s,char *endptr,signed int base); |
.................... |
.................... /* Standard template: long strtoul(char * s,char *endptr,signed int base) |
.................... * converts the initial portion of the string s, represented as an |
.................... * integral value of radix base to a unsigned long. |
.................... * returns the converted value if any, 0 otherwise |
.................... * the final string is returned in the endptr, if endptr is not null |
.................... */ |
.................... long strtoul(char *s,char *endptr,signed int base); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Pseudo-random sequence generation functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... /* The rand function computes a sequence of pseudo-random integers in |
.................... * the range 0 to RAND_MAX |
.................... * |
.................... * Parameters: |
.................... * (none) |
.................... * |
.................... * Returns: |
.................... * The pseudo-random integer |
.................... */ |
.................... long rand(void); |
.................... |
.................... /* The srand function uses the argument as a seed for a new sequence of |
.................... * pseudo-random numbers to be returned by subsequent calls to rand. |
.................... * |
.................... * Parameters: |
.................... * [in] seed: The seed value to start from. You might need to pass |
.................... * |
.................... * Returns: |
.................... * (none) |
.................... * |
.................... * Remarks |
.................... * The srand function sets the starting point for generating |
.................... * a series of pseudorandom integers. To reinitialize the |
.................... * generator, use 1 as the seed argument. Any other value for |
.................... * seed sets the generator to a random starting point. rand |
.................... * retrieves the pseudorandom numbers that are generated. |
.................... * Calling rand before any call to srand generates the same |
.................... * sequence as calling srand with seed passed as 1. |
.................... * Usually, you need to pass a time here from outer source |
.................... * so that the numbers will be different every time you run. |
.................... */ |
.................... void srand(unsigned int32 seed); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Memory management functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... // Comming soon |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Communication with the environment |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... /* The function returns 0 always |
.................... */ |
.................... signed int system(char *string); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Searching and sorting utilities |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... /* Performs a binary search of a sorted array.. |
.................... * |
.................... * Parameters: |
.................... * [in] key: Object to search for |
.................... * [in] base: Pointer to base of search data |
.................... * [in] num: Number of elements |
.................... * [in] width: Width of elements |
.................... * [in] compare: Function that compares two elements |
.................... * |
.................... * Returns: |
.................... * bsearch returns a pointer to an occurrence of key in the array pointed |
.................... * to by base. If key is not found, the function returns NULL. If the |
.................... * array is not in order or contains duplicate records with identical keys, |
.................... * the result is unpredictable. |
.................... */ |
.................... //void *bsearch(const void *key, const void *base, size_t num, size_t width, |
.................... // int (*compare)(const void *, const void *)); |
.................... |
.................... /* Performs the shell-metzner sort (not the quick sort algorithm). The contents |
.................... * of the array are sorted into ascending order according to a comparison |
.................... * function pointed to by compar. |
.................... * |
.................... * Parameters: |
.................... * [in] base: Pointer to base of search data |
.................... * [in] num: Number of elements |
.................... * [in] width: Width of elements |
.................... * [in] compare: Function that compares two elements |
.................... * |
.................... * Returns: |
.................... * (none) |
.................... */ |
.................... //void *qsort(const void *base, size_t num, size_t width, |
.................... // int (*compare)(const void *, const void *)); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Integer arithmetic functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... #define labs abs |
.................... |
.................... div_t div(signed int numer,signed int denom); |
.................... ldiv_t ldiv(signed long numer,signed long denom); |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Multibyte character functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... // Not supported |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Multibyte string functions |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... // Not supported |
.................... |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Internal implementation |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... #include <stddef.h> |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STDDEF |
.................... |
.................... #define _STDDEF |
.................... |
.................... #if sizeof(int *)==1 |
.................... #define ptrdiff_t int |
.................... #else |
.................... #define ptrdiff_t long |
.................... #endif |
.................... |
.................... #define size_t int |
.................... #define wchar_t char |
.................... #define NULL 0 |
.................... |
.................... #define offsetof(s,f) (offsetofbit(s,f)/8) |
.................... |
.................... #endif |
.................... |
.................... #include <string.h> |
.................... //////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... //////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STRING |
.................... #define _STRING |
.................... #include <stddef.h> |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... /////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _STDDEF |
.................... |
.................... #define _STDDEF |
.................... |
.................... #if sizeof(int *)==1 |
.................... #define ptrdiff_t int |
.................... #else |
.................... #define ptrdiff_t long |
.................... #endif |
.................... |
.................... #define size_t int |
.................... #define wchar_t char |
.................... #define NULL 0 |
.................... |
.................... #define offsetof(s,f) (offsetofbit(s,f)/8) |
.................... |
.................... #endif |
.................... |
.................... #include <ctype.h> |
.................... //////////////////////////////////////////////////////////////////////////// |
.................... //// (C) Copyright 1996,2003 Custom Computer Services //// |
.................... //// This source code may only be used by licensed users of the CCS C //// |
.................... //// compiler. This source code may only be distributed to other //// |
.................... //// licensed users of the CCS C compiler. No other use, reproduction //// |
.................... //// or distribution is permitted without written permission. //// |
.................... //// Derivative programs created using this software in object code //// |
.................... //// form are not restricted in any way. //// |
.................... //////////////////////////////////////////////////////////////////////////// |
.................... |
.................... #ifndef _CTYPE |
.................... #define _CTYPE |
.................... |
.................... #define islower(x) isamong(x,"abcdefghijklmnopqrstuvwxyz") |
.................... #define isupper(x) isamong(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZ") |
.................... #define isalnum(x) isamong(x,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") |
.................... #define isalpha(x) isamong(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz") |
.................... #define isdigit(x) isamong(x,"0123456789") |
.................... #define isspace(x) (x==' ') |
.................... #define isxdigit(x) isamong(x,"0123456789ABCDEFabcdef") |
.................... #define iscntrl(x) (x<' ') |
.................... #define isprint(x) (x>=' ') |
.................... #define isgraph(x) (x>' ') |
.................... #define ispunct(x) ((x>' ')&&!isalnum(x)) |
.................... |
.................... #endif |
.................... |
.................... |
.................... |
.................... |
.................... |
.................... ////////////////////////////////////////////// |
.................... //// Uncomment the following define to //// |
.................... //// allow some functions to use a //// |
.................... //// quicker algorithm, but use more ROM //// |
.................... //// //// |
.................... //// #define FASTER_BUT_MORE_ROM //// |
.................... ////////////////////////////////////////////// |
.................... |
.................... |
.................... |
.................... /*Copying functions*/ |
.................... /* standard template: |
.................... void *memmove(void *s1, void *s2, size_t n). |
.................... Copies max of n characters safely (not following ending '\0') |
.................... from s2 in s1; if s2 has less than n characters, appends 0 */ |
.................... |
.................... char *memmove(void *s1,char *s2,size_t n) |
.................... { |
.................... char *sc1; |
.................... char *sc2; |
.................... sc1=s1; |
.................... sc2=s2; |
.................... if(sc2<sc1 && sc1 <sc2 +n) |
.................... for(sc1+=n,sc2+=n;0<n;--n) |
.................... *--sc1=*--sc2; |
.................... else |
.................... for(;0<n;--n) |
.................... *sc1++=*sc2++; |
.................... return s1; |
.................... } |
.................... |
.................... /* compiler ignored the name 'strcpy()'; perhaps, it's reserved? |
.................... Standard template: char *strcpy(char *s1, const char *s2) |
.................... copies the string s2 including the null character to s1*/ |
.................... |
.................... char *strcopy(char *s1, char *s2) |
.................... { |
.................... char *s; |
.................... |
.................... for (s = s1; *s2 != 0; s++, s2++) { |
.................... *s = *s2; |
.................... } |
.................... *s = *s2; |
.................... return(s1); |
.................... } |
.................... |
.................... /* standard template: |
.................... char *strncpy(char *s1, const char *s2, size_t n). |
.................... Copies max of n characters (not following ending '\0') |
.................... from s2 in s1; if s2 has less than n characters, appends 0 */ |
.................... |
.................... char *strncpy(char *s1, char *s2, size_t n) |
.................... { |
.................... char *s; |
.................... |
.................... for (s = s1; n > 0 && *s2 != '\0'; n--) |
.................... *s++ = *s2++; |
.................... for (; n > 0; n--) |
.................... *s++ = '\0'; |
.................... |
.................... return(s1); |
.................... } |
.................... /***********************************************************/ |
.................... |
.................... /*concatenation functions*/ |
.................... /* standard template: char *strcat(char *s1, const char *s2) |
.................... appends s2 to s1*/ |
.................... |
.................... char *strcat(char *s1, char *s2) |
.................... { |
.................... char *s; |
.................... |
.................... for (s = s1; *s != '\0'; ++s); |
.................... while(*s2 != '\0') |
.................... { |
.................... *s = *s2; |
.................... ++s; |
.................... ++s2; |
.................... } |
.................... |
.................... *s = '\0'; |
.................... return(s1); |
.................... } |
.................... /* standard template: char *strncat(char *s1, char *s2,size_t n) |
.................... appends not more than n characters from s2 to s1*/ |
.................... |
.................... char *strncat(char *s1, char *s2, size_t n) |
.................... { |
.................... char *s; |
.................... |
.................... for (s = s1; *s != '\0'; ++s); |
.................... while(*s2 != '\0' && 0<n) |
.................... { |
.................... *s = *s2; |
.................... ++s; |
.................... ++s2; |
.................... --n; |
.................... } |
.................... |
.................... *s = '\0'; |
.................... return(s1); |
.................... } |
.................... |
.................... /***********************************************************/ |
.................... |
.................... |
.................... /*comparison functions*/ |
.................... /* standard template: signed int memcmp(void *s1, void *s2). |
.................... Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */ |
.................... |
.................... signed int memcmp(void * s1,char *s2,size_t n) |
.................... { |
.................... char *su1, *su2; |
.................... for(su1=s1, su2=s2; 0<n; ++su1, ++su2, --n) |
.................... { |
.................... if(*su1!=*su2) |
.................... return ((*su1<*su2)?1:+1); |
.................... } |
.................... return 0; |
.................... } |
.................... |
.................... /* standard template: int strcmp(const char *s1, const char *s2). |
.................... Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */ |
.................... |
.................... signed int strcmp(char *s1, char *s2) |
.................... { |
.................... for (; *s1 == *s2; s1++, s2++) |
.................... if (*s1 == '\0') |
.................... return(0); |
.................... return((*s1 < *s2) ?-1: 1); |
.................... } |
.................... /* standard template: int strcoll(const char *s1, const char *s2). |
.................... Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */ |
.................... |
.................... signed int strcoll(char *s1, char *s2) |
.................... { |
.................... for (; *s1 == *s2; s1++, s2++) |
.................... if (*s1 == '\0') |
.................... return(0); |
.................... return((*s1 < *s2) ?-1: 1); |
.................... } |
.................... |
.................... /* standard template: |
.................... int strncmp(const char *s1, const char *s2, size_t n). |
.................... Compares max of n characters (not following 0) from s1 to s2; |
.................... returns same as strcmp */ |
.................... |
.................... signed int strncmp(char *s1, char *s2, size_t n) |
.................... { |
.................... for (; n > 0; s1++, s2++, n--) |
.................... if (*s1 != *s2) |
.................... return((*s1 <*s2) ?-1: 1); |
.................... else if (*s1 == '\0') |
.................... return(0); |
.................... return(0); |
.................... } |
.................... /* standard template: |
.................... int strxfrm(const char *s1, const char *s2, size_t n). |
.................... transforms maximum of n characters from s2 and places them into s1*/ |
.................... size_t strxfrm(char *s1, char *s2, size_t n) |
.................... { |
.................... char *s; |
.................... int n1; |
.................... n1=n; |
.................... for (s = s1; n > 0 && *s2 != '\0'; n--) |
.................... *s++ = *s2++; |
.................... for (; n > 0; n--) |
.................... *s++ = '\0'; |
.................... |
.................... return(n1); |
.................... } |
.................... |
.................... |
.................... |
.................... |
.................... |
.................... /***********************************************************/ |
.................... /*Search functions*/ |
.................... /* standard template: void *memchr(const char *s, int c). |
.................... Finds first occurrence of c in n characters of s */ |
.................... |
.................... char *memchr(void *s,int c,size_t n) |
.................... { |
.................... char uc; |
.................... char *su; |
.................... uc=c; |
.................... for(su=s;0<n;++su,--n) |
.................... if(*su==uc) |
.................... return su; |
.................... return NULL; |
.................... } |
.................... |
.................... /* standard template: char *strchr(const char *s, int c). |
.................... Finds first occurrence of c in s */ |
.................... |
.................... char *strchr(char *s, int c) |
.................... { |
.................... for (; *s != c; s++) |
.................... if (*s == '\0') |
.................... return(0); |
.................... return(s); |
.................... } |
.................... /* standard template: |
.................... size_t strcspn(const char *s1, const char *s2). |
.................... Computes length of max initial segment of s1 that |
.................... consists entirely of characters NOT from s2*/ |
.................... |
.................... int *strcspn(char *s1, char *s2) |
.................... { |
.................... char *sc1, *sc2; |
.................... |
.................... for (sc1 = s1; *sc1 != 0; sc1++) |
.................... for (sc2 = s2; *sc2 != 0; sc2++) |
.................... if (*sc1 == *sc2) |
.................... return(sc1 - s1); |
.................... return(sc1 - s1); |
.................... } |
.................... /* standard template: |
.................... char *strpbrk(const char *s1, const char *s2). |
.................... Locates first occurence of any character from s2 in s1; |
.................... returns s1 if s2 is empty string */ |
.................... |
.................... char *strpbrk(char *s1, char *s2) |
.................... { |
.................... char *sc1, *sc2; |
.................... |
.................... for (sc1 = s1; *sc1 != 0; sc1++) |
.................... for (sc2 = s2; *sc2 != 0; sc2++) |
.................... if (*sc1 == *sc2) |
.................... return(sc1); |
.................... return(0); |
.................... } |
.................... |
.................... |
.................... /* standard template: char *strrchr(const char *s, int c). |
.................... Finds last occurrence of c in s */ |
.................... |
.................... char *strrchr(char *s, int c) |
.................... { |
.................... char *p; |
.................... |
.................... for (p = 0; ; s++) |
.................... { |
.................... if (*s == c) |
.................... p = s; |
.................... if (*s == '\0') |
.................... return(p); |
.................... } |
.................... } |
.................... /* computes length of max initial segment of s1 consisting |
.................... entirely of characters from s2 */ |
.................... |
.................... int *strspn(char *s1, char *s2) |
.................... { |
.................... char *sc1, *sc2; |
.................... |
.................... for (sc1 = s1; *sc1 != 0; sc1++) |
.................... for (sc2 = s2; ; sc2++) |
.................... if (*sc2 == '\0') |
.................... return(sc1 - s1); |
.................... else if (*sc1 == *sc2) |
.................... break; |
.................... return(sc1 - s1); |
.................... } |
.................... /* standard template: |
.................... char *strstr(const char *s1, const char *s2); |
.................... Locates first occurence of character sequence s2 in s1; |
.................... returns 0 if s2 is empty string |
.................... |
.................... Uncomment #define FASTER_BUT_MORE_ROM at the top of the |
.................... file to use the faster algorithm */ |
.................... char *strstr(char *s1, char *s2) |
.................... { |
.................... char *s, *t; |
.................... |
.................... #ifdef FASTER_BUT_MORE_ROM |
.................... if (*s2 == '\0') |
.................... return(s1); |
.................... #endif |
.................... |
.................... while (*s1) |
.................... { |
.................... for(s = s1, t = s2; *t && *s == *t; ++s, ++t); |
.................... |
.................... if (*t == '\0') |
.................... return s1; |
.................... ++s1; |
.................... #ifdef FASTER_BUT_MORE_ROM |
.................... while(*s1 != '\0' && *s1 != *s2) |
.................... ++s1; |
.................... #endif |
.................... } |
.................... return 0; |
.................... } |
.................... |
.................... /* standard template: char *strtok(char *s1, const char *s2). |
.................... |
.................... Finds next token in s1 delimited by a character from separator |
.................... string s2 (which can be different from call to call). First call |
.................... starts at beginning of s1 searching for first character NOT |
.................... contained in s2; returns 0 if none is found. |
.................... If one is found, it is the start of first token (return value). |
.................... Function then searches from there for a character contained in s2. |
.................... If none is found, current token extends to end of s1, and subsequent |
.................... searches for a token will return 0. If one is found, it is |
.................... overwritten by '\0', which terminates current token. Function saves |
.................... pointer to following character from which next search will start. |
.................... Each subsequent call, with 0 as first argument, starts searching |
.................... from saved pointer */ |
.................... |
.................... char *strtok(char *s1, char *s2) |
.................... { |
.................... char *beg, *end; |
.................... static char *save; |
* |
0359: CLRF 29 |
035A: CLRF 2A |
.................... |
.................... beg = (s1)?s1: save; |
.................... beg += strspn(beg, s2); |
.................... if (*beg == '\0') |
.................... { |
.................... *save = ' '; |
.................... return(0); |
.................... } |
.................... end = strpbrk(beg, s2); |
.................... if (*end != '\0') |
.................... { |
.................... *end = '\0'; |
.................... end++; |
.................... } |
.................... save = end; |
.................... return(beg); |
.................... } |
.................... |
.................... /*****************************************************************/ |
.................... /*Miscellaneous functions*/ |
.................... /* standard template |
.................... maps error number in errnum to an error message string |
.................... Returns: Pointer to string |
.................... */ |
.................... #ifdef _ERRNO |
.................... char * strerror(int errnum) |
.................... { |
.................... char s[15]; |
.................... switch( errnum) |
.................... { |
.................... case 0: |
.................... strcpy(s,"no errors"); |
.................... return s; |
.................... case EDOM : |
.................... strcpy(s,"domain error"); |
.................... return s; |
.................... case ERANGE: |
.................... strcpy(s,"range error"); |
.................... return s; |
.................... } |
.................... } |
.................... #ENDIF |
.................... /* standard template: size_t strlen(const char *s). |
.................... Computes length of s1 (preceding terminating 0) */ |
.................... |
.................... int *strlen(char *s) |
.................... { |
.................... char *sc; |
.................... |
.................... for (sc = s; *sc != 0; sc++); |
.................... return(sc - s); |
.................... } |
.................... |
.................... /* standard template: size_t stricmp(const char *s1, const char *s2). |
.................... Compares s1 to s2 ignoring case (upper vs. lower) */ |
.................... |
.................... signed int stricmp(char *s1, char *s2) |
.................... { |
.................... for(; *s1==*s2||(isalpha(*s1)&&isalpha(*s2)&&(*s1==*s2+32||*s2==*s1+32)); |
.................... s1++, s2++) |
.................... if (*s1 == '\0') |
.................... return(0); |
.................... return((*s1 < *s2) ?-1: 1); |
.................... } |
.................... |
.................... |
.................... /* standard template: char *strlwr(char *s). |
.................... Replaces uppercase letters by lowercase; |
.................... returns pointer to new string s */ |
.................... |
.................... char *strlwr(char *s) |
.................... { |
.................... char *p; |
.................... |
.................... for (p = s; *p != '\0'; p++) |
.................... if (*p >= 'A' && *p <='Z') |
.................... *p += 'a' - 'A'; |
.................... return(s); |
.................... } |
.................... |
.................... |
.................... /************************************************************/ |
.................... |
.................... |
.................... #endif |
.................... |
.................... |
.................... div_t div(signed int numer,signed int denom) |
.................... { |
.................... div_t val; |
.................... val.quot = numer / denom; |
.................... val.rem = numer - (denom * val.quot); |
.................... return (val); |
.................... } |
.................... |
.................... ldiv_t ldiv(signed long numer,signed long denom) |
.................... { |
.................... ldiv_t val; |
.................... val.quot = numer / denom; |
.................... val.rem = numer - (denom * val.quot); |
.................... return (val); |
.................... } |
.................... |
.................... float atof(char * s) |
.................... { |
.................... float pow10 = 1.0; |
.................... float result = 0.0; |
.................... int sign = 0; |
.................... char c; |
.................... int ptr = 0; |
.................... |
.................... c = s[ptr++]; |
.................... |
.................... if ((c>='0' && c<='9') || c=='+' || c=='-' || c=='.') { |
.................... if(c == '-') { |
.................... sign = 1; |
.................... c = s[ptr++]; |
.................... } |
.................... if(c == '+') |
.................... c = s[ptr++]; |
.................... |
.................... while((c >= '0' && c <= '9')) { |
.................... result = 10*result + c - '0'; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... if (c == '.') { |
.................... c = s[ptr++]; |
.................... while((c >= '0' && c <= '9')) { |
.................... pow10 = pow10*10; |
.................... result += (c - '0')/pow10; |
.................... c = s[ptr++]; |
.................... } |
.................... } |
.................... |
.................... } |
.................... |
.................... if (sign == 1) |
.................... result = -1*result; |
.................... return(result); |
.................... } |
.................... |
.................... signed int atoi(char *s) |
.................... { |
.................... signed int result; |
.................... int sign, base, index; |
.................... char c; |
.................... |
.................... index = 0; |
.................... sign = 0; |
.................... base = 10; |
.................... result = 0; |
.................... |
.................... if (!s) |
.................... return 0; |
.................... // Omit all preceeding alpha characters |
.................... c = s[index++]; |
.................... |
.................... // increase index if either positive or negative sign is detected |
.................... if (c == '-') |
.................... { |
.................... sign = 1; // Set the sign to negative |
.................... c = s[index++]; |
.................... } |
.................... else if (c == '+') |
.................... { |
.................... c = s[index++]; |
.................... } |
.................... |
.................... if (c >= '0' && c <= '9') |
.................... { |
.................... |
.................... // Check for hexa number |
.................... if (c == '0' && (s[index] == 'x' || s[index] == 'X')) |
.................... { |
.................... base = 16; |
.................... index++; |
.................... c = s[index++]; |
.................... } |
.................... |
.................... // The number is a decimal number |
.................... if (base == 10) |
.................... { |
.................... while (c >= '0' && c <= '9') |
.................... { |
.................... result = 10*result + (c - '0'); |
.................... c = s[index++]; |
.................... } |
.................... } |
.................... else if (base == 16) // The number is a hexa number |
.................... { |
.................... c = toupper(c); |
.................... while ( (c >= '0' && c <= '9') || (c >= 'A' && c<='F')) |
.................... { |
.................... if (c >= '0' && c <= '9') |
.................... result = (result << 4) + (c - '0'); |
.................... else |
.................... result = (result << 4) + (c - 'A' + 10); |
.................... |
.................... c = s[index++]; |
.................... c = toupper(c); |
.................... } |
.................... } |
.................... } |
.................... |
.................... if (sign == 1 && base == 10) |
.................... result = -result; |
.................... |
.................... return(result); |
.................... } |
.................... |
.................... signed long atol(char *s) |
.................... { |
.................... signed long result; |
.................... int sign, base, index; |
.................... char c; |
.................... |
.................... index = 0; |
* |
0242: CLRF 47 |
.................... sign = 0; |
0243: CLRF 45 |
.................... base = 10; |
0244: MOVLW 0A |
0245: MOVWF 46 |
.................... result = 0; |
0246: CLRF 44 |
0247: CLRF 43 |
.................... |
.................... if (!s) |
0248: MOVF 41,W |
0249: IORWF 42,W |
024A: BTFSS 03.2 |
024B: GOTO 250 |
.................... return 0; |
024C: MOVLW 00 |
024D: MOVWF 78 |
024E: MOVWF 79 |
024F: GOTO 341 |
.................... c = s[index++]; |
0250: MOVF 47,W |
0251: INCF 47,F |
0252: ADDWF 41,W |
0253: MOVWF 04 |
0254: BCF 03.7 |
0255: BTFSC 42.0 |
0256: BSF 03.7 |
0257: MOVF 00,W |
0258: MOVWF 48 |
.................... |
.................... // increase index if either positive or negative sign is detected |
.................... if (c == '-') |
0259: MOVF 48,W |
025A: SUBLW 2D |
025B: BTFSS 03.2 |
025C: GOTO 269 |
.................... { |
.................... sign = 1; // Set the sign to negative |
025D: MOVLW 01 |
025E: MOVWF 45 |
.................... c = s[index++]; |
025F: MOVF 47,W |
0260: INCF 47,F |
0261: ADDWF 41,W |
0262: MOVWF 04 |
0263: BCF 03.7 |
0264: BTFSC 42.0 |
0265: BSF 03.7 |
0266: MOVF 00,W |
0267: MOVWF 48 |
.................... } |
.................... else if (c == '+') |
0268: GOTO 276 |
0269: MOVF 48,W |
026A: SUBLW 2B |
026B: BTFSS 03.2 |
026C: GOTO 276 |
.................... { |
.................... c = s[index++]; |
026D: MOVF 47,W |
026E: INCF 47,F |
026F: ADDWF 41,W |
0270: MOVWF 04 |
0271: BCF 03.7 |
0272: BTFSC 42.0 |
0273: BSF 03.7 |
0274: MOVF 00,W |
0275: MOVWF 48 |
.................... } |
.................... |
.................... if (c >= '0' && c <= '9') |
0276: MOVF 48,W |
0277: SUBLW 2F |
0278: BTFSC 03.0 |
0279: GOTO 332 |
027A: MOVF 48,W |
027B: SUBLW 39 |
027C: BTFSS 03.0 |
027D: GOTO 332 |
.................... { |
.................... if (c == '0' && (s[index] == 'x' || s[index] == 'X')) |
027E: MOVF 48,W |
027F: SUBLW 30 |
0280: BTFSS 03.2 |
0281: GOTO 2A2 |
0282: MOVF 47,W |
0283: ADDWF 41,W |
0284: MOVWF 04 |
0285: BCF 03.7 |
0286: BTFSC 42.0 |
0287: BSF 03.7 |
0288: MOVF 00,W |
0289: SUBLW 78 |
028A: BTFSC 03.2 |
028B: GOTO 296 |
028C: MOVF 47,W |
028D: ADDWF 41,W |
028E: MOVWF 04 |
028F: BCF 03.7 |
0290: BTFSC 42.0 |
0291: BSF 03.7 |
0292: MOVF 00,W |
0293: SUBLW 58 |
0294: BTFSS 03.2 |
0295: GOTO 2A2 |
.................... { |
.................... base = 16; |
0296: MOVLW 10 |
0297: MOVWF 46 |
.................... index++; |
0298: INCF 47,F |
.................... c = s[index++]; |
0299: MOVF 47,W |
029A: INCF 47,F |
029B: ADDWF 41,W |
029C: MOVWF 04 |
029D: BCF 03.7 |
029E: BTFSC 42.0 |
029F: BSF 03.7 |
02A0: MOVF 00,W |
02A1: MOVWF 48 |
.................... } |
.................... |
.................... // The number is a decimal number |
.................... if (base == 10) |
02A2: MOVF 46,W |
02A3: SUBLW 0A |
02A4: BTFSS 03.2 |
02A5: GOTO 2C9 |
.................... { |
.................... while (c >= '0' && c <= '9') |
.................... { |
02A6: MOVF 48,W |
02A7: SUBLW 2F |
02A8: BTFSC 03.0 |
02A9: GOTO 2C8 |
02AA: MOVF 48,W |
02AB: SUBLW 39 |
02AC: BTFSS 03.0 |
02AD: GOTO 2C8 |
.................... result = 10*result + (c - '0'); |
02AE: CLRF 4A |
02AF: MOVLW 0A |
02B0: MOVWF 49 |
02B1: MOVF 44,W |
02B2: MOVWF 4C |
02B3: MOVF 43,W |
02B4: MOVWF 4B |
02B5: GOTO 22C |
02B6: MOVLW 30 |
02B7: SUBWF 48,W |
02B8: ADDWF 78,W |
02B9: MOVWF 43 |
02BA: MOVF 79,W |
02BB: MOVWF 44 |
02BC: BTFSC 03.0 |
02BD: INCF 44,F |
.................... c = s[index++]; |
02BE: MOVF 47,W |
02BF: INCF 47,F |
02C0: ADDWF 41,W |
02C1: MOVWF 04 |
02C2: BCF 03.7 |
02C3: BTFSC 42.0 |
02C4: BSF 03.7 |
02C5: MOVF 00,W |
02C6: MOVWF 48 |
.................... } |
02C7: GOTO 2A6 |
.................... } |
.................... else if (base == 16) // The number is a hexa number |
02C8: GOTO 332 |
02C9: MOVF 46,W |
02CA: SUBLW 10 |
02CB: BTFSS 03.2 |
02CC: GOTO 332 |
.................... { |
.................... c = toupper(c); |
02CD: MOVF 48,W |
02CE: SUBLW 60 |
02CF: BTFSC 03.0 |
02D0: GOTO 2D8 |
02D1: MOVF 48,W |
02D2: SUBLW 7A |
02D3: BTFSS 03.0 |
02D4: GOTO 2D8 |
02D5: MOVF 48,W |
02D6: ANDLW DF |
02D7: GOTO 2D9 |
02D8: MOVF 48,W |
02D9: MOVWF 48 |
.................... while ( (c >= '0' && c <= '9') || (c >= 'A' && c <='F')) |
.................... { |
02DA: MOVF 48,W |
02DB: SUBLW 2F |
02DC: BTFSC 03.0 |
02DD: GOTO 2E2 |
02DE: MOVF 48,W |
02DF: SUBLW 39 |
02E0: BTFSC 03.0 |
02E1: GOTO 2EA |
02E2: MOVF 48,W |
02E3: SUBLW 40 |
02E4: BTFSC 03.0 |
02E5: GOTO 332 |
02E6: MOVF 48,W |
02E7: SUBLW 46 |
02E8: BTFSS 03.0 |
02E9: GOTO 332 |
.................... if (c >= '0' && c <= '9') |
02EA: MOVF 48,W |
02EB: SUBLW 2F |
02EC: BTFSC 03.0 |
02ED: GOTO 307 |
02EE: MOVF 48,W |
02EF: SUBLW 39 |
02F0: BTFSS 03.0 |
02F1: GOTO 307 |
.................... result = (result << 4) + (c - '0'); |
02F2: RLF 43,W |
02F3: MOVWF 49 |
02F4: RLF 44,W |
02F5: MOVWF 4A |
02F6: RLF 49,F |
02F7: RLF 4A,F |
02F8: RLF 49,F |
02F9: RLF 4A,F |
02FA: RLF 49,F |
02FB: RLF 4A,F |
02FC: MOVLW F0 |
02FD: ANDWF 49,F |
02FE: MOVLW 30 |
02FF: SUBWF 48,W |
0300: ADDWF 49,W |
0301: MOVWF 43 |
0302: MOVF 4A,W |
0303: MOVWF 44 |
0304: BTFSC 03.0 |
0305: INCF 44,F |
.................... else |
0306: GOTO 31C |
.................... result = (result << 4) + (c - 'A' + 10); |
0307: RLF 43,W |
0308: MOVWF 49 |
0309: RLF 44,W |
030A: MOVWF 4A |
030B: RLF 49,F |
030C: RLF 4A,F |
030D: RLF 49,F |
030E: RLF 4A,F |
030F: RLF 49,F |
0310: RLF 4A,F |
0311: MOVLW F0 |
0312: ANDWF 49,F |
0313: MOVLW 41 |
0314: SUBWF 48,W |
0315: ADDLW 0A |
0316: ADDWF 49,W |
0317: MOVWF 43 |
0318: MOVF 4A,W |
0319: MOVWF 44 |
031A: BTFSC 03.0 |
031B: INCF 44,F |
.................... |
.................... c = s[index++];c = toupper(c); |
031C: MOVF 47,W |
031D: INCF 47,F |
031E: ADDWF 41,W |
031F: MOVWF 04 |
0320: BCF 03.7 |
0321: BTFSC 42.0 |
0322: BSF 03.7 |
0323: MOVF 00,W |
0324: MOVWF 48 |
0325: SUBLW 60 |
0326: BTFSC 03.0 |
0327: GOTO 32F |
0328: MOVF 48,W |
0329: SUBLW 7A |
032A: BTFSS 03.0 |
032B: GOTO 32F |
032C: MOVF 48,W |
032D: ANDLW DF |
032E: GOTO 330 |
032F: MOVF 48,W |
0330: MOVWF 48 |
.................... } |
0331: GOTO 2DA |
.................... } |
.................... } |
.................... |
.................... if (base == 10 && sign == 1) |
0332: MOVF 46,W |
0333: SUBLW 0A |
0334: BTFSS 03.2 |
0335: GOTO 33D |
0336: DECFSZ 45,W |
0337: GOTO 33D |
.................... result = -result; |
0338: COMF 43,F |
0339: COMF 44,F |
033A: INCF 43,F |
033B: BTFSC 03.2 |
033C: INCF 44,F |
.................... |
.................... return(result); |
033D: MOVF 43,W |
033E: MOVWF 78 |
033F: MOVF 44,W |
0340: MOVWF 79 |
.................... } |
0341: RETLW 00 |
.................... |
.................... /* A fast routine to multiply by 10 |
.................... */ |
.................... signed int32 mult_with10(int32 num) |
.................... { |
.................... return ( (num << 1) + (num << 3) ); |
.................... } |
.................... |
.................... signed int32 atoi32(char *s) |
.................... { |
.................... signed int32 result; |
.................... int sign, base, index; |
.................... char c; |
.................... |
.................... index = 0; |
.................... sign = 0; |
.................... base = 10; |
.................... result = 0; |
.................... |
.................... if (!s) |
.................... return 0; |
.................... c = s[index++]; |
.................... |
.................... // increase index if either positive or negative sign is detected |
.................... if (c == '-') |
.................... { |
.................... sign = 1; // Set the sign to negative |
.................... c = s[index++]; |
.................... } |
.................... else if (c == '+') |
.................... { |
.................... c = s[index++]; |
.................... } |
.................... |
.................... if (c >= '0' && c <= '9') |
.................... { |
.................... if (c == '0' && (s[index] == 'x' || s[index] == 'X')) |
.................... { |
.................... base = 16; |
.................... index++; |
.................... c = s[index++]; |
.................... } |
.................... |
.................... // The number is a decimal number |
.................... if (base == 10) |
.................... { |
.................... while (c >= '0' && c <= '9') { |
.................... result = (result << 1) + (result << 3); // result *= 10; |
.................... result += (c - '0'); |
.................... c = s[index++]; |
.................... } |
.................... } |
.................... else if (base == 16) // The number is a hexa number |
.................... { |
.................... c = toupper(c); |
.................... while ((c >= '0' && c <= '9') || (c >= 'A' && c <='F')) |
.................... { |
.................... if (c >= '0' && c <= '9') |
.................... result = (result << 4) + (c - '0'); |
.................... else |
.................... result = (result << 4) + (c - 'A' + 10); |
.................... |
.................... c = s[index++];c = toupper(c); |
.................... } |
.................... } |
.................... } |
.................... |
.................... if (base == 10 && sign == 1) |
.................... result = -result; |
.................... |
.................... return(result); |
.................... } |
.................... |
.................... float strtod(char *s,char *endptr) { |
.................... float pow10 = 1.0; |
.................... float result = 0.0; |
.................... int sign = 0, point = 0; |
.................... char c; |
.................... int ptr = 0; |
.................... |
.................... if (!s) |
.................... return 0; |
.................... c=s[ptr++]; |
.................... |
.................... |
.................... while((c>='0' && c<='9') || c=='+' || c=='-' || c=='.') { |
.................... if(c == '-') { |
.................... sign = 1; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... while((c >= '0' && c <= '9') && point == 0) { |
.................... result = 10*result + c - '0'; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... if (c == '.') { |
.................... point = 1; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... while((c >= '0' && c <= '9') && point == 1) { |
.................... pow10 = pow10*10; |
.................... result += (c - '0')/pow10; |
.................... c = s[ptr++]; |
.................... } |
.................... |
.................... if (c == '+') { |
.................... c = s[ptr++]; |
.................... } |
.................... } |
.................... |
.................... if (sign == 1) |
.................... result = -1*result; |
.................... if(endptr) |
.................... { |
.................... if (ptr) { |
.................... ptr--; |
.................... *((char *)endptr)=s+ptr; |
.................... } |
.................... else |
.................... *((char *)endptr)=s; |
.................... } |
.................... |
.................... return(result); |
.................... } |
.................... |
.................... long strtoul(char *s,char *endptr,signed int base) |
.................... { |
.................... char *sc,*s1,*sd; |
.................... unsigned long x=0; |
.................... char sign; |
.................... char digits[]="0123456789abcdefghijklmnopqstuvwxyz"; |
.................... for(sc=s;isspace(*sc);++sc); |
.................... sign=*sc=='-'||*sc=='+'?sc++:'+'; |
.................... if(sign=='-') |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... |
.................... if (base <0 || base ==1|| base >36) // invalid base |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... else if (base) |
.................... { |
.................... if(base==16 && *sc =='0'&&(sc[1]=='x' || sc[1]=='X')) |
.................... sc+=2; |
.................... if(base==8 && *sc =='0') |
.................... sc+=1; |
.................... if(base==2 && *sc =='0'&&sc[1]=='b') |
.................... sc+=2; |
.................... |
.................... } |
.................... else if(*sc!='0') // base is 0, find base |
.................... base=10; |
.................... else if (sc[1]=='x' || sc[1]=='X') |
.................... base =16,sc+=2; |
.................... else if(sc[1]=='b') |
.................... base=2,sc+=2; |
.................... else |
.................... base=8; |
.................... for (s1=sc;*sc=='0';++sc);// skip leading zeroes |
.................... sd=memchr(digits,tolower(*sc),base); |
.................... for(; sd!=0; ) |
.................... { |
.................... x=x*base+(int16)(sd-digits); |
.................... ++sc; |
.................... sd=memchr(digits,tolower(*sc),base); |
.................... } |
.................... if(s1==sc) |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... if (endptr) |
.................... *((char *)endptr)=sc; |
.................... return x; |
.................... } |
.................... |
.................... |
.................... signed long strtol(char *s,char *endptr,signed int base) |
.................... { |
.................... char *sc,*s1,*sd; |
.................... signed long x=0; |
.................... char sign; |
.................... char digits[]="0123456789abcdefghijklmnopqstuvwxyz"; |
.................... for(sc=s;isspace(*sc);++sc); |
.................... sign=*sc=='-'||*sc=='+'?sc++:'+'; |
.................... if (base <0 || base ==1|| base >36) // invalid base |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... else if (base) |
.................... { |
.................... if(base==16 && *sc =='0'&&(sc[1]=='x' || sc[1]=='X')) |
.................... sc+=2; |
.................... if(base==8 && *sc =='0') |
.................... sc+=1; |
.................... if(base==2 && *sc =='0'&&sc[1]=='b') |
.................... sc+=2; |
.................... |
.................... } |
.................... else if(*sc!='0') // base is 0, find base |
.................... base=10; |
.................... else if (sc[1]=='x' || sc[1]=='X') |
.................... base =16,sc+=2; |
.................... else if(sc[1]=='b') |
.................... base=2,sc+=2; |
.................... else |
.................... base=8; |
.................... for (s1=sc;*sc=='0';++sc);// skip leading zeroes |
.................... |
.................... sd=memchr(digits,tolower(*sc),base); |
.................... for(;sd!=0;) |
.................... { |
.................... x=x*base+(int16)(sd-digits); |
.................... ++sc; |
.................... sd=memchr(digits,tolower(*sc),base); |
.................... } |
.................... if(s1==sc) |
.................... { |
.................... if (endptr) |
.................... { |
.................... *((char *)endptr)=s; |
.................... } |
.................... return 0; |
.................... } |
.................... if(sign=='-') |
.................... x =-x; |
.................... if (endptr) |
.................... *((char *)endptr)=sc; |
.................... return x; |
.................... } |
.................... |
.................... signed int system(char *string) |
.................... { |
.................... return 0; |
.................... } |
.................... |
.................... int mblen(char *s,size_t n) |
.................... { |
.................... return strlen(s); |
.................... } |
.................... |
.................... int mbtowc(wchar_t *pwc,char *s,size_t n) |
.................... { |
.................... *pwc=*s; |
.................... return 1; |
.................... } |
.................... |
.................... int wctomb(char *s,wchar_t wchar) |
.................... { |
.................... *s=wchar; |
.................... return 1; |
.................... } |
.................... |
.................... size_t mbstowcs(wchar_t *pwcs,char *s,size_t n) |
.................... { |
.................... strncpy(pwcs,s,n); |
.................... return strlen(pwcs); |
.................... } |
.................... |
.................... size_t wcstombs(char *s,wchar_t *pwcs,size_t n) |
.................... { |
.................... strncpy(s,pwcs,n); |
.................... return strlen(s); |
.................... } |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // The random number implementation |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... unsigned int32 _Randseed = 1; |
* |
035B: MOVLW 01 |
035C: MOVWF 2B |
035D: CLRF 2C |
035E: CLRF 2D |
035F: CLRF 2E |
.................... |
.................... long rand(void) |
.................... { |
.................... _Randseed = _Randseed * 1103515245 + 12345; |
.................... return ((unsigned long)(_Randseed >> 16) % RAND_MAX); |
.................... } |
.................... |
.................... void srand(unsigned int32 seed) |
.................... { |
.................... _Randseed = seed; |
.................... } |
.................... |
.................... //--------------------------------------------------------------------------- |
.................... // Searching and sorting utilities implementation |
.................... //--------------------------------------------------------------------------- |
.................... |
.................... typedef signed int (*_Cmpfun)(char * p1,char * p2); |
.................... |
.................... void qsort(char * qdata, int qitems, int qsize, _Cmpfun cmp) { |
.................... int m,j,i,l; |
.................... short done; |
.................... BYTE t[16]; |
.................... |
.................... m = qitems/2; |
.................... while( m > 0 ) { |
.................... for(j=0; j<(qitems-m); ++j) { |
.................... i = j; |
.................... do |
.................... { |
.................... done=TRUE; |
.................... l = i+m; |
.................... if( (*cmp)(qdata+i*qsize, qdata+l*qsize) > 0 ) { |
.................... memcpy(t, qdata+i*qsize, qsize); |
.................... memcpy(qdata+i*qsize, qdata+l*qsize, qsize); |
.................... memcpy(qdata+l*qsize, t, qsize); |
.................... if(m <= i) |
.................... i -= m; |
.................... done = FALSE; |
.................... } |
.................... } while(!done); |
.................... } |
.................... m = m/2; |
.................... } |
.................... } |
.................... |
.................... |
.................... char *bsearch(char *key, char *base, size_t num, size_t width,_Cmpfun cmp) |
.................... { |
.................... char *p, *q; |
.................... size_t n; |
.................... size_t pivot; |
.................... signed int val; |
.................... |
.................... p = base; |
.................... n = num; |
.................... |
.................... while (n > 0) |
.................... { |
.................... pivot = n >> 1; |
.................... q = p + width * pivot; |
.................... |
.................... val = (*cmp)(key, q); |
.................... |
.................... if (val < 0) |
.................... n = pivot; |
.................... else if (val == 0) |
.................... return ((char *)q); |
.................... else { |
.................... p = q + width; |
.................... n -= pivot + 1; |
.................... } |
.................... } |
.................... |
.................... return NULL; // There's no match |
.................... } |
.................... |
.................... |
.................... #endif |
.................... |
.................... |
.................... #define SYNC PIN_B4 // Spousteni oscyloskopu |
.................... #define HACK PIN_B5 // Zkratovani napajeni SmartCard |
.................... #define CLOCK PIN_B6 // Hodiny ze SmartCard |
.................... |
.................... #int_TIMER1 |
.................... TIMER1_isr() |
.................... { |
.................... |
.................... } |
.................... |
* |
00E0: BCF 0C.0 |
00E1: BCF 0A.3 |
00E2: GOTO 028 |
.................... #int_TIMER2 |
.................... TIMER2_isr() |
.................... { |
.................... |
.................... } |
.................... |
00E3: BCF 0C.1 |
00E4: BCF 0A.3 |
00E5: GOTO 028 |
.................... void main() |
.................... { |
* |
0342: CLRF 04 |
0343: BCF 03.7 |
0344: MOVLW 1F |
0345: ANDWF 03,F |
0346: BSF 03.5 |
0347: BCF 1F.4 |
0348: BCF 1F.5 |
0349: MOVF 1B,W |
034A: ANDLW 80 |
034B: MOVWF 1B |
034C: MOVLW 07 |
034D: MOVWF 1C |
034E: MOVF 05,W |
034F: CLRWDT |
0350: MOVF 1C,W |
0351: BCF 03.5 |
0352: BCF 0D.6 |
0353: MOVLW 60 |
0354: BSF 03.5 |
0355: MOVWF 0F |
0356: BCF 06.3 |
0357: BCF 03.5 |
0358: BSF 06.3 |
.................... unsigned int16 i; |
.................... char ch; |
.................... char string[10]; |
.................... const char ver[]={"HACK v1.0\0"}; |
.................... unsigned int16 prescale; |
.................... unsigned int16 ticks; |
.................... int n; |
.................... |
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD); |
* |
0360: BSF 03.5 |
0361: BCF 1F.4 |
0362: BCF 1F.5 |
0363: MOVF 1B,W |
0364: ANDLW 80 |
0365: MOVWF 1B |
.................... setup_adc(ADC_OFF); |
0366: BCF 03.5 |
0367: BCF 1F.0 |
.................... setup_spi(FALSE); |
0368: BCF 14.5 |
0369: BSF 03.5 |
036A: BCF 06.2 |
036B: BSF 06.1 |
036C: BCF 06.4 |
036D: MOVLW 00 |
036E: BCF 03.5 |
036F: MOVWF 14 |
0370: BSF 03.5 |
0371: MOVWF 14 |
.................... setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
0372: MOVF 01,W |
0373: ANDLW C7 |
0374: IORLW 28 |
0375: MOVWF 01 |
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1); |
0376: MOVLW 87 |
0377: BCF 03.5 |
0378: MOVWF 10 |
.................... // setup_timer_1(T1_INTERNAL|T1_DIV_BY_8); |
.................... setup_timer_2(T2_DISABLED,0,1); |
0379: MOVLW 00 |
037A: MOVWF 78 |
037B: MOVWF 12 |
037C: MOVLW 00 |
037D: BSF 03.5 |
037E: MOVWF 12 |
.................... setup_comparator(NC_NC_NC_NC); |
037F: MOVLW 07 |
0380: MOVWF 1C |
0381: MOVF 05,W |
0382: CLRWDT |
0383: MOVLW 02 |
0384: MOVWF 77 |
0385: DECFSZ 77,F |
0386: GOTO 385 |
0387: NOP |
0388: NOP |
0389: MOVF 1C,W |
038A: BCF 03.5 |
038B: BCF 0D.6 |
.................... setup_vref(FALSE); |
038C: BSF 03.5 |
038D: CLRF 1D |
.................... // enable_interrupts(INT_TIMER1); |
.................... // enable_interrupts(INT_TIMER2); |
.................... // enable_interrupts(GLOBAL); |
.................... |
.................... setup_oscillator(OSC_4MHZ|OSC_INTRC); // 4 MHz interni RC oscilator |
038E: MOVLW 62 |
038F: MOVWF 0F |
.................... |
.................... delay_ms(100); |
0390: MOVLW 64 |
0391: BCF 03.5 |
0392: MOVWF 42 |
0393: CALL 0E6 |
.................... printf("\n\r\n\r%s", ver); |
0394: CLRF 41 |
0395: MOVF 41,W |
0396: CALL 04E |
0397: INCF 41,F |
0398: MOVWF 77 |
0399: MOVWF 4C |
039A: CALL 0FE |
039B: MOVLW 04 |
039C: SUBWF 41,W |
039D: BTFSS 03.2 |
039E: GOTO 395 |
039F: CLRF 42 |
03A0: MOVF 42,W |
03A1: CALL 03F |
03A2: IORLW 00 |
03A3: BTFSC 03.2 |
03A4: GOTO 3A9 |
03A5: INCF 42,F |
03A6: MOVWF 4C |
03A7: CALL 0FE |
03A8: GOTO 3A0 |
.................... output_low(SYNC); |
03A9: BSF 03.5 |
03AA: BCF 06.4 |
03AB: BCF 03.5 |
03AC: BCF 06.4 |
.................... output_low(HACK); |
03AD: BSF 03.5 |
03AE: BCF 06.5 |
03AF: BCF 03.5 |
03B0: BCF 06.5 |
.................... ticks=1; |
03B1: CLRF 3F |
03B2: MOVLW 01 |
03B3: MOVWF 3E |
.................... prescale=0; |
03B4: CLRF 3D |
03B5: CLRF 3C |
.................... |
.................... while(true) |
.................... { |
.................... printf("\n\r>"); |
03B6: MOVLW 0A |
03B7: MOVWF 4C |
03B8: CALL 0FE |
03B9: MOVLW 0D |
03BA: MOVWF 4C |
03BB: CALL 0FE |
03BC: MOVLW 3E |
03BD: MOVWF 4C |
03BE: CALL 0FE |
.................... n=0; |
03BF: CLRF 40 |
.................... do |
.................... { |
.................... ch=getchar(); |
03C0: GOTO 12A |
03C1: MOVF 78,W |
03C2: MOVWF 31 |
.................... printf("%c",ch); |
03C3: MOVF 31,W |
03C4: MOVWF 4C |
03C5: CALL 0FE |
.................... string[n++]=ch; |
03C6: MOVF 40,W |
03C7: INCF 40,F |
03C8: ADDLW 32 |
03C9: MOVWF 04 |
03CA: BCF 03.7 |
03CB: MOVF 31,W |
03CC: MOVWF 00 |
.................... } while((13 != ch) && (n < 10)); |
03CD: MOVF 31,W |
03CE: SUBLW 0D |
03CF: BTFSC 03.2 |
03D0: GOTO 3D5 |
03D1: MOVF 40,W |
03D2: SUBLW 09 |
03D3: BTFSC 03.0 |
03D4: GOTO 3C0 |
.................... string[n]=0; |
03D5: MOVLW 32 |
03D6: ADDWF 40,W |
03D7: MOVWF 04 |
03D8: BCF 03.7 |
03D9: CLRF 00 |
.................... printf("\n\r"); |
03DA: MOVLW 0A |
03DB: MOVWF 4C |
03DC: CALL 0FE |
03DD: MOVLW 0D |
03DE: MOVWF 4C |
03DF: CALL 0FE |
.................... switch(string[0]) |
.................... { |
03E0: MOVF 32,W |
03E1: XORLW 67 |
03E2: BTFSC 03.2 |
03E3: GOTO 3F1 |
03E4: XORLW 15 |
03E5: BTFSC 03.2 |
03E6: GOTO 460 |
03E7: XORLW 1A |
03E8: BTFSC 03.2 |
03E9: GOTO 4E9 |
03EA: XORLW 01 |
03EB: BTFSC 03.2 |
03EC: GOTO 571 |
03ED: XORLW 19 |
03EE: BTFSC 03.2 |
03EF: GOTO 5A8 |
03F0: GOTO 5EB |
.................... case 'g': // GO |
.................... printf("%Lue4 + %Lu GO", prescale, ticks); |
03F1: MOVLW 10 |
03F2: MOVWF 04 |
03F3: MOVF 3D,W |
03F4: MOVWF 44 |
03F5: MOVF 3C,W |
03F6: MOVWF 43 |
03F7: CALL 15F |
03F8: MOVLW 03 |
03F9: MOVWF 41 |
03FA: MOVF 41,W |
03FB: CALL 059 |
03FC: INCF 41,F |
03FD: MOVWF 77 |
03FE: MOVWF 4C |
03FF: CALL 0FE |
0400: MOVLW 08 |
0401: SUBWF 41,W |
0402: BTFSS 03.2 |
0403: GOTO 3FA |
0404: MOVLW 10 |
0405: MOVWF 04 |
0406: MOVF 3F,W |
0407: MOVWF 44 |
0408: MOVF 3E,W |
0409: MOVWF 43 |
040A: CALL 15F |
040B: MOVLW 20 |
040C: MOVWF 4C |
040D: CALL 0FE |
040E: MOVLW 47 |
040F: MOVWF 4C |
0410: CALL 0FE |
0411: MOVLW 4F |
0412: MOVWF 4C |
0413: CALL 0FE |
.................... for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
0414: CLRF 30 |
0415: CLRF 2F |
0416: MOVF 30,W |
0417: SUBWF 3D,W |
0418: BTFSS 03.0 |
0419: GOTO 43C |
041A: BTFSS 03.2 |
041B: GOTO 420 |
041C: MOVF 3C,W |
041D: SUBWF 2F,W |
041E: BTFSC 03.0 |
041F: GOTO 43C |
0420: CLRF 0F |
0421: CLRF 0E |
0422: MOVF 0F,W |
0423: MOVWF 7A |
0424: MOVF 0E,W |
0425: MOVWF 77 |
0426: MOVF 0F,W |
0427: SUBWF 7A,W |
0428: BTFSS 03.2 |
0429: GOTO 422 |
042A: MOVF 77,W |
042B: MOVWF 41 |
042C: MOVF 7A,W |
042D: MOVWF 42 |
042E: MOVF 42,W |
042F: SUBLW 27 |
0430: BTFSS 03.0 |
0431: GOTO 438 |
0432: BTFSS 03.2 |
0433: GOTO 422 |
0434: MOVF 41,W |
0435: SUBLW 0F |
0436: BTFSC 03.0 |
0437: GOTO 422 |
0438: INCF 2F,F |
0439: BTFSC 03.2 |
043A: INCF 30,F |
043B: GOTO 416 |
.................... set_timer1(0); while ( get_timer1() < ticks ) ; |
043C: CLRF 0F |
043D: CLRF 0E |
043E: MOVF 0F,W |
043F: MOVWF 7A |
0440: MOVF 0E,W |
0441: MOVWF 77 |
0442: MOVF 0F,W |
0443: SUBWF 7A,W |
0444: BTFSS 03.2 |
0445: GOTO 43E |
0446: MOVF 77,W |
0447: MOVWF 41 |
0448: MOVF 7A,W |
0449: MOVWF 42 |
044A: MOVF 42,W |
044B: SUBWF 3F,W |
044C: BTFSS 03.0 |
044D: GOTO 454 |
044E: BTFSS 03.2 |
044F: GOTO 43E |
0450: MOVF 3E,W |
0451: SUBWF 41,W |
0452: BTFSS 03.0 |
0453: GOTO 43E |
.................... output_high(SYNC); |
0454: BSF 03.5 |
0455: BCF 06.4 |
0456: BCF 03.5 |
0457: BSF 06.4 |
.................... delay_ms(1); |
0458: MOVLW 01 |
0459: MOVWF 42 |
045A: CALL 0E6 |
.................... output_low(SYNC); |
045B: BSF 03.5 |
045C: BCF 06.4 |
045D: BCF 03.5 |
045E: BCF 06.4 |
.................... break; |
045F: GOTO 61A |
.................... |
.................... case 'r': // REPEAT |
.................... n=0; |
0460: CLRF 40 |
.................... while(true) |
.................... { |
.................... printf("%Lue4 + %Lu REPEAT %u\n\r", prescale, ticks, n++); |
0461: MOVF 40,W |
0462: INCF 40,F |
0463: MOVWF 41 |
0464: MOVLW 10 |
0465: MOVWF 04 |
0466: MOVF 3D,W |
0467: MOVWF 44 |
0468: MOVF 3C,W |
0469: MOVWF 43 |
046A: CALL 15F |
046B: MOVLW 03 |
046C: MOVWF 42 |
046D: MOVF 42,W |
046E: CALL 06C |
046F: INCF 42,F |
0470: MOVWF 77 |
0471: MOVWF 4C |
0472: CALL 0FE |
0473: MOVLW 08 |
0474: SUBWF 42,W |
0475: BTFSS 03.2 |
0476: GOTO 46D |
0477: MOVLW 10 |
0478: MOVWF 04 |
0479: MOVF 3F,W |
047A: MOVWF 44 |
047B: MOVF 3E,W |
047C: MOVWF 43 |
047D: CALL 15F |
047E: MOVLW 0B |
047F: MOVWF 43 |
0480: MOVF 43,W |
0481: CALL 06C |
0482: INCF 43,F |
0483: MOVWF 77 |
0484: MOVWF 4C |
0485: CALL 0FE |
0486: MOVLW 13 |
0487: SUBWF 43,W |
0488: BTFSS 03.2 |
0489: GOTO 480 |
048A: MOVF 41,W |
048B: MOVWF 44 |
048C: MOVLW 18 |
048D: MOVWF 45 |
048E: GOTO 1DE |
048F: MOVLW 0A |
0490: MOVWF 4C |
0491: CALL 0FE |
0492: MOVLW 0D |
0493: MOVWF 4C |
0494: CALL 0FE |
.................... for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
0495: CLRF 30 |
0496: CLRF 2F |
0497: MOVF 30,W |
0498: SUBWF 3D,W |
0499: BTFSS 03.0 |
049A: GOTO 4BD |
049B: BTFSS 03.2 |
049C: GOTO 4A1 |
049D: MOVF 3C,W |
049E: SUBWF 2F,W |
049F: BTFSC 03.0 |
04A0: GOTO 4BD |
04A1: CLRF 0F |
04A2: CLRF 0E |
04A3: MOVF 0F,W |
04A4: MOVWF 7A |
04A5: MOVF 0E,W |
04A6: MOVWF 77 |
04A7: MOVF 0F,W |
04A8: SUBWF 7A,W |
04A9: BTFSS 03.2 |
04AA: GOTO 4A3 |
04AB: MOVF 77,W |
04AC: MOVWF 41 |
04AD: MOVF 7A,W |
04AE: MOVWF 42 |
04AF: MOVF 42,W |
04B0: SUBLW 27 |
04B1: BTFSS 03.0 |
04B2: GOTO 4B9 |
04B3: BTFSS 03.2 |
04B4: GOTO 4A3 |
04B5: MOVF 41,W |
04B6: SUBLW 0F |
04B7: BTFSC 03.0 |
04B8: GOTO 4A3 |
04B9: INCF 2F,F |
04BA: BTFSC 03.2 |
04BB: INCF 30,F |
04BC: GOTO 497 |
.................... set_timer1(0); while ( get_timer1() < ticks ) ; |
04BD: CLRF 0F |
04BE: CLRF 0E |
04BF: MOVF 0F,W |
04C0: MOVWF 7A |
04C1: MOVF 0E,W |
04C2: MOVWF 77 |
04C3: MOVF 0F,W |
04C4: SUBWF 7A,W |
04C5: BTFSS 03.2 |
04C6: GOTO 4BF |
04C7: MOVF 77,W |
04C8: MOVWF 41 |
04C9: MOVF 7A,W |
04CA: MOVWF 42 |
04CB: MOVF 42,W |
04CC: SUBWF 3F,W |
04CD: BTFSS 03.0 |
04CE: GOTO 4D5 |
04CF: BTFSS 03.2 |
04D0: GOTO 4BF |
04D1: MOVF 3E,W |
04D2: SUBWF 41,W |
04D3: BTFSS 03.0 |
04D4: GOTO 4BF |
.................... output_high(SYNC); |
04D5: BSF 03.5 |
04D6: BCF 06.4 |
04D7: BCF 03.5 |
04D8: BSF 06.4 |
.................... delay_ms(20); |
04D9: MOVLW 14 |
04DA: MOVWF 42 |
04DB: CALL 0E6 |
.................... output_low(SYNC); |
04DC: BSF 03.5 |
04DD: BCF 06.4 |
04DE: BCF 03.5 |
04DF: BCF 06.4 |
.................... delay_ms(2000); |
04E0: MOVLW 08 |
04E1: MOVWF 41 |
04E2: MOVLW FA |
04E3: MOVWF 42 |
04E4: CALL 0E6 |
04E5: DECFSZ 41,F |
04E6: GOTO 4E2 |
.................... }; |
04E7: GOTO 461 |
.................... break; |
04E8: GOTO 61A |
.................... |
.................... case 'h': // HACK |
.................... printf("%Lue4 + %Lu HACK", prescale, ticks); |
04E9: MOVLW 10 |
04EA: MOVWF 04 |
04EB: MOVF 3D,W |
04EC: MOVWF 44 |
04ED: MOVF 3C,W |
04EE: MOVWF 43 |
04EF: CALL 15F |
04F0: MOVLW 03 |
04F1: MOVWF 41 |
04F2: MOVF 41,W |
04F3: CALL 088 |
04F4: INCF 41,F |
04F5: MOVWF 77 |
04F6: MOVWF 4C |
04F7: CALL 0FE |
04F8: MOVLW 08 |
04F9: SUBWF 41,W |
04FA: BTFSS 03.2 |
04FB: GOTO 4F2 |
04FC: MOVLW 10 |
04FD: MOVWF 04 |
04FE: MOVF 3F,W |
04FF: MOVWF 44 |
0500: MOVF 3E,W |
0501: MOVWF 43 |
0502: CALL 15F |
0503: MOVLW 0B |
0504: MOVWF 42 |
0505: MOVF 42,W |
0506: CALL 088 |
0507: INCF 42,F |
0508: MOVWF 77 |
0509: MOVWF 4C |
050A: CALL 0FE |
050B: MOVLW 10 |
050C: SUBWF 42,W |
050D: BTFSS 03.2 |
050E: GOTO 505 |
.................... for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
050F: CLRF 30 |
0510: CLRF 2F |
0511: MOVF 30,W |
0512: SUBWF 3D,W |
0513: BTFSS 03.0 |
0514: GOTO 537 |
0515: BTFSS 03.2 |
0516: GOTO 51B |
0517: MOVF 3C,W |
0518: SUBWF 2F,W |
0519: BTFSC 03.0 |
051A: GOTO 537 |
051B: CLRF 0F |
051C: CLRF 0E |
051D: MOVF 0F,W |
051E: MOVWF 7A |
051F: MOVF 0E,W |
0520: MOVWF 77 |
0521: MOVF 0F,W |
0522: SUBWF 7A,W |
0523: BTFSS 03.2 |
0524: GOTO 51D |
0525: MOVF 77,W |
0526: MOVWF 41 |
0527: MOVF 7A,W |
0528: MOVWF 42 |
0529: MOVF 42,W |
052A: SUBLW 27 |
052B: BTFSS 03.0 |
052C: GOTO 533 |
052D: BTFSS 03.2 |
052E: GOTO 51D |
052F: MOVF 41,W |
0530: SUBLW 0F |
0531: BTFSC 03.0 |
0532: GOTO 51D |
0533: INCF 2F,F |
0534: BTFSC 03.2 |
0535: INCF 30,F |
0536: GOTO 511 |
.................... set_timer1(0); while ( get_timer1() < ticks ) ; |
0537: CLRF 0F |
0538: CLRF 0E |
0539: MOVF 0F,W |
053A: MOVWF 7A |
053B: MOVF 0E,W |
053C: MOVWF 77 |
053D: MOVF 0F,W |
053E: SUBWF 7A,W |
053F: BTFSS 03.2 |
0540: GOTO 539 |
0541: MOVF 77,W |
0542: MOVWF 41 |
0543: MOVF 7A,W |
0544: MOVWF 42 |
0545: MOVF 42,W |
0546: SUBWF 3F,W |
0547: BTFSS 03.0 |
0548: GOTO 54F |
0549: BTFSS 03.2 |
054A: GOTO 539 |
054B: MOVF 3E,W |
054C: SUBWF 41,W |
054D: BTFSS 03.0 |
054E: GOTO 539 |
.................... output_high(SYNC); |
054F: BSF 03.5 |
0550: BCF 06.4 |
0551: BCF 03.5 |
0552: BSF 06.4 |
.................... output_low(CLOCK); |
0553: BSF 03.5 |
0554: BCF 06.6 |
0555: BCF 03.5 |
0556: BCF 06.6 |
.................... delay_ms(10); |
0557: MOVLW 0A |
0558: MOVWF 42 |
0559: CALL 0E6 |
.................... output_high(HACK); |
055A: BSF 03.5 |
055B: BCF 06.5 |
055C: BCF 03.5 |
055D: BSF 06.5 |
.................... delay_ms(10000); |
055E: MOVLW 28 |
055F: MOVWF 41 |
0560: MOVLW FA |
0561: MOVWF 42 |
0562: CALL 0E6 |
0563: DECFSZ 41,F |
0564: GOTO 560 |
.................... output_low(HACK); |
0565: BSF 03.5 |
0566: BCF 06.5 |
0567: BCF 03.5 |
0568: BCF 06.5 |
.................... output_low(SYNC); |
0569: BSF 03.5 |
056A: BCF 06.4 |
056B: BCF 03.5 |
056C: BCF 06.4 |
.................... input(CLOCK); |
056D: BSF 03.5 |
056E: BSF 06.6 |
.................... break; |
056F: BCF 03.5 |
0570: GOTO 61A |
.................... |
.................... case 'i': // Info |
.................... printf("%s\n\r", ver); |
0571: CLRF 41 |
0572: MOVF 41,W |
0573: CALL 03F |
0574: IORLW 00 |
0575: BTFSC 03.2 |
0576: GOTO 57B |
0577: INCF 41,F |
0578: MOVWF 4C |
0579: CALL 0FE |
057A: GOTO 572 |
057B: MOVLW 0A |
057C: MOVWF 4C |
057D: CALL 0FE |
057E: MOVLW 0D |
057F: MOVWF 4C |
0580: CALL 0FE |
.................... printf("%Lue4 + %Lu ticks", prescale, ticks); |
0581: MOVLW 10 |
0582: MOVWF 04 |
0583: MOVF 3D,W |
0584: MOVWF 44 |
0585: MOVF 3C,W |
0586: MOVWF 43 |
0587: CALL 15F |
0588: MOVLW 03 |
0589: MOVWF 41 |
058A: MOVF 41,W |
058B: CALL 09D |
058C: INCF 41,F |
058D: MOVWF 77 |
058E: MOVWF 4C |
058F: CALL 0FE |
0590: MOVLW 08 |
0591: SUBWF 41,W |
0592: BTFSS 03.2 |
0593: GOTO 58A |
0594: MOVLW 10 |
0595: MOVWF 04 |
0596: MOVF 3F,W |
0597: MOVWF 44 |
0598: MOVF 3E,W |
0599: MOVWF 43 |
059A: CALL 15F |
059B: MOVLW 0B |
059C: MOVWF 42 |
059D: MOVF 42,W |
059E: CALL 09D |
059F: INCF 42,F |
05A0: MOVWF 77 |
05A1: MOVWF 4C |
05A2: CALL 0FE |
05A3: MOVLW 11 |
05A4: SUBWF 42,W |
05A5: BTFSS 03.2 |
05A6: GOTO 59D |
.................... break; |
05A7: GOTO 61A |
.................... |
.................... case 'p': |
.................... if (isdigit(string[1])) |
05A8: MOVF 33,W |
05A9: SUBLW 2F |
05AA: BTFSC 03.0 |
05AB: GOTO 5DF |
05AC: MOVF 33,W |
05AD: SUBLW 39 |
05AE: BTFSS 03.0 |
05AF: GOTO 5DF |
.................... { |
.................... prescale=atol(string+1); |
05B0: CLRF 42 |
05B1: MOVLW 33 |
05B2: MOVWF 41 |
05B3: CALL 242 |
05B4: MOVF 79,W |
05B5: MOVWF 3D |
05B6: MOVF 78,W |
05B7: MOVWF 3C |
.................... printf("%Lu x 10000 prescale", prescale); |
05B8: MOVLW 10 |
05B9: MOVWF 04 |
05BA: MOVF 3D,W |
05BB: MOVWF 44 |
05BC: MOVF 3C,W |
05BD: MOVWF 43 |
05BE: CALL 15F |
05BF: MOVLW 03 |
05C0: MOVWF 41 |
05C1: MOVF 41,W |
05C2: CALL 0B3 |
05C3: INCF 41,F |
05C4: MOVWF 77 |
05C5: MOVWF 4C |
05C6: CALL 0FE |
05C7: MOVLW 07 |
05C8: SUBWF 41,W |
05C9: BTFSS 03.2 |
05CA: GOTO 5C1 |
05CB: MOVLW 04 |
05CC: MOVWF 42 |
05CD: MOVLW 30 |
05CE: MOVWF 4C |
05CF: CALL 0FE |
05D0: DECFSZ 42,F |
05D1: GOTO 5CD |
05D2: MOVLW 07 |
05D3: MOVWF 43 |
05D4: MOVF 43,W |
05D5: CALL 0B3 |
05D6: INCF 43,F |
05D7: MOVWF 77 |
05D8: MOVWF 4C |
05D9: CALL 0FE |
05DA: MOVLW 10 |
05DB: SUBWF 43,W |
05DC: BTFSS 03.2 |
05DD: GOTO 5D4 |
.................... } |
.................... else |
05DE: GOTO 5EA |
.................... printf("Error"); |
05DF: CLRF 41 |
05E0: MOVF 41,W |
05E1: CALL 0C8 |
05E2: INCF 41,F |
05E3: MOVWF 77 |
05E4: MOVWF 4C |
05E5: CALL 0FE |
05E6: MOVLW 05 |
05E7: SUBWF 41,W |
05E8: BTFSS 03.2 |
05E9: GOTO 5E0 |
.................... break; |
05EA: GOTO 61A |
.................... |
.................... default: // fine ticks number |
.................... if (isdigit(string[0])) |
05EB: MOVF 32,W |
05EC: SUBLW 2F |
05ED: BTFSC 03.0 |
05EE: GOTO 60F |
05EF: MOVF 32,W |
05F0: SUBLW 39 |
05F1: BTFSS 03.0 |
05F2: GOTO 60F |
.................... { |
.................... ticks=atol(string); |
05F3: CLRF 42 |
05F4: MOVLW 32 |
05F5: MOVWF 41 |
05F6: CALL 242 |
05F7: MOVF 79,W |
05F8: MOVWF 3F |
05F9: MOVF 78,W |
05FA: MOVWF 3E |
.................... printf("%Lu ticks", ticks); |
05FB: MOVLW 10 |
05FC: MOVWF 04 |
05FD: MOVF 3F,W |
05FE: MOVWF 44 |
05FF: MOVF 3E,W |
0600: MOVWF 43 |
0601: CALL 15F |
0602: MOVLW 03 |
0603: MOVWF 41 |
0604: MOVF 41,W |
0605: CALL 0D2 |
0606: INCF 41,F |
0607: MOVWF 77 |
0608: MOVWF 4C |
0609: CALL 0FE |
060A: MOVLW 09 |
060B: SUBWF 41,W |
060C: BTFSS 03.2 |
060D: GOTO 604 |
.................... } |
.................... else |
060E: GOTO 61A |
.................... printf("Error"); |
060F: CLRF 41 |
0610: MOVF 41,W |
0611: CALL 0C8 |
0612: INCF 41,F |
0613: MOVWF 77 |
0614: MOVWF 4C |
0615: CALL 0FE |
0616: MOVLW 05 |
0617: SUBWF 41,W |
0618: BTFSS 03.2 |
0619: GOTO 610 |
.................... }; |
.................... |
.................... }; |
061A: GOTO 3B6 |
.................... |
.................... while(true) |
.................... { |
.................... output_low(PIN_B4); |
061B: BSF 03.5 |
061C: BCF 06.4 |
061D: BCF 03.5 |
061E: BCF 06.4 |
.................... delay_ms(300); |
061F: MOVLW 02 |
0620: MOVWF 41 |
0621: MOVLW 96 |
0622: MOVWF 42 |
0623: CALL 0E6 |
0624: DECFSZ 41,F |
0625: GOTO 621 |
.................... output_high(PIN_B4); |
0626: BSF 03.5 |
0627: BCF 06.4 |
0628: BCF 03.5 |
0629: BSF 06.4 |
.................... delay_ms(300); |
062A: MOVLW 02 |
062B: MOVWF 41 |
062C: MOVLW 96 |
062D: MOVWF 42 |
062E: CALL 0E6 |
062F: DECFSZ 41,F |
0630: GOTO 62C |
.................... } |
0631: GOTO 61B |
.................... } |
.................... |
0632: GOTO 632 |
Configuration Fuses: |
Word 1: 3731 NOWDT PUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT DEBUG CCPB0 NOPROTECT INTRC |
Word 2: 3FFC NOFCMEN NOIESO |
/programy/PIC_C/hack/hack.PJT |
---|
0,0 → 1,56 |
[PROJECT] |
Target=hack.HEX |
Development_Mode= |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include=C:\Program Files\PICC\devices\;C:\Program Files\PICC\Drivers; |
Library= |
LinkerScript= |
[Target Data] |
FileList=hack.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[hack.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=hack.c |
[Windows] |
0=0000 hack.c 0 0 796 451 3 0 |
[Opened Files] |
1=D:\KAKLIK\programy\PIC_C\hack\hack.c |
2=C:\Program Files\PICC\devices\16F88.h |
3=D:\KAKLIK\programy\PIC_C\hack\hack.h |
4=C:\Program Files\PICC\Drivers\stdlib.h |
5=C:\Program Files\PICC\Drivers\stddef.h |
6=C:\Program Files\PICC\Drivers\string.h |
7=C:\Program Files\PICC\Drivers\ctype.h |
8= |
[debugperif] |
selected=Analog/Digital Conv |
[debugram] |
autoread=1 |
[debugeedata] |
autoread=1 |
[debugbreak] |
count=0 |
[pcwdebug] |
watchcol0=75 |
[debugwatch] |
count=0 |
[debugexpr] |
expr= |
sideeffects=0 |
/programy/PIC_C/hack/hack.SYM |
---|
0,0 → 1,107 |
015-016 CCP_1 |
015 CCP_1_LOW |
016 CCP_1_HIGH |
020 @INTERRUPT_AREA |
021 @INTERRUPT_AREA |
022 @INTERRUPT_AREA |
023 @INTERRUPT_AREA |
024 @INTERRUPT_AREA |
025 @INTERRUPT_AREA |
026 @INTERRUPT_AREA |
027 @INTERRUPT_AREA |
028 @INTERRUPT_AREA |
029-02A strtok.save |
02B-02E _Randseed |
02F-030 main.i |
031 main.ch |
032-03B main.string |
03C-03D main.prescale |
03E-03F main.ticks |
040 main.n |
041-042 atol.s |
041 @GETCH_1_.@SCRATCH |
041 main.@SCRATCH |
042 @delay_ms1.P1 |
042 main.@SCRATCH |
043-044 atol.result |
043-044 @PRINTF_LU_1200_51_50.P1 |
043 main.@SCRATCH |
044 @PRINTF_U_1200_51_50.P1 |
045 @PRINTF_U_1200_51_50.P1 |
045 atol.sign |
045 @PRINTF_LU_1200_51_50.@SCRATCH |
046 atol.base |
046 @DIV88.P1 |
046 @PRINTF_LU_1200_51_50.@SCRATCH |
047 @DIV88.P1 |
047 atol.index |
047 @PRINTF_LU_1200_51_50.@SCRATCH |
048 atol.c |
048 @PRINTF_LU_1200_51_50.@SCRATCH |
048 @DIV88.@SCRATCH |
049-04A @MUL1616.P1 |
049 atol.@SCRATCH |
049 @PRINTF_LU_1200_51_50.@SCRATCH |
04A atol.@SCRATCH |
04A @PRINTF_LU_1200_51_50.@SCRATCH |
04B-04C @MUL1616.P1 |
04B atol.@SCRATCH |
04B @PRINTF_LU_1200_51_50.@SCRATCH |
04C @PUTCHAR_1_.P1 |
04D @MUL1616.@SCRATCH |
077 @SCRATCH |
078 @SCRATCH |
078 _RETURN_ |
079 @SCRATCH |
07A @SCRATCH |
07B @SCRATCH |
09C.6 C1OUT |
09C.7 C2OUT |
00E6 @delay_ms1 |
00FE @PUTCHAR_1_ |
012A @GETCH_1_ |
022C @MUL1616 |
0242 atol |
00E0 TIMER1_isr |
00E3 TIMER2_isr |
003F @const290 |
0342 main |
004E @const11193 |
0059 @const11223 |
015F @PRINTF_LU_1200_51_50 |
006C @const11259 |
01C9 @DIV88 |
01DE @PRINTF_U_1200_51_50 |
0088 @const11300 |
009D @const11330 |
00B3 @const11344 |
00C8 @const11352 |
00D2 @const11365 |
0342 @cinit |
Project Files: |
D:\KAKLIK\programy\PIC_C\hack\hack.c |
D:\KAKLIK\programy\PIC_C\hack\hack.h |
C:\Program Files\PICC\devices\16F88.h |
C:\Program Files\PICC\Drivers\stdlib.h |
C:\Program Files\PICC\Drivers\stddef.h |
C:\Program Files\PICC\Drivers\string.h |
C:\Program Files\PICC\Drivers\ctype.h |
Compiler Settings: |
Processor: PIC16F88 |
Pointer Size: 16 |
ADC Range: 0-255 |
Opt Level: 9 |
Short,Int,Long: 1,8,16 |
ICD Provisions: Yes |
Output Files: |
Errors: D:\KAKLIK\programy\PIC_C\hack\hack.err |
INHX8: D:\KAKLIK\programy\PIC_C\hack\hack.HEX |
Symbols: D:\KAKLIK\programy\PIC_C\hack\hack.SYM |
List: D:\KAKLIK\programy\PIC_C\hack\hack.LST |
Debug/COFF: D:\KAKLIK\programy\PIC_C\hack\hack.cof |
Call Tree: D:\KAKLIK\programy\PIC_C\hack\hack.tre |
Statistics: D:\KAKLIK\programy\PIC_C\hack\hack.sta |
/programy/PIC_C/hack/hack.c |
---|
0,0 → 1,137 |
#include ".\hack.h" |
#include <stdlib.h> |
#define SYNC PIN_B4 // Spousteni oscyloskopu |
#define HACK PIN_B5 // Zkratovani napajeni SmartCard |
#define CLOCK PIN_B6 // Hodiny ze SmartCard |
#int_TIMER1 |
TIMER1_isr() |
{ |
} |
#int_TIMER2 |
TIMER2_isr() |
{ |
} |
void main() |
{ |
unsigned int16 i; |
char ch; |
char string[10]; |
const char ver[]={"HACK v1.0\0"}; |
unsigned int16 prescale; |
unsigned int16 ticks; |
int n; |
setup_adc_ports(NO_ANALOGS|VSS_VDD); |
setup_adc(ADC_OFF); |
setup_spi(FALSE); |
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1); |
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1); |
// setup_timer_1(T1_INTERNAL|T1_DIV_BY_8); |
setup_timer_2(T2_DISABLED,0,1); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
// enable_interrupts(INT_TIMER1); |
// enable_interrupts(INT_TIMER2); |
// enable_interrupts(GLOBAL); |
setup_oscillator(OSC_4MHZ|OSC_INTRC); // 4 MHz interni RC oscilator |
delay_ms(100); |
printf("\n\r\n\r%s", ver); |
output_low(SYNC); |
output_low(HACK); |
ticks=1; |
prescale=0; |
while(true) |
{ |
printf("\n\r>"); |
n=0; |
do |
{ |
ch=getchar(); |
printf("%c",ch); |
string[n++]=ch; |
} while((13 != ch) && (n < 10)); |
string[n]=0; |
printf("\n\r"); |
switch(string[0]) |
{ |
case 'g': // GO |
printf("%Lue4 + %Lu GO", prescale, ticks); |
for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
set_timer1(0); while ( get_timer1() < ticks ) ; |
output_high(SYNC); |
delay_ms(1); |
output_low(SYNC); |
break; |
case 'r': // REPEAT |
n=0; |
while(true) |
{ |
printf("%Lue4 + %Lu REPEAT %u\n\r", prescale, ticks, n++); |
for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
set_timer1(0); while ( get_timer1() < ticks ) ; |
output_high(SYNC); |
delay_ms(20); |
output_low(SYNC); |
delay_ms(2000); |
}; |
break; |
case 'h': // HACK |
printf("%Lue4 + %Lu HACK", prescale, ticks); |
for(i=0; i<prescale; i++) { set_timer1(0); while ( get_timer1() < 10000 ) ; }; |
set_timer1(0); while ( get_timer1() < ticks ) ; |
output_high(SYNC); |
output_low(CLOCK); |
delay_ms(10); |
output_high(HACK); |
delay_ms(10000); |
output_low(HACK); |
output_low(SYNC); |
input(CLOCK); |
break; |
case 'i': // Info |
printf("%s\n\r", ver); |
printf("%Lue4 + %Lu ticks", prescale, ticks); |
break; |
case 'p': |
if (isdigit(string[1])) |
{ |
prescale=atol(string+1); |
printf("%Lu x 10000 prescale", prescale); |
} |
else |
printf("Error"); |
break; |
default: // fine ticks number |
if (isdigit(string[0])) |
{ |
ticks=atol(string); |
printf("%Lu ticks", ticks); |
} |
else |
printf("Error"); |
}; |
}; |
while(true) |
{ |
output_low(PIN_B4); |
delay_ms(300); |
output_high(PIN_B4); |
delay_ms(300); |
} |
} |
/programy/PIC_C/hack/hack.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/hack/hack.err |
---|
0,0 → 1,0 |
No Errors |
/programy/PIC_C/hack/hack.h |
---|
0,0 → 1,11 |
#include <16F88.h> |
#device *=16 |
#device ICD=TRUE |
#device adc=8 |
#fuses NOWDT,INTRC , NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
//#fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO |
#use delay(clock=4000000,RESTART_WDT) |
//#use rs232(baud=2400,xmit=PIN_B3) |
//#use rs232(DEBUGGER) |
#use rs232(baud=1200,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) |
/programy/PIC_C/hack/hack.sta |
---|
0,0 → 1,52 |
ROM used: 1587 (41%) |
1587 (41%) including unused fragments |
1 Average locations per line |
3 Average locations per statement |
RAM used: 41 (11%) at main() level |
51 (14%) worst case |
Lines Stmts % Files |
----- ----- --- ----- |
138 101 18 D:\KAKLIK\programy\PIC_C\hack\hack.c |
12 0 0 D:\KAKLIK\programy\PIC_C\hack\hack.h |
275 0 0 C:\Program Files\PICC\devices\16F88.h |
758 324 50 C:\Program Files\PICC\Drivers\stdlib.h |
28 0 0 C:\Program Files\PICC\Drivers\stddef.h |
417 126 13 C:\Program Files\PICC\Drivers\string.h |
28 0 0 C:\Program Files\PICC\Drivers\ctype.h |
----- ----- |
3312 1102 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 24 2 1 @delay_ms1 |
0 44 3 1 @PUTCHAR_1_ |
0 53 3 1 @GETCH_1_ |
0 22 1 5 @MUL1616 |
0 256 16 11 atol |
0 3 0 0 TIMER1_isr |
0 3 0 0 TIMER2_isr |
0 15 1 0 @const290 |
0 753 47 21 main |
0 11 1 0 @const11193 |
0 19 1 0 @const11223 |
0 106 7 9 @PRINTF_LU_1200_51_50 |
0 28 2 0 @const11259 |
0 21 1 3 @DIV88 |
0 78 5 2 @PRINTF_U_1200_51_50 |
0 21 1 0 @const11300 |
0 22 1 0 @const11330 |
0 21 1 0 @const11344 |
0 10 1 0 @const11352 |
0 14 1 0 @const11365 |
Segment Used Free |
--------- ---- ---- |
00000-00003 4 0 |
00004-0003E 59 0 |
0003F-007FF 1524 461 |
00800-00EFF 0 1792 |
/programy/PIC_C/hack/hack.tre |
---|
0,0 → 1,100 |
ÀÄhack |
ÃÄmain 0/753 Ram=21 |
³ ÃÄ??0?? |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@const11193 0/11 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const290 0/15 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@GETCH_1_ 0/53 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11223 0/19 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11259 0/28 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11259 0/28 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_U_1200_51_50 0/78 Ram=2 |
³ ³ ÃÄ@DIV88 0/21 Ram=3 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÃÄ@DIV88 0/21 Ram=3 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11300 0/21 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11300 0/21 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÃÄ@const290 0/15 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11330 0/22 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11330 0/22 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄatol 0/256 Ram=11 |
³ ³ ÀÄ@MUL1616 0/22 Ram=5 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11344 0/21 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11344 0/21 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11352 0/10 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄatol 0/256 Ram=11 |
³ ³ ÀÄ@MUL1616 0/22 Ram=5 |
³ ÃÄ@PRINTF_LU_1200_51_50 0/106 Ram=9 |
³ ³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ³ ÀÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11365 0/14 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@const11352 0/10 Ram=0 |
³ ÃÄ@PUTCHAR_1_ 0/44 Ram=1 |
³ ÃÄ@delay_ms1 0/24 Ram=1 |
³ ÀÄ@delay_ms1 0/24 Ram=1 |
ÃÄTIMER1_isr 0/3 Ram=0 |
ÀÄTIMER2_isr 0/3 Ram=0 |
/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 |
---|
--- mereni/tester serv/blikac.BAK (nonexistent) |
+++ mereni/tester serv/blikac.BAK (revision 52) |
@@ -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 |
/programy/PIC_C/motory/DC/regulator_letadlo/main.BAK |
---|
0,0 → 1,14 |
#include "D:\@Kaklik\programy\PIC_C\motory\DC\regulator_letadlo\main.h" |
void main() |
{ |
while (true) |
{ |
output_high(pin_A1); |
Delay_us(50); |
output_low(pin_A1); |
Delay_us(500); |
} |
} |
/programy/PIC_C/motory/DC/regulator_letadlo/main.HEX |
---|
0,0 → 1,7 |
:1000000000308A000428000084011F308305831615 |
:1000100085108312851403308C008C0B0D288316F9 |
:1000200085108312851031308C008C0B1528000050 |
:0600300000000728630038 |
:02400E00F93F78 |
:00000001FF |
;PIC16F84 |
/programy/PIC_C/motory/DC/regulator_letadlo/main.LST |
---|
0,0 → 1,62 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\motory\dc\regulator_letadlo\main.LST |
ROM used: 27 (3%) |
Largest free fragment is 997 |
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\motory\DC\regulator_letadlo\main.h" |
.................... #include <16F84.h> |
.................... //////// Standard Header file for the PIC16F84 device //////////////// |
.................... #device PIC16F84 |
.................... #list |
.................... |
.................... #use delay(clock=4000000) |
.................... #fuses XT,NOWDT |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0004: CLRF 04 |
0005: MOVLW 1F |
0006: ANDWF 03,F |
.................... while (true) |
.................... { |
.................... |
.................... output_high(pin_A1); |
0007: BSF 03.5 |
0008: BCF 05.1 |
0009: BCF 03.5 |
000A: BSF 05.1 |
.................... Delay_us(10); |
000B: MOVLW 03 |
000C: MOVWF 0C |
000D: DECFSZ 0C,F |
000E: GOTO 00D |
.................... output_low(pin_A1); |
000F: BSF 03.5 |
0010: BCF 05.1 |
0011: BCF 03.5 |
0012: BCF 05.1 |
.................... Delay_us(150); |
0013: MOVLW 31 |
0014: MOVWF 0C |
0015: DECFSZ 0C,F |
0016: GOTO 015 |
0017: NOP |
0018: NOP |
.................... } |
0019: GOTO 007 |
.................... } |
.................... |
001A: SLEEP |
/programy/PIC_C/motory/DC/regulator_letadlo/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/motory/DC/regulator_letadlo/main.SYM |
---|
0,0 → 1,12 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
delay_ms.P1 |
delay_us.P2 |
0004 main |
Project Files: |
d:\@kaklik\programy\pic_c\motory\dc\regulator_letadlo\main.c |
D:\@Kaklik\programy\PIC_C\motory\DC\regulator_letadlo\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
/programy/PIC_C/motory/DC/regulator_letadlo/main.c |
---|
0,0 → 1,14 |
#include "D:\@Kaklik\programy\PIC_C\motory\DC\regulator_letadlo\main.h" |
void main() |
{ |
while (true) |
{ |
output_high(pin_A1); |
Delay_us(10); |
output_low(pin_A1); |
Delay_us(150); |
} |
} |
/programy/PIC_C/motory/DC/regulator_letadlo/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/motory/DC/regulator_letadlo/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/PIC_C/motory/DC/regulator_letadlo/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses XT,NOWDT |
/programy/PIC_C/motory/DC/regulator_letadlo/main.sta |
---|
0,0 → 1,27 |
ROM used: 27 (3%) |
997 (97%) 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 |
----- ----- --- ----- |
15 6 100 d:\@kaklik\programy\pic_c\motory\dc\regulator_letadlo\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\motory\DC\regulator_letadlo\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
----- ----- |
262 12 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 23 85 0 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 23 997 |
/programy/PIC_C/motory/DC/regulator_letadlo/main.tre |
---|
0,0 → 1,3 |
ÀÄmain |
ÀÄmain 0/23 Ram=0 |
ÀÄ??0?? |
/programy/PIC_C/motory/DC/regulator_letadlo/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/motory/DC/regulator_letadlo/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/motory/hodinovy/Run.BAT |
---|
0,0 → 1,8 |
@echo off |
:loop |
picpgr reset PIC16F84 |
picpgr run |
pause |
picpgr stop |
pause |
goto loop |
/programy/PIC_C/motory/hodinovy/main.BAK |
---|
0,0 → 1,22 |
#include "D:\@Kaklik\programy\PIC_C\motory\main.h" |
void main() |
{ |
while (true) |
{ |
Delay_ms(15); |
output_high(pin_A0); |
output_low(pin_A1); |
// output_high(pin_A2); |
// Delay_ms(10); |
// output_low(pin_A2); |
Delay_ms(15); |
output_low(pin_A0); |
output_high(pin_A1); |
} |
} |
/programy/PIC_C/motory/hodinovy/main.HEX |
---|
0,0 → 1,10 |
:1000000000308A00192800000F308400000803190E |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003484011F30830519308F00042083169B |
:10004000051083120514831685108312851019304C |
:100050008F00042083160510831205108316851067 |
:08006000831285141C286300C3 |
:02400E00FD3F74 |
:00000001FF |
;PIC16F84 |
/programy/PIC_C/motory/hodinovy/main.LST |
---|
0,0 → 1,95 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\motory\main.LST |
ROM used: 52 (5%) |
Largest free fragment is 972 |
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\motory\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,WDT |
.................... |
.................... |
.................... |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
.................... while (true) |
.................... { |
.................... |
.................... Delay_ms(25); |
001C: MOVLW 19 |
001D: MOVWF 0F |
001E: CALL 004 |
.................... |
.................... output_high(pin_A0); |
001F: BSF 03.5 |
0020: BCF 05.0 |
0021: BCF 03.5 |
0022: BSF 05.0 |
.................... output_low(pin_A1); |
0023: BSF 03.5 |
0024: BCF 05.1 |
0025: BCF 03.5 |
0026: BCF 05.1 |
.................... |
.................... // output_high(pin_A2); |
.................... // Delay_ms(10); |
.................... // output_low(pin_A2); |
.................... Delay_ms(25); |
0027: MOVLW 19 |
0028: MOVWF 0F |
0029: CALL 004 |
.................... |
.................... output_low(pin_A0); |
002A: BSF 03.5 |
002B: BCF 05.0 |
002C: BCF 03.5 |
002D: BCF 05.0 |
.................... output_high(pin_A1); |
002E: BSF 03.5 |
002F: BCF 05.1 |
0030: BCF 03.5 |
0031: BSF 05.1 |
.................... } |
0032: GOTO 01C |
.................... } |
.................... |
0033: SLEEP |
/programy/PIC_C/motory/hodinovy/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/motory/hodinovy/main.SYM |
---|
0,0 → 1,14 |
00C @SCRATCH |
00D @SCRATCH |
00D _RETURN_ |
00F delay_ms.P1 |
delay_us.P1 |
0004 delay_ms |
0019 main |
0040 @cinit |
Project Files: |
d:\@kaklik\programy\pic_c\motory\main.c |
D:\@Kaklik\programy\PIC_C\motory\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
/programy/PIC_C/motory/hodinovy/main.c |
---|
0,0 → 1,22 |
#include "D:\@Kaklik\programy\PIC_C\motory\main.h" |
void main() |
{ |
while (true) |
{ |
Delay_ms(25); |
output_high(pin_A0); |
output_low(pin_A1); |
// output_high(pin_A2); |
// Delay_ms(10); |
// output_low(pin_A2); |
Delay_ms(25); |
output_low(pin_A0); |
output_high(pin_A1); |
} |
} |
/programy/PIC_C/motory/hodinovy/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/motory/hodinovy/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/PIC_C/motory/hodinovy/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses XT,WDT |
/programy/PIC_C/motory/hodinovy/main.sta |
---|
0,0 → 1,28 |
ROM used: 52 (5%) |
972 (95%) 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 |
----- ----- --- ----- |
23 8 100 d:\@kaklik\programy\pic_c\motory\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\motory\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
----- ----- |
278 16 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 40 1 delay_ms |
0 27 52 0 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 48 972 |
/programy/PIC_C/motory/hodinovy/main.tre |
---|
0,0 → 1,5 |
ÀÄmain |
ÀÄmain 0/27 Ram=0 |
ÃÄ??0?? |
ÃÄdelay_ms 0/21 Ram=1 |
ÀÄdelay_ms 0/21 Ram=1 |
/programy/PIC_C/motory/hodinovy/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/motory/hodinovy/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/motory/krokac/A.BAT |
---|
0,0 → 1,3 |
call picpgr erase pic16f88 |
call picpgr program krokac.hex hex pic16f88 |
call picpgr run |
/programy/PIC_C/motory/krokac/KROKAC.C |
---|
0,0 → 1,139 |
#include "C:\MIHO_DAT\KROKAC\krokac.h" |
unsigned int StepState; // Vnitrni promenna kroku |
signed int StepDirection; // Smer +1/0/-1 |
byte const StepTab[8]={ // Tabulka pro krokovy motor |
0b0001, // 0 |
0b0101, // 1 |
0b0100, // 2 |
0b0110, // 3 |
0b0010, // 4 |
0b1010, // 5 |
0b1000 // 6 |
0b1001, // 7 |
}; |
#INT_TIMER2 |
void StepNext() |
{ |
unsigned int i; |
StepState+=StepDirection; // posun se na dalsi krok |
i=StepState&0b111; // vezmi spodni 3 bity stavu |
i=StepTab[i]; // prekoduj pomoci tabulky |
output_bit(MOTORA,i&0b0001); // aktivuj jednotlive vystupy |
output_bit(MOTORB,i&0b0010); |
output_bit(MOTORC,i&0b0100); |
output_bit(MOTORD,i&0b1000); |
} |
void StepSetDirection(signed int Direction) |
{ |
if(Direction> 1) Direction= 1; |
if(Direction<-1) Direction=-1; |
StepDirection=Direction; |
} |
void StepSetTime(unsigned int16 Time) |
{ |
} |
void Delay(unsigned int16 Time) |
{ |
while(Time>255) {Time-=256;delay_us(256);}; |
if(Time!=0) delay_us(Time); |
} |
void main() |
{ |
unsigned int16 T; |
unsigned long int i; |
// Nastav pracovni frekvenci procesoru |
setup_oscillator(OSC_4MHZ); |
// Vypni motorovy vystup |
output_low(MOTORA); |
output_low(MOTORB); |
output_low(MOTORC); |
output_low(MOTORD); |
// Vstupy s pull-up odporem |
port_b_pullups(TRUE); |
// Inicializace A/D prevodniku |
setup_adc_ports(sAN0|VSS_VDD); |
setup_adc(ADC_CLOCK_INTERNAL); |
set_adc_channel(0); |
// Dalsi inicializace |
setup_spi(FALSE); |
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
setup_timer_1(T1_DISABLED); |
setup_comparator(NC_NC_NC_NC); |
setup_vref(FALSE); |
// Inicializace stavovych promennych |
StepState=0; |
// Nastaveni casovace |
setup_timer_2(T2_DIV_BY_16,0xFF,1); |
// Nastveni preruseni od casovace |
enable_interrupts(global); |
enable_interrupts(int_timer2); |
for(;;) |
{ |
T=read_adc(ADC_READ_ONLY); // Prectu hodnotu |
read_adc(ADC_START_ONLY); // Ostartuji dalsi prevod (na pozadi) |
//setup_timer_2(T2_DIV_BY_16,T,1); |
if(T>0) *0x92=T; // Preload register casovace |
// Podle prepinacu se hybu |
if(input(PIN_B5)) |
{ |
if(input(PIN_B4)) StepSetDirection(1); else StepSetDirection(-1); |
} |
else |
{ int1 x; // pomocna promenna aby se volalo spozdeni jen 1x |
if (StepState>230) { |
if (!input(PIN_B4) && (x)) |
{ |
StepSetDirection(0); |
delay_ms(500); |
x=0; |
}; |
StepSetDirection(-1); |
} |
if (StepState<30) { |
StepSetDirection( 1); |
x=1; |
} |
} |
//StepDirection=2; |
//for(i=0;i<800;i++) |
//{ |
// StepNext(); |
// Delay(T); |
//} |
//delay_ms(10); |
//StepDirection=-1; |
//for(i=0;i<800;i++) |
//{ |
// StepNext(); |
// Delay(T); |
//} |
//delay_ms(10); |
} // Cyklus for |
} |
/programy/PIC_C/motory/krokac/KROKAC.H |
---|
0,0 → 1,23 |
#include <16F88.h> |
//#device ICD=TRUE |
#device adc=8 |
#FUSES NOWDT //No Watch Dog Timer |
#FUSES RC //Resistor/Capacitor Osc with CLKOUT |
#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 DEBUG //Debug mode for use with ICD |
#FUSES NOPROTECT //Code not protected from reading |
#FUSES FCMEN //Fail-safe clock monitor enabled |
#FUSES IESO //Internal External Switch Over mode enabled |
#use delay(clock=4000000) |
#define MOTORA PIN_B0 |
#define MOTORB PIN_B1 |
#define MOTORC PIN_B2 |
#define MOTORD PIN_B3 |
/programy/PIC_C/motory/krokac/KROKAC.HEX |
---|
0,0 → 1,44 |
:1000000000308A0098280000FF00030E8301A10041 |
:100010007F08A0000A08A8008A01A00E0408A20018 |
:100020007708A3007808A4007908A5007A08A6003C |
:100030007B08A700831383128C308400801C222845 |
:100040008C183528220884002308F7002408F800BB |
:100050002508F9002608FA002708FB0028088A006E |
:10006000210E8300FF0E7F0E09008A1143280A101B |
:100070008A100A118207013405340434063402342C |
:100080000A34083409342A082907A900290807393D |
:10009000B20032083720F800B2003218512806109A |
:1000A00052280614831606108312B2185928861097 |
:1000B0005A28861483168610831232196128061175 |
:1000C00062280615831606118312B2196928861153 |
:1000D0006A2886158316861183128C108A112228AD |
:1000E000B01B78283008013C031878280130B00094 |
:1000F0003008803A7E3C031C7F28FF30B000300877 |
:10010000AA00003431308400000803199628013019 |
:10011000F800F701F70B8A28F80B89284A30F70016 |
:10012000F70B902800000000800B87288A113029E7 |
:1001300084011F30830583161F129F121B0880390C |
:100140009B0007309C001C0883120D13603083163F |
:100150008F000610831206108316861083128610F5 |
:1001600083160611831206118316861183128611D7 |
:10017000831681131F129F121B08803901389B00C0 |
:100180001F1383121F179F1783169F1383121F14A9 |
:100190000030F8001F08C73978049F0094128316B6 |
:1001A0000611861406120030831294008316940000 |
:1001B0000108C7390838810083129001073083167F |
:1001C0009C0005080330F700F70BE4281C08831295 |
:1001D0000D1383169D018312A9010030F800063823 |
:1001E0009200FF3083169200C03083128B04831676 |
:1001F0008C1483121F1DFE288316F9281E08AC01DB |
:10020000AB001F15AB08031D0829AC0803190C2906 |
:100210002B08831692008312831686168312861E7D |
:100220001E29831606168312061E1A290130B000F5 |
:1002300070201D29FF30B00070203E292908E63CBF |
:1002400003183629831606168312061A33292F1C23 |
:100250003329B00170200230B000FA30B10082289A |
:10026000B00B2D292F10FF30B000702029081D3C45 |
:10027000031C3E290130B00070202F148316F9288A |
:02028000630019 |
:04400E003B3FFF3FF6 |
:00000001FF |
;PIC16F88 |
/programy/PIC_C/motory/krokac/KROKAC.LST |
---|
0,0 → 1,495 |
CCS PCM C Compiler, Version 3.234, 27853 16-X-05 21:12 |
Filename: C:\MIHO_DAT\KROKAC\krokac.LST |
ROM used: 321 words (8%) |
Largest free fragment is 2048 |
RAM used: 21 (12%) at main() level |
24 (14%) worst case |
Stack: 3 worst case (1 in main + 2 for interrupts) |
* |
0000: MOVLW 00 |
0001: MOVWF 0A |
0002: GOTO 098 |
0003: NOP |
0004: MOVWF 7F |
0005: SWAPF 03,W |
0006: CLRF 03 |
0007: MOVWF 21 |
0008: MOVF 7F,W |
0009: MOVWF 20 |
000A: MOVF 0A,W |
000B: MOVWF 28 |
000C: CLRF 0A |
000D: SWAPF 20,F |
000E: MOVF 04,W |
000F: MOVWF 22 |
0010: MOVF 77,W |
0011: MOVWF 23 |
0012: MOVF 78,W |
0013: MOVWF 24 |
0014: MOVF 79,W |
0015: MOVWF 25 |
0016: MOVF 7A,W |
0017: MOVWF 26 |
0018: MOVF 7B,W |
0019: MOVWF 27 |
001A: BCF 03.7 |
001B: BCF 03.5 |
001C: MOVLW 8C |
001D: MOVWF 04 |
001E: BTFSS 00.1 |
001F: GOTO 022 |
0020: BTFSC 0C.1 |
0021: GOTO 035 |
0022: MOVF 22,W |
0023: MOVWF 04 |
0024: MOVF 23,W |
0025: MOVWF 77 |
0026: MOVF 24,W |
0027: MOVWF 78 |
0028: MOVF 25,W |
0029: MOVWF 79 |
002A: MOVF 26,W |
002B: MOVWF 7A |
002C: MOVF 27,W |
002D: MOVWF 7B |
002E: MOVF 28,W |
002F: MOVWF 0A |
0030: SWAPF 21,W |
0031: MOVWF 03 |
0032: SWAPF 7F,F |
0033: SWAPF 7F,W |
0034: RETFIE |
0035: BCF 0A.3 |
0036: GOTO 043 |
.................... #include "C:\MIHO_DAT\KROKAC\krokac.h" |
.................... #include <16F88.h> |
.................... //////// Standard Header file for the PIC16F88 device //////////////// |
.................... #device PIC16F88 |
.................... #list |
.................... |
.................... //#device ICD=TRUE |
.................... #device adc=8 |
.................... |
.................... #FUSES NOWDT //No Watch Dog Timer |
.................... #FUSES RC //Resistor/Capacitor Osc with CLKOUT |
.................... #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 DEBUG //Debug mode for use with ICD |
.................... #FUSES NOPROTECT //Code not protected from reading |
.................... #FUSES FCMEN //Fail-safe clock monitor enabled |
.................... #FUSES IESO //Internal External Switch Over mode enabled |
.................... |
.................... #use delay(clock=4000000) |
* |
0082: MOVLW 31 |
0083: MOVWF 04 |
0084: MOVF 00,W |
0085: BTFSC 03.2 |
0086: GOTO 096 |
0087: MOVLW 01 |
0088: MOVWF 78 |
0089: CLRF 77 |
008A: DECFSZ 77,F |
008B: GOTO 08A |
008C: DECFSZ 78,F |
008D: GOTO 089 |
008E: MOVLW 4A |
008F: MOVWF 77 |
0090: DECFSZ 77,F |
0091: GOTO 090 |
0092: NOP |
0093: NOP |
0094: DECFSZ 00,F |
0095: GOTO 087 |
0096: BCF 0A.3 |
0097: GOTO 130 (RETURN) |
.................... #define MOTORA PIN_B0 |
.................... #define MOTORB PIN_B1 |
.................... #define MOTORC PIN_B2 |
.................... #define MOTORD PIN_B3 |
.................... |
.................... |
.................... |
.................... |
.................... unsigned int StepState; // Vnitrni promenna kroku |
.................... signed int StepDirection; // Smer +1/0/-1 |
.................... |
.................... byte const StepTab[8]={ // Tabulka pro krokovy motor |
.................... 0b0001, // 0 |
.................... 0b0101, // 1 |
.................... 0b0100, // 2 |
.................... 0b0110, // 3 |
.................... 0b0010, // 4 |
.................... 0b1010, // 5 |
.................... 0b1000 // 6 |
.................... 0b1001, // 7 |
.................... }; |
.................... |
.................... #INT_TIMER2 |
.................... void StepNext() |
.................... { |
.................... unsigned int i; |
.................... |
.................... StepState+=StepDirection; // posun se na dalsi krok |
* |
0043: MOVF 2A,W |
0044: ADDWF 29,W |
0045: MOVWF 29 |
.................... i=StepState&0b111; // vezmi spodni 3 bity stavu |
0046: MOVF 29,W |
0047: ANDLW 07 |
0048: MOVWF 32 |
.................... i=StepTab[i]; // prekoduj pomoci tabulky |
0049: MOVF 32,W |
004A: CALL 037 |
004B: MOVWF 78 |
004C: MOVWF 32 |
.................... output_bit(MOTORA,i&0b0001); // aktivuj jednotlive vystupy |
004D: BTFSC 32.0 |
004E: GOTO 051 |
004F: BCF 06.0 |
0050: GOTO 052 |
0051: BSF 06.0 |
0052: BSF 03.5 |
0053: BCF 06.0 |
.................... output_bit(MOTORB,i&0b0010); |
0054: BCF 03.5 |
0055: BTFSC 32.1 |
0056: GOTO 059 |
0057: BCF 06.1 |
0058: GOTO 05A |
0059: BSF 06.1 |
005A: BSF 03.5 |
005B: BCF 06.1 |
.................... output_bit(MOTORC,i&0b0100); |
005C: BCF 03.5 |
005D: BTFSC 32.2 |
005E: GOTO 061 |
005F: BCF 06.2 |
0060: GOTO 062 |
0061: BSF 06.2 |
0062: BSF 03.5 |
0063: BCF 06.2 |
.................... output_bit(MOTORD,i&0b1000); |
0064: BCF 03.5 |
0065: BTFSC 32.3 |
0066: GOTO 069 |
0067: BCF 06.3 |
0068: GOTO 06A |
0069: BSF 06.3 |
006A: BSF 03.5 |
006B: BCF 06.3 |
.................... } |
.................... |
.................... |
006C: BCF 03.5 |
006D: BCF 0C.1 |
006E: BCF 0A.3 |
006F: GOTO 022 |
.................... void StepSetDirection(signed int Direction) |
.................... { |
.................... if(Direction> 1) Direction= 1; |
0070: BTFSC 30.7 |
0071: GOTO 078 |
0072: MOVF 30,W |
0073: SUBLW 01 |
0074: BTFSC 03.0 |
0075: GOTO 078 |
0076: MOVLW 01 |
0077: MOVWF 30 |
.................... if(Direction<-1) Direction=-1; |
0078: MOVF 30,W |
0079: XORLW 80 |
007A: SUBLW 7E |
007B: BTFSS 03.0 |
007C: GOTO 07F |
007D: MOVLW FF |
007E: MOVWF 30 |
.................... StepDirection=Direction; |
007F: MOVF 30,W |
0080: MOVWF 2A |
.................... } |
0081: RETLW 00 |
.................... |
.................... |
.................... void StepSetTime(unsigned int16 Time) |
.................... { |
.................... |
.................... } |
.................... |
.................... void Delay(unsigned int16 Time) |
.................... { |
.................... while(Time>255) {Time-=256;delay_us(256);}; |
.................... if(Time!=0) delay_us(Time); |
.................... } |
.................... |
.................... |
.................... void main() |
.................... { |
* |
0098: CLRF 04 |
0099: MOVLW 1F |
009A: ANDWF 03,F |
009B: BSF 03.5 |
009C: BCF 1F.4 |
009D: BCF 1F.5 |
009E: MOVF 1B,W |
009F: ANDLW 80 |
00A0: MOVWF 1B |
00A1: MOVLW 07 |
00A2: MOVWF 1C |
00A3: MOVF 1C,W |
00A4: BCF 03.5 |
00A5: BCF 0D.6 |
.................... unsigned int16 T; |
.................... unsigned long int i; |
.................... |
.................... // Nastav pracovni frekvenci procesoru |
.................... setup_oscillator(OSC_4MHZ); |
00A6: MOVLW 60 |
00A7: BSF 03.5 |
00A8: MOVWF 0F |
.................... |
.................... // Vypni motorovy vystup |
.................... output_low(MOTORA); |
00A9: BCF 06.0 |
00AA: BCF 03.5 |
00AB: BCF 06.0 |
.................... output_low(MOTORB); |
00AC: BSF 03.5 |
00AD: BCF 06.1 |
00AE: BCF 03.5 |
00AF: BCF 06.1 |
.................... output_low(MOTORC); |
00B0: BSF 03.5 |
00B1: BCF 06.2 |
00B2: BCF 03.5 |
00B3: BCF 06.2 |
.................... output_low(MOTORD); |
00B4: BSF 03.5 |
00B5: BCF 06.3 |
00B6: BCF 03.5 |
00B7: BCF 06.3 |
.................... |
.................... // Vstupy s pull-up odporem |
.................... port_b_pullups(TRUE); |
00B8: BSF 03.5 |
00B9: BCF 01.7 |
.................... |
.................... // Inicializace A/D prevodniku |
.................... setup_adc_ports(sAN0|VSS_VDD); |
00BA: BCF 1F.4 |
00BB: BCF 1F.5 |
00BC: MOVF 1B,W |
00BD: ANDLW 80 |
00BE: IORLW 01 |
00BF: MOVWF 1B |
.................... setup_adc(ADC_CLOCK_INTERNAL); |
00C0: BCF 1F.6 |
00C1: BCF 03.5 |
00C2: BSF 1F.6 |
00C3: BSF 1F.7 |
00C4: BSF 03.5 |
00C5: BCF 1F.7 |
00C6: BCF 03.5 |
00C7: BSF 1F.0 |
.................... set_adc_channel(0); |
00C8: MOVLW 00 |
00C9: MOVWF 78 |
00CA: MOVF 1F,W |
00CB: ANDLW C7 |
00CC: IORWF 78,W |
00CD: MOVWF 1F |
.................... |
.................... // Dalsi inicializace |
.................... setup_spi(FALSE); |
00CE: BCF 14.5 |
00CF: BSF 03.5 |
00D0: BCF 06.2 |
00D1: BSF 06.1 |
00D2: BCF 06.4 |
00D3: MOVLW 00 |
00D4: BCF 03.5 |
00D5: MOVWF 14 |
00D6: BSF 03.5 |
00D7: MOVWF 14 |
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); |
00D8: MOVF 01,W |
00D9: ANDLW C7 |
00DA: IORLW 08 |
00DB: MOVWF 01 |
.................... setup_timer_1(T1_DISABLED); |
00DC: BCF 03.5 |
00DD: CLRF 10 |
.................... setup_comparator(NC_NC_NC_NC); |
00DE: MOVLW 07 |
00DF: BSF 03.5 |
00E0: MOVWF 1C |
00E1: MOVF 05,W |
00E2: MOVLW 03 |
00E3: MOVWF 77 |
00E4: DECFSZ 77,F |
00E5: GOTO 0E4 |
00E6: MOVF 1C,W |
00E7: BCF 03.5 |
00E8: BCF 0D.6 |
.................... setup_vref(FALSE); |
00E9: BSF 03.5 |
00EA: CLRF 1D |
.................... |
.................... // Inicializace stavovych promennych |
.................... StepState=0; |
00EB: BCF 03.5 |
00EC: CLRF 29 |
.................... |
.................... // Nastaveni casovace |
.................... setup_timer_2(T2_DIV_BY_16,0xFF,1); |
00ED: MOVLW 00 |
00EE: MOVWF 78 |
00EF: IORLW 06 |
00F0: MOVWF 12 |
00F1: MOVLW FF |
00F2: BSF 03.5 |
00F3: MOVWF 12 |
.................... |
.................... // Nastveni preruseni od casovace |
.................... enable_interrupts(global); |
00F4: MOVLW C0 |
00F5: BCF 03.5 |
00F6: IORWF 0B,F |
.................... enable_interrupts(int_timer2); |
00F7: BSF 03.5 |
00F8: BSF 0C.1 |
.................... |
.................... for(;;) |
.................... { |
.................... |
.................... T=read_adc(ADC_READ_ONLY); // Prectu hodnotu |
00F9: BCF 03.5 |
00FA: BTFSS 1F.2 |
00FB: GOTO 0FE |
00FC: BSF 03.5 |
00FD: GOTO 0F9 |
00FE: MOVF 1E,W |
00FF: CLRF 2C |
0100: MOVWF 2B |
.................... read_adc(ADC_START_ONLY); // Ostartuji dalsi prevod (na pozadi) |
0101: BSF 1F.2 |
.................... |
.................... //setup_timer_2(T2_DIV_BY_16,T,1); |
.................... if(T>0) *0x92=T; // Preload register casovace |
0102: MOVF 2B,F |
0103: BTFSS 03.2 |
0104: GOTO 108 |
0105: MOVF 2C,F |
0106: BTFSC 03.2 |
0107: GOTO 10C |
0108: MOVF 2B,W |
0109: BSF 03.5 |
010A: MOVWF 12 |
010B: BCF 03.5 |
.................... |
.................... // Podle prepinacu se hybu |
.................... if(input(PIN_B5)) |
010C: BSF 03.5 |
010D: BSF 06.5 |
010E: BCF 03.5 |
010F: BTFSS 06.5 |
0110: GOTO 11E |
.................... { |
.................... if(input(PIN_B4)) StepSetDirection(1); else StepSetDirection(-1); |
0111: BSF 03.5 |
0112: BSF 06.4 |
0113: BCF 03.5 |
0114: BTFSS 06.4 |
0115: GOTO 11A |
0116: MOVLW 01 |
0117: MOVWF 30 |
0118: CALL 070 |
0119: GOTO 11D |
011A: MOVLW FF |
011B: MOVWF 30 |
011C: CALL 070 |
.................... } |
.................... else |
011D: GOTO 13E |
.................... { int1 x; // pomocna promenna aby se volalo spozdeni jen 1x |
.................... if (StepState>230) { |
011E: MOVF 29,W |
011F: SUBLW E6 |
0120: BTFSC 03.0 |
0121: GOTO 136 |
.................... if (!input(PIN_B4) && (x)) |
0122: BSF 03.5 |
0123: BSF 06.4 |
0124: BCF 03.5 |
0125: BTFSC 06.4 |
0126: GOTO 133 |
0127: BTFSS 2F.0 |
0128: GOTO 133 |
.................... { |
.................... StepSetDirection(0); |
0129: CLRF 30 |
012A: CALL 070 |
.................... delay_ms(500); |
012B: MOVLW 02 |
012C: MOVWF 30 |
012D: MOVLW FA |
012E: MOVWF 31 |
012F: GOTO 082 |
0130: DECFSZ 30,F |
0131: GOTO 12D |
.................... x=0; |
0132: BCF 2F.0 |
.................... }; |
.................... StepSetDirection(-1); |
0133: MOVLW FF |
0134: MOVWF 30 |
0135: CALL 070 |
.................... } |
.................... if (StepState<30) { |
0136: MOVF 29,W |
0137: SUBLW 1D |
0138: BTFSS 03.0 |
0139: GOTO 13E |
.................... StepSetDirection( 1); |
013A: MOVLW 01 |
013B: MOVWF 30 |
013C: CALL 070 |
.................... x=1; |
013D: BSF 2F.0 |
.................... } |
.................... } |
.................... //StepDirection=2; |
.................... //for(i=0;i<800;i++) |
.................... //{ |
.................... // StepNext(); |
.................... // Delay(T); |
.................... //} |
.................... //delay_ms(10); |
.................... //StepDirection=-1; |
.................... //for(i=0;i<800;i++) |
.................... //{ |
.................... // StepNext(); |
.................... // Delay(T); |
.................... //} |
.................... //delay_ms(10); |
.................... |
.................... } // Cyklus for |
013E: BSF 03.5 |
013F: GOTO 0F9 |
.................... |
.................... } |
.................... |
0140: SLEEP |
Configuration Fuses: |
Word 1: 3F3B NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB0 NOPROTECT RC |
Word 2: 3FFF FCMEN IESO |
/programy/PIC_C/motory/krokac/KROKAC.PJT |
---|
0,0 → 1,39 |
[PROJECT] |
Target=krokac.HEX |
Development_Mode= |
Processor=0x688F |
ToolSuite=CCS |
[Directories] |
Include=C:\PROGRAM FILES\PICC_3_234\devices\;C:\PROGRAM FILES\P |
Library= |
LinkerScript= |
[Target Data] |
FileList=krokac.c; |
BuildTool=C-COMPILER |
OptionString=+FM |
AdditionalOptionString= |
BuildRequired=1 |
[krokac.c] |
Type=4 |
Path= |
FileList= |
BuildTool= |
OptionString= |
AdditionalOptionString= |
[mru-list] |
1=krokac.c |
[Windows] |
0=0000 krokac.c 0 0 796 451 3 0 |
[Opened Files] |
1=C:\MIHO_DAT\KROKAC\krokac.c |
2=C:\MIHO_DAT\KROKAC\krokac.h |
3=C:\PROGRAM FILES\PICC_3_234\devices\16F88.h |
4=C:\MIHO_DAT\KROKAC\krokac.lst |
5= |
/programy/PIC_C/motory/menice/Run.BAT |
---|
0,0 → 1,8 |
@echo off |
:loop |
picpgr reset PIC16F84 |
picpgr run |
pause |
picpgr stop |
pause |
goto loop |
/programy/PIC_C/motory/menice/main.BAK |
---|
0,0 → 1,21 |
#include "D:\@Kaklik\programy\PIC_C\motory\menice\main.h" |
#DEFINE L1 pin_A0 |
#DEFINE L2 pin_A1 |
void main() |
{ |
output_low(L1); |
output_low(L2); |
while(true) |
{ |
output_high(L1); |
output_low(L2); |
Delay_ms(16); |
output_low(L1); |
output_high(L2); |
Delay_ms(16); |
} |
} |
/programy/PIC_C/motory/menice/main.HEX |
---|
0,0 → 1,11 |
:1000000000308A00192800000F308400000803190E |
:10001000182801308D008C018C0B0C288D0B0B28BF |
:100020004A308C008C0B122800000000800B09283D |
:10003000003484011F3083058316051083120510D8 |
:100040008316851083128510831685108312851000 |
:10005000831605108312051411308F0004208316B7 |
:100060000510831205108316851083128514113034 |
:080070008F0004202428630026 |
:02400E00FE3F73 |
:00000001FF |
;PIC16F84 |
/programy/PIC_C/motory/menice/main.LST |
---|
0,0 → 1,102 |
CCS PCW C Compiler, Version 3.110, 15448 |
Filename: d:\@kaklik\programy\pic_c\motory\menice\main.LST |
ROM used: 60 (6%) |
Largest free fragment is 964 |
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\motory\menice\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 HS,WDT |
.................... |
.................... |
.................... |
.................... #DEFINE L1 pin_A0 |
.................... #DEFINE L2 pin_A1 |
.................... |
.................... void main() |
.................... { |
0019: CLRF 04 |
001A: MOVLW 1F |
001B: ANDWF 03,F |
.................... output_low(L1); |
001C: BSF 03.5 |
001D: BCF 05.0 |
001E: BCF 03.5 |
001F: BCF 05.0 |
.................... output_low(L2); |
0020: BSF 03.5 |
0021: BCF 05.1 |
0022: BCF 03.5 |
0023: BCF 05.1 |
.................... |
.................... while(true) |
.................... { |
.................... output_low(L2); |
0024: BSF 03.5 |
0025: BCF 05.1 |
0026: BCF 03.5 |
0027: BCF 05.1 |
.................... output_high(L1); |
0028: BSF 03.5 |
0029: BCF 05.0 |
002A: BCF 03.5 |
002B: BSF 05.0 |
.................... Delay_ms(17); |
002C: MOVLW 11 |
002D: MOVWF 0F |
002E: CALL 004 |
.................... output_low(L1); |
002F: BSF 03.5 |
0030: BCF 05.0 |
0031: BCF 03.5 |
0032: BCF 05.0 |
.................... output_high(L2); |
0033: BSF 03.5 |
0034: BCF 05.1 |
0035: BCF 03.5 |
0036: BSF 05.1 |
.................... Delay_ms(17); |
0037: MOVLW 11 |
0038: MOVWF 0F |
0039: CALL 004 |
.................... |
.................... } |
003A: GOTO 024 |
.................... } |
.................... |
003B: SLEEP |
/programy/PIC_C/motory/menice/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/motory/menice/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\motory\menice\main.c |
D:\@Kaklik\programy\PIC_C\motory\menice\main.h |
C:\PROGRAM FILES\PICC\devices\16F84.h |
/programy/PIC_C/motory/menice/main.c |
---|
0,0 → 1,21 |
#include "D:\@Kaklik\programy\PIC_C\motory\menice\main.h" |
#DEFINE L1 pin_A0 |
#DEFINE L2 pin_A1 |
void main() |
{ |
output_low(L1); |
output_low(L2); |
while(true) |
{ |
output_low(L2); |
output_high(L1); |
Delay_ms(17); |
output_low(L1); |
output_high(L2); |
Delay_ms(17); |
} |
} |
/programy/PIC_C/motory/menice/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/motory/menice/main.err |
---|
0,0 → 1,0 |
No Errors |
/programy/PIC_C/motory/menice/main.h |
---|
0,0 → 1,4 |
#include <16F84.h> |
#use delay(clock=4000000) |
#fuses HS,WDT |
/programy/PIC_C/motory/menice/main.sta |
---|
0,0 → 1,28 |
ROM used: 60 (6%) |
964 (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 |
----- ----- --- ----- |
22 10 100 d:\@kaklik\programy\pic_c\motory\menice\main.c |
5 0 0 D:\@Kaklik\programy\PIC_C\motory\menice\main.h |
111 0 0 C:\PROGRAM FILES\PICC\devices\16F84.h |
----- ----- |
276 20 Total |
Page ROM % RAM Functions: |
---- --- --- --- ---------- |
0 21 35 1 delay_ms |
0 35 58 0 main |
Segment Used Free |
--------- ---- ---- |
0000-0003 4 0 |
0004-03FF 56 964 |
/programy/PIC_C/motory/menice/main.tre |
---|
0,0 → 1,5 |
ÀÄmain |
ÀÄmain 0/35 Ram=0 |
ÃÄ??0?? |
ÃÄdelay_ms 0/21 Ram=1 |
ÀÄdelay_ms 0/21 Ram=1 |
/programy/PIC_C/motory/menice/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/motory/menice/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 |