Subversion Repositories svnkaklik

Compare Revisions

Ignore whitespace Rev 11 → Rev 12

/roboti/solarni/2006/scamnum_specularis/menic.BAK
73,6 → 73,7
int8 perioda;
int8 razeni;
int8 uclanku;
int16 ble;
 
setup_timer_0(RTCC_INTERNAL);setup_wdt(WDT_1152MS);
setup_timer_1(T1_DISABLED);
114,11 → 115,11
// Precti trimry
set_adc_channel(PWM); // Zjisteni nastaveni PWM
delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku
perioda=(read_adc()>>1)+40; // rozsah: 40 az 167
perioda=(read_adc()>>2)+40; // rozsah: 40 az 103
 
set_adc_channel(ROZJEZD); // Zjisteni nastaveni rozjezdu
delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku
razeni=read_adc()>>1; // rozsah: 0 az 127
razeni=read_adc()>>3; // rozsah: 0 az 31
 
// Rozjeti menice
set_pwm1_duty(0); // Zastav PWM, aby slo nastavit jinou frekvenci
131,65 → 132,34
// } while (input(SW1)); // Je zapnut servisni mod? SW1(OFF)=ANO
// port_b_pullups(FALSE); // Vypni pullupy, aby se setrilo energii
 
// Regulace nabíjení
// zmereni napeti na clancich
output_high(REFPWR); // Prepni AD na mereni napeti clanku
set_adc_channel(NAPETI); // Prepni Zmer napeti clanku
delay_us(50); // Pockej na prepnuti kanalu A/D prevodniku
for(n=1;n<=10;n++)
{
// Zmer napeti (aktualni zatizeni clanku)
uclanku=read_adc();
// Uprav parametry menice
if (uclanku>105)
{
perioda++;
}
else
{
perioda--;
}
set_pwm1_duty(0); // Zastav PWM, aby slo nastavit jinou frekvenci
setup_timer_2(T2_DIV_BY_1,perioda,1); // perioda
set_pwm1_duty(DUTY2); // PWM pro zatizeni clanku pri jedne 500W zarovce
delay_ms(100);
}
output_low(REFPWR);
uclanku=read_adc();
output_low(REFPWR); // odpoj odpor pro mereni napeti
 
// posli telemetrii
sprintf(AXstring,"p=%u r=%u u=%u", perioda, razeni, uclanku); // Convert DATA to String.
SendPacket(&AXstring[0]);
 
delay_ms(13000); // Pockame 14s
delay_ms(14000); // Pockame do 14.5s
 
// rozjezd
SSPSTAT = 0; // inicializace SPI jednotky
SSPCON1 = 0x22; // SPI OSC/64
MotorPattern=0x02; // prvni data pro vyslani
SSPBUF=MotorPattern;
enable_interrupts(global);
enable_interrupts(INT_SSP); // az budou vyslana, prijde interrupt od SSP
// rozjezd
for(ble=1;ble<=1000;ble++)
{
for(n=0;n<=razeni;n++)
{
output_high(MOTOR);
delay_us(ble);
output_low(MOTOR);
delay_us(1000-ble);
}
}
 
for(n=0; n<=7; n++) // razeni osmi rychlostnich stupnu
{
MotorPattern=Pattern[n];
delay_ms(razeni); // Pockej na dalsi razeni
};
SSPSTAT = 0;
SSPCON1 = 0; // SPI stop
disable_interrupts(INT_SSP); // zastav preruseni od SSP
 
// jedem co to da
output_high(MOTOR);
 
/*
if (TRUE) // Venkovni jizda?
{
delay_ms(5000); // Venku muzeme jet 5s
set_pwm1_duty(0); // Zastav menic
// output_low(MOTOR); // Zastav motor
while(TRUE) restart_wdt(); // Cekej porad
};
delay_ms(3000);
*/
delay_ms(1300); // Nemeli bysme jet dele nez 1,3s :-)
output_low(MOTOR); // Zastav motor
// Menic je stale zapnut a zatezuje clanky
/roboti/solarni/2006/scamnum_specularis/menic.HEX
1,108 → 1,108
:1000000000308A00BA290000FF00030E8301A1001E
:1000000000308A00C3290000FF00030E8301A10015
:100010007F08A0000A08A8008A01A00E0408A20018
:100020007708A3007808A4007908A5007A08A6003C
:100030007B08A700831383128C308400801D222844
:100040008C193528220884002308F7002408F800BA
:100050002508F9002608FA002708FB0028088A006E
:10006000210E8300FF0E7F0E09008A1143280A101B
:100070008A100A118207023406340E341E343E34CC
:100080007E34FE34FF34680893008C118A112228D4
:100090006F308400000803195D280130F800BF307C
:1000A000F7006400F70B5128F80B4F284230F70097
:1000B000F70B58286400800B4D2800348316051771
:1000C0008312051F65280513662805178316051377
:1000D00083128A115A2AEF016F08F93C031C8B28FE
:1000E0006E1874280513752805178316051301303B
:1000F0008312EE066E187E2885137F2885178316D7
:10010000851364001F30F700F70B842800000000FF
:100110008312EF0A6C2883160513831205178316C2
:100120008513831285178A11A32A69088400700831
:100130008000840A8001E90A00347108F801700225
:100140000318A5287008F700B128F7010830F2005D
:10015000F00DF70D710877020318F700F80DF20B98
:10016000A828003478086E08F0006430F1009D2063
:100170007708EE0078083030031DC528EF1CCC2826
:10018000EF19CC286F1A2030C828EF116F126F14A6
:10019000F8077808F00095206E08F0000A30F100AA
:1001A0009D207708EE0078083030031DDD28EF1918
:1001B000E1286F1CE1286F1A2030F8077808F0005A
:1001C00095203030EE076E08F00095200034BC0119
:1001D000391CEC283910ED2839140034391C1A293F
:1001E000831686128312861264004730F700F70BDD
:1001F000F7280000831686128312861664004730A3
:10020000F700F70B0129000083168612831286126D
:1002100064004730F700F70B0B29000083168612A5
:100220008312861664001830F700F70B15290000BA
:1002300000002D29831686128312861264008530F1
:10024000F700F70B212983168612831286166400A5
:100250006F30F700F70B2A2900000034F101710814
:10026000073C031C762970080139F200BE08031907
:100270003B2900303C290130F300BD080319422915
:100280000030432901307305003A031956297208DA
:10029000F3000310BB0CBA0C030801397306013CD0
:1002A000031D56298430BB060830BA06F208031D28
:1002B0005B29E7207129BD080319BC0ABD08031991
:1002C0006329003064290130F3003C08053C031920
:1002D0006B2900306C290130730503197129EE2058
:1002E000E720EE200310F00CF10A2F29003439101A
:1002F000FF30BB00BA00BC010130BD00BE01BF0130
:100300003F08093C031C89297E30F0002E21BF0ADA
:100310008029BD01BF013F080F3C031C98292930EB
:100320003F0784000008EF00F0002E21BF0A8B2950
:10033000BF016E08840000080319A7296E08840015
:100340000008EF00F0002E21EE0ABF0A99290130C3
:10035000BE00FF30BA06BB063A08F0002E213B086B
:10036000F0002E21BE010130BD007E30F0002E21B4
:100370008A110C2B84011F30830583161F129F12D4
:100380001B0880399B0007309C0082308312A90033
:100390009830AA00AB004030AC00AD00AE00603039
:1003A000AF008630B000B430B1006030B200A4308D
:1003B000B300B400B5006130B6000330B700F030D0
:1003C000B800E90183160108C03981000E30F7003A
:1003D000073083128101813084000008F03907382A
:1003E000800064000008F739F719F03977048000BD
:1003F000900183161F129F121B088039D3389B006F
:100400001F1383121F179F1783169F1383121F1426
:10041000941283160611861406120030831294007B
:100420008316940007309C00050864000230F70032
:10043000F70B182A00001C0883120D1383169D0168
:1004400086118312861183160611831206118316F4
:1004500086108312861083168513831285178316E0
:100460000513831205172030F8001F08C7397804D8
:100470009F00950183168611831286110C30970018
:100480000030F80004389200643083169200623025
:100490008F00023083129500EA01831686108312C2
:1004A00086106430EF0048206A08EA0A043C031D05
:1004B0005B2A5E28EA0183168610831286140130B7
:1004C000EF0048201F151F19632A1E085F3C031CFC
:1004D0004D2A83168610831286100030F8001F08FC
:1004E000C73978049F0064001F30F700F70B762AA5
:1004F000000000001F151F197B2A1E08F7000310BB
:10050000F70C7708283EEB000830F8001F08C739C1
:1005100078049F0064001F30F700F70B8D2A00005D
:1005200000001F151F19922A03101E0CEC009501E4
:100530000030F800043892006B08831692001330E4
:10054000831295006B280230EE00FA30EF0048204D
:10055000EE0BA52A83168610831286142030F8002D
:100560001F08C73978049F0064000F30F700F70BAD
:10057000B72A00000130EA006A080A3C031CDC2AA2
:100580001F151F19C12A1E08ED006D08693C0318CC
:10059000CB2AEB0ACC2AEB0395010030F800043893
:1005A00092006B088316920013308312950064301A
:1005B000EF004820EA0ABC2A8316861083128610B0
:1005C0004030E9007030F00095203D30F00095207B
:1005D0006B08EE001B30EF00B2202030F0009520B9
:1005E0007230F00095203D30F00095206C08EE0050
:1005F0001B30EF00B2202030F00095207530F00065
:1006000095203D30F00095206D08EE001B30EF0086
:10061000B2204030EE0077293430EE00FA30EF009F
:100620004820EE0B0E2B8316940122308312940087
:100630000230E80068089300C0308B0483168C15E4
:100640008312EA016A08073C031C2F2B6A08372033
:10065000F800E8006C08EF004820EA0A222B831615
:1006600094018312940183168C11061183120615CE
:100670000A30EE008230EF004820EE0B3A2B831652
:0A068000061183120611432B6300DC
:04400E003C27FC3F10
:10006000210E8300FF0E7F0E09008A1137286808D1
:1000700093008C118A112228713084000008031922
:1000800051280130F800BF30F7006400F70B452815
:10009000F80B43284230F700F70B4C286400800B24
:1000A00041280034831605178312051F59280513AC
:1000B0005A2805178316051383128A11632AF10142
:1000C0007108F93C031C81287018682805136928F9
:1000D0000517831605130130F00670187328831274
:1000E000851375288316831285178316851364007C
:1000F0001F30F700F70B7A2800000000F10A831286
:10010000602883160513831205178316851383123F
:1001100085178A11B12A6908840072088000840A50
:100120008001E90A00347308F801720203189B2861
:100130007208F700A728F7010830F400F20DF70D58
:10014000730877020318F700F80DF40B9E280034AB
:1001500078087008F2006430F30093207708F0000C
:1001600078083030031DBB28F11CC228F119C228C1
:10017000711A2030BE28F11171127114F807780835
:10018000F2008B207008F2000A30F3009320770809
:10019000F00078083030031DD328F119D728711CDE
:1001A000D728711A2030F8077808F2008B203030F9
:1001B000F0077008F2008B200034BC01391CE228E3
:1001C0003910E32839140034391C1029831686129B
:1001D0008312861264004730F700F70BED28000009
:1001E000831686128312861664004730F700F70BD9
:1001F000F7280000831686128312861264004730A7
:10020000F700F70B01290000831686128312861669
:1002100064001830F700F70B0B29000000002329B9
:10022000831686128312861264008530F700F70B5E
:100230001729831686128312861664006F30F70022
:10024000F70B202900000034F3017308073C031C5E
:100250006C2972080139F400BE08031931290030F5
:1002600032290130F500BD08031938290030392939
:1002700001307505003A03194C297408F500031084
:10028000BB0CBA0C030801397506013C031D4C294F
:100290008430BB060830BA06F408031D5129DD205E
:1002A0006729BD080319BC0ABD0803195929003084
:1002B0005A290130F5003C08053C0319612900303A
:1002C00062290130750503196729E420DD20E42047
:1002D0000310F20CF30A252900343910FF30BB005B
:1002E000BA00BC010130BD00BE01BF013F08093C9E
:1002F000031C7F297E30F2002421BF0A7629BD012C
:10030000BF013F080F3C031C8E2929303F078400A2
:100310000008F100F2002421BF0A8129BF01700802
:100320008400000803199D29700884000008F1006A
:10033000F2002421F00ABF0A8F290130BE00FF30ED
:10034000BA06BB063A08F20024213B08F200242139
:10035000BE010130BD007E30F20024218A11FD2A49
:100360001230F202031CC22972308400FC30800576
:100370000310800C800C00080319C229C0296400F6
:10038000800BBF29003484011F30830583161F12A0
:100390009F121B0880399B0007309C00823083121B
:1003A000A9009830AA00AB004030AC00AD00AE0010
:1003B0006030AF008630B000B430B1006030B200C1
:1003C000A430B300B400B5006130B6000330B7000C
:1003D000F030B800E90183160108C03981000E3001
:1003E000F700073083128101813084000008F03962
:1003F0000738800064000008F739F719F0397704EE
:100400008000900183161F129F121B088039D33879
:100410009B001F1383121F179F1783169F138312AE
:100420001F149412831606118614061200308312CC
:1004300094008316940007309C0005086400023085
:10044000F700F70B212A00001C0883120D138316F6
:100450009D018611831286118316061183120611DF
:1004600083168610831286108316851383128517D0
:1004700083160513831205172030F8001F08C739AB
:1004800078049F00950183168611831286110C3023
:1004900097000030F8000438920064308316920010
:1004A00062308F00023083129500EA0183168610B5
:1004B000831286106430F1003C206A08EA0A043C8A
:1004C000031D642A5228EA018316861083128614BB
:1004D0000130F1003C201F151F196C2A1E085F3CDB
:1004E000031C562A83168610831286100030F800EB
:1004F0001F08C73978049F0064001F30F700F70B0E
:100500007F2A000000001F151F19842A1E08F7000B
:10051000F70CF70C3F30F7057708283EEB00083062
:10052000F8001F08C73978049F0064001F30F700E7
:10053000F70B982A000000001F151F199D2A1E0C9A
:10054000EC00EC0CEC0C1F30EC0595010030F800D1
:10055000043892006B0883169200133083129500C2
:100560005F280230F000FA30F1003C20F00BB32A93
:1005700083168610831286142030F8001F08C739AE
:1005800078049F0064000F30F700F70BC52A0000C5
:100590001F151F19C92A1E08ED0083168610831225
:1005A00086104030E9007030F2008B203D30F200C0
:1005B0008B206B08F0001B30F100A8202030F200E7
:1005C0008B207230F2008B203D30F2008B206C08C3
:1005D000F0001B30F100A8202030F2008B20753095
:1005E000F2008B203D30F2008B206D08F0001B30B4
:1005F000F100A8204030F0006D293830F000FA30CA
:10060000F1003C20F00BFF2AEF010130EE006F08F3
:10061000033C031C332B031D112B6E08E83C031C09
:10062000332BEA016A086C02031C2F2B8316061178
:10063000831206156E08F200B0218316061183128C
:1006400006116E08E83CF0000330F1006F08031C4F
:100650006F0FF1027008F200B021EA0A122BEE0AC5
:100660000319EF0A072B83160611831206150A30A9
:10067000F0008230F1003C20F00B392B831606117C
:0806800083120611422B6300F6
:04400E003827FC3F14
:00000001FF
;PIC16F88
/roboti/solarni/2006/scamnum_specularis/menic.LST
1,17 → 1,17
CCS PCM C Compiler, Version 3.245, 27853 12-IX-06 23:20
CCS PCM C Compiler, Version 3.245, 27853 17-IX-06 22:12
 
Filename: D:\KAKL\roboti\solarni\2006\scamnum\menic.lst
 
ROM used: 837 words (20%)
ROM used: 836 words (20%)
Largest free fragment is 2048
RAM used: 85 (49%) at main() level
91 (52%) worst case
RAM used: 87 (50%) at main() level
94 (54%) worst case
Stack: 4 worst case (3 in main + 1 for interrupts)
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 1BA
0002: GOTO 1C3
0003: NOP
0004: MOVWF 7F
0005: SWAPF 03,W
63,7 → 63,7
0033: SWAPF 7F,W
0034: RETFIE
0035: BCF 0A.3
0036: GOTO 043
0036: GOTO 037
.................... // *************************************
.................... // * Scamnum Specularis ** 20. 9. 2006 *
.................... // *************************************
77,33 → 77,53
....................
.................... #device adc=8
....................
.................... #fuses WDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, \
.................... #fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, \
.................... NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO, CCPB3
....................
.................... #use delay(clock=3900000,RESTART_WDT)
*
0048: MOVLW 6F
0049: MOVWF 04
004A: MOVF 00,W
004B: BTFSC 03.2
004C: GOTO 05D
004D: MOVLW 01
004E: MOVWF 78
004F: MOVLW BF
0050: MOVWF 77
0051: CLRWDT
0052: DECFSZ 77,F
0053: GOTO 051
0054: DECFSZ 78,F
0055: GOTO 04F
0056: MOVLW 42
0057: MOVWF 77
0058: DECFSZ 77,F
0059: GOTO 058
005A: CLRWDT
005B: DECFSZ 00,F
005C: GOTO 04D
005D: RETLW 00
003C: MOVLW 71
003D: MOVWF 04
003E: MOVF 00,W
003F: BTFSC 03.2
0040: GOTO 051
0041: MOVLW 01
0042: MOVWF 78
0043: MOVLW BF
0044: MOVWF 77
0045: CLRWDT
0046: DECFSZ 77,F
0047: GOTO 045
0048: DECFSZ 78,F
0049: GOTO 043
004A: MOVLW 42
004B: MOVWF 77
004C: DECFSZ 77,F
004D: GOTO 04C
004E: CLRWDT
004F: DECFSZ 00,F
0050: GOTO 041
0051: RETLW 00
*
01B0: MOVLW 12
01B1: SUBWF 72,F
01B2: BTFSS 03.0
01B3: GOTO 1C2
01B4: MOVLW 72
01B5: MOVWF 04
01B6: MOVLW FC
01B7: ANDWF 00,F
01B8: BCF 03.0
01B9: RRF 00,F
01BA: RRF 00,F
01BB: MOVF 00,W
01BC: BTFSC 03.2
01BD: GOTO 1C2
01BE: GOTO 1C0
01BF: CLRWDT
01C0: DECFSZ 00,F
01C1: GOTO 1BF
01C2: RETLW 00
....................
....................
....................
125,34 → 145,34
.................... 'C'<<1, 'Z'<<1, '0'<<1, 'R'<<1, 'R'<<1, 'R'<<1, 0x61,
.................... 0x03, 0xF0};
*
01C5: MOVLW 82
01C6: BCF 03.5
01C7: MOVWF 29
01C8: MOVLW 98
01C9: MOVWF 2A
01CA: MOVWF 2B
01CB: MOVLW 40
01CC: MOVWF 2C
01CD: MOVWF 2D
01CE: MOVWF 2E
01CF: MOVLW 60
01D0: MOVWF 2F
01D1: MOVLW 86
01D2: MOVWF 30
01D3: MOVLW B4
01D4: MOVWF 31
01D5: MOVLW 60
01D6: MOVWF 32
01D7: MOVLW A4
01D8: MOVWF 33
01D9: MOVWF 34
01DA: MOVWF 35
01DB: MOVLW 61
01DC: MOVWF 36
01DD: MOVLW 03
01DE: MOVWF 37
01DF: MOVLW F0
01E0: MOVWF 38
01CE: MOVLW 82
01CF: BCF 03.5
01D0: MOVWF 29
01D1: MOVLW 98
01D2: MOVWF 2A
01D3: MOVWF 2B
01D4: MOVLW 40
01D5: MOVWF 2C
01D6: MOVWF 2D
01D7: MOVWF 2E
01D8: MOVLW 60
01D9: MOVWF 2F
01DA: MOVLW 86
01DB: MOVWF 30
01DC: MOVLW B4
01DD: MOVWF 31
01DE: MOVLW 60
01DF: MOVWF 32
01E0: MOVLW A4
01E1: MOVWF 33
01E2: MOVWF 34
01E3: MOVWF 35
01E4: MOVLW 61
01E5: MOVWF 36
01E6: MOVLW 03
01E7: MOVWF 37
01E8: MOVLW F0
01E9: MOVWF 38
....................
.................... boolean bit;
.................... int fcslo, fcshi; // variabloes for calculating FCS (CRC)
165,22 → 185,22
.................... {
.................... stuff = 0; //since this is a 0, reset the stuff counter
*
00E7: CLRF 3C
00DD: CLRF 3C
.................... if (bit)
00E8: BTFSS 39.0
00E9: GOTO 0EC
00DE: BTFSS 39.0
00DF: GOTO 0E2
.................... {
.................... bit=FALSE; //if the state of the pin was low, make it high.
00EA: BCF 39.0
00E0: BCF 39.0
.................... }
.................... else
00EB: GOTO 0ED
00E1: GOTO 0E3
.................... {
.................... bit=TRUE; //if the state of the pin was high make it low
00EC: BSF 39.0
00E2: BSF 39.0
.................... }
.................... }
00ED: RETLW 00
00E3: RETLW 00
....................
.................... void fcsbit(byte tbyte)
.................... {
187,26 → 207,26
.................... #asm
.................... BCF STATUS,0
*
0149: BCF 03.0
013F: BCF 03.0
.................... RRF fcshi,F // rotates the entire 16 bits
014A: RRF 3B,F
0140: RRF 3B,F
.................... RRF fcslo,F // to the right
014B: RRF 3A,F
0141: RRF 3A,F
.................... #endasm
.................... if (((STATUS & 0x01)^(tbyte)) ==0x01)
014C: MOVF 03,W
014D: ANDLW 01
014E: XORWF 73,W
014F: SUBLW 01
0150: BTFSS 03.2
0151: GOTO 156
0142: MOVF 03,W
0143: ANDLW 01
0144: XORWF 75,W
0145: SUBLW 01
0146: BTFSS 03.2
0147: GOTO 14C
.................... {
.................... fcshi = fcshi^0x84;
0152: MOVLW 84
0153: XORWF 3B,F
0148: MOVLW 84
0149: XORWF 3B,F
.................... fcslo = fcslo^0x08;
0154: MOVLW 08
0155: XORWF 3A,F
014A: MOVLW 08
014B: XORWF 3A,F
.................... }
.................... }
....................
214,14 → 234,26
.................... {
.................... if (bit)
*
00EE: BTFSS 39.0
00EF: GOTO 11A
00E4: BTFSS 39.0
00E5: GOTO 110
.................... {
.................... output_low(TXo);
00E6: BSF 03.5
00E7: BCF 06.5
00E8: BCF 03.5
00E9: BCF 06.5
.................... PERIODAH;
00EA: CLRWDT
00EB: MOVLW 47
00EC: MOVWF 77
00ED: DECFSZ 77,F
00EE: GOTO 0ED
00EF: NOP
.................... output_high(TXo);
00F0: BSF 03.5
00F1: BCF 06.5
00F2: BCF 03.5
00F3: BCF 06.5
00F3: BSF 06.5
.................... PERIODAH;
00F4: CLRWDT
00F5: MOVLW 47
229,11 → 261,11
00F7: DECFSZ 77,F
00F8: GOTO 0F7
00F9: NOP
.................... output_high(TXo);
.................... output_low(TXo);
00FA: BSF 03.5
00FB: BCF 06.5
00FC: BCF 03.5
00FD: BSF 06.5
00FD: BCF 06.5
.................... PERIODAH;
00FE: CLRWDT
00FF: MOVLW 47
241,61 → 273,49
0101: DECFSZ 77,F
0102: GOTO 101
0103: NOP
.................... output_low(TXo);
.................... output_high(TXo);
0104: BSF 03.5
0105: BCF 06.5
0106: BCF 03.5
0107: BCF 06.5
.................... PERIODAH;
0107: BSF 06.5
.................... TAILH;
0108: CLRWDT
0109: MOVLW 47
0109: MOVLW 18
010A: MOVWF 77
010B: DECFSZ 77,F
010C: GOTO 10B
010D: NOP
.................... output_high(TXo);
010E: BSF 03.5
010F: BCF 06.5
0110: BCF 03.5
0111: BSF 06.5
.................... TAILH;
0112: CLRWDT
0113: MOVLW 18
0114: MOVWF 77
0115: DECFSZ 77,F
0116: GOTO 115
0117: NOP
0118: NOP
010E: NOP
.................... }
.................... else
0119: GOTO 12D
010F: GOTO 123
.................... {
.................... output_low(TXo);
011A: BSF 03.5
011B: BCF 06.5
011C: BCF 03.5
011D: BCF 06.5
0110: BSF 03.5
0111: BCF 06.5
0112: BCF 03.5
0113: BCF 06.5
.................... PERIODAL;
011E: CLRWDT
011F: MOVLW 85
0120: MOVWF 77
0121: DECFSZ 77,F
0122: GOTO 121
0114: CLRWDT
0115: MOVLW 85
0116: MOVWF 77
0117: DECFSZ 77,F
0118: GOTO 117
.................... output_high(TXo);
0123: BSF 03.5
0124: BCF 06.5
0125: BCF 03.5
0126: BSF 06.5
0119: BSF 03.5
011A: BCF 06.5
011B: BCF 03.5
011C: BSF 06.5
.................... TAILL;
0127: CLRWDT
0128: MOVLW 6F
0129: MOVWF 77
012A: DECFSZ 77,F
012B: GOTO 12A
012C: NOP
011D: CLRWDT
011E: MOVLW 6F
011F: MOVWF 77
0120: DECFSZ 77,F
0121: GOTO 120
0122: NOP
.................... };
.................... }
012D: RETLW 00
0123: RETLW 00
....................
.................... void SendByte (byte inbyte)
.................... {
302,101 → 322,101
.................... int k, bt;
....................
.................... for (k=0;k<8;k++) //do the following for each of the 8 bits in the byte
012E: CLRF 71
012F: MOVF 71,W
0130: SUBLW 07
0131: BTFSS 03.0
0132: GOTO 176
0124: CLRF 73
0125: MOVF 73,W
0126: SUBLW 07
0127: BTFSS 03.0
0128: GOTO 16C
.................... {
.................... bt = inbyte & 0x01; //strip off the rightmost bit of the byte to be sent (inbyte)
0133: MOVF 70,W
0134: ANDLW 01
0135: MOVWF 72
0129: MOVF 72,W
012A: ANDLW 01
012B: MOVWF 74
.................... if ((fcs_flag == FALSE) & (flag_flag == FALSE)) fcsbit(bt); //do FCS calc, but only if this
0136: MOVF 3E,F
0137: BTFSC 03.2
0138: GOTO 13B
0139: MOVLW 00
013A: GOTO 13C
013B: MOVLW 01
013C: MOVWF 73
013D: MOVF 3D,F
013E: BTFSC 03.2
013F: GOTO 142
0140: MOVLW 00
0141: GOTO 143
0142: MOVLW 01
0143: ANDWF 73,W
0144: XORLW 00
0145: BTFSC 03.2
0146: GOTO 156
0147: MOVF 72,W
0148: MOVWF 73
012C: MOVF 3E,F
012D: BTFSC 03.2
012E: GOTO 131
012F: MOVLW 00
0130: GOTO 132
0131: MOVLW 01
0132: MOVWF 75
0133: MOVF 3D,F
0134: BTFSC 03.2
0135: GOTO 138
0136: MOVLW 00
0137: GOTO 139
0138: MOVLW 01
0139: ANDWF 75,W
013A: XORLW 00
013B: BTFSC 03.2
013C: GOTO 14C
013D: MOVF 74,W
013E: MOVWF 75
.................... //is not a flag or fcs byte
.................... if (bt == 0)
*
0156: MOVF 72,F
0157: BTFSS 03.2
0158: GOTO 15B
014C: MOVF 74,F
014D: BTFSS 03.2
014E: GOTO 151
.................... {
.................... flipout();
0159: CALL 0E7
014F: CALL 0DD
.................... } // if this bit is a zero, flip the output state
.................... else
015A: GOTO 171
0150: GOTO 167
.................... { //otherwise if it is a 1, do the following:
.................... if (flag_flag == FALSE) stuff++; //increment the count of consequtive 1's
015B: MOVF 3D,F
015C: BTFSC 03.2
015D: INCF 3C,F
0151: MOVF 3D,F
0152: BTFSC 03.2
0153: INCF 3C,F
.................... if ((flag_flag == FALSE) & (stuff == 5))
015E: MOVF 3D,F
015F: BTFSC 03.2
0160: GOTO 163
0161: MOVLW 00
0162: GOTO 164
0163: MOVLW 01
0164: MOVWF 73
0165: MOVF 3C,W
0166: SUBLW 05
0167: BTFSC 03.2
0168: GOTO 16B
0169: MOVLW 00
016A: GOTO 16C
016B: MOVLW 01
016C: ANDWF 73,W
016D: BTFSC 03.2
016E: GOTO 171
0154: MOVF 3D,F
0155: BTFSC 03.2
0156: GOTO 159
0157: MOVLW 00
0158: GOTO 15A
0159: MOVLW 01
015A: MOVWF 75
015B: MOVF 3C,W
015C: SUBLW 05
015D: BTFSC 03.2
015E: GOTO 161
015F: MOVLW 00
0160: GOTO 162
0161: MOVLW 01
0162: ANDWF 75,W
0163: BTFSC 03.2
0164: GOTO 167
.................... { //stuff an extra 0, if 5 1's in a row
.................... SendBit();
016F: CALL 0EE
0165: CALL 0E4
.................... flipout(); //flip the output state to stuff a 0
0170: CALL 0E7
0166: CALL 0DD
.................... }//end of if
.................... }//end of else
.................... // delay_us(850); //introduces a delay that creates 1200 baud
.................... SendBit();
0171: CALL 0EE
0167: CALL 0E4
.................... inbyte = inbyte>>1; //go to the next bit in the byte
0172: BCF 03.0
0173: RRF 70,F
0168: BCF 03.0
0169: RRF 72,F
.................... }//end of for
0174: INCF 71,F
0175: GOTO 12F
016A: INCF 73,F
016B: GOTO 125
.................... }//end of SendByte
0176: RETLW 00
016C: RETLW 00
....................
.................... void SendPacket(char *data)
.................... {
.................... bit=FALSE;
0177: BCF 39.0
016D: BCF 39.0
....................
.................... fcslo=fcshi=0xFF; //The 2 FCS Bytes are initialized to FF
0178: MOVLW FF
0179: MOVWF 3B
017A: MOVWF 3A
016E: MOVLW FF
016F: MOVWF 3B
0170: MOVWF 3A
.................... stuff = 0; //The variable stuff counts the number of 1's in a row. When it gets to 5
017B: CLRF 3C
0171: CLRF 3C
.................... // it is time to stuff a 0.
....................
.................... // output_low(PTT); // Blinking LED
404,91 → 424,91
.................... // output_high(PTT);
....................
.................... flag_flag = TRUE; //The variable flag is true if you are transmitted flags (7E's) false otherwise.
017C: MOVLW 01
017D: MOVWF 3D
0172: MOVLW 01
0173: MOVWF 3D
.................... fcs_flag = FALSE; //The variable fcsflag is true if you are transmitting FCS bytes, false otherwise.
017E: CLRF 3E
0174: CLRF 3E
....................
.................... for(i=0; i<10; i++) SendByte(0x7E); //Sends flag bytes. Adjust length for txdelay
017F: CLRF 3F
0180: MOVF 3F,W
0181: SUBLW 09
0182: BTFSS 03.0
0183: GOTO 189
0184: MOVLW 7E
0185: MOVWF 70
0186: CALL 12E
0187: INCF 3F,F
0188: GOTO 180
0175: CLRF 3F
0176: MOVF 3F,W
0177: SUBLW 09
0178: BTFSS 03.0
0179: GOTO 17F
017A: MOVLW 7E
017B: MOVWF 72
017C: CALL 124
017D: INCF 3F,F
017E: GOTO 176
.................... //each flag takes approx 6.7 ms
.................... flag_flag = FALSE; //done sending flags
0189: CLRF 3D
017F: CLRF 3D
....................
.................... for(i=0; i<16; i++) SendByte(SendData[i]); //send the packet bytes
018A: CLRF 3F
018B: MOVF 3F,W
018C: SUBLW 0F
018D: BTFSS 03.0
018E: GOTO 198
018F: MOVLW 29
0190: ADDWF 3F,W
0191: MOVWF 04
0192: MOVF 00,W
0193: MOVWF 6F
0194: MOVWF 70
0195: CALL 12E
0196: INCF 3F,F
0197: GOTO 18B
0180: CLRF 3F
0181: MOVF 3F,W
0182: SUBLW 0F
0183: BTFSS 03.0
0184: GOTO 18E
0185: MOVLW 29
0186: ADDWF 3F,W
0187: MOVWF 04
0188: MOVF 00,W
0189: MOVWF 71
018A: MOVWF 72
018B: CALL 124
018C: INCF 3F,F
018D: GOTO 181
....................
.................... for(i=0; 0 != *data; i++)
0198: CLRF 3F
0199: MOVF 6E,W
019A: MOVWF 04
019B: MOVF 00,W
019C: BTFSC 03.2
019D: GOTO 1A7
018E: CLRF 3F
018F: MOVF 70,W
0190: MOVWF 04
0191: MOVF 00,W
0192: BTFSC 03.2
0193: GOTO 19D
.................... {
.................... SendByte(*data); //send the packet bytes
019E: MOVF 6E,W
019F: MOVWF 04
01A0: MOVF 00,W
01A1: MOVWF 6F
01A2: MOVWF 70
01A3: CALL 12E
0194: MOVF 70,W
0195: MOVWF 04
0196: MOVF 00,W
0197: MOVWF 71
0198: MOVWF 72
0199: CALL 124
.................... data++;
01A4: INCF 6E,F
019A: INCF 70,F
.................... };
01A5: INCF 3F,F
01A6: GOTO 199
019B: INCF 3F,F
019C: GOTO 18F
....................
.................... fcs_flag = TRUE; //about to send the FCS bytes
01A7: MOVLW 01
01A8: MOVWF 3E
019D: MOVLW 01
019E: MOVWF 3E
.................... fcslo =fcslo^0xff; //must XOR them with FF before sending
01A9: MOVLW FF
01AA: XORWF 3A,F
019F: MOVLW FF
01A0: XORWF 3A,F
.................... fcshi = fcshi^0xff;
01AB: XORWF 3B,F
01A1: XORWF 3B,F
.................... SendByte(fcslo); //send the low byte of fcs
01AC: MOVF 3A,W
01AD: MOVWF 70
01AE: CALL 12E
01A2: MOVF 3A,W
01A3: MOVWF 72
01A4: CALL 124
.................... SendByte(fcshi); //send the high byte of fcs
01AF: MOVF 3B,W
01B0: MOVWF 70
01B1: CALL 12E
01A5: MOVF 3B,W
01A6: MOVWF 72
01A7: CALL 124
.................... fcs_flag = FALSE; //done sending FCS
01B2: CLRF 3E
01A8: CLRF 3E
.................... flag_flag = TRUE; //about to send flags
01B3: MOVLW 01
01B4: MOVWF 3D
01A9: MOVLW 01
01AA: MOVWF 3D
.................... SendByte(0x7e); // Send a flag to end packet
01B5: MOVLW 7E
01B6: MOVWF 70
01B7: CALL 12E
01AB: MOVLW 7E
01AC: MOVWF 72
01AD: CALL 124
.................... }
01B8: BCF 0A.3
01B9: GOTO 30C (RETURN)
01AE: BCF 0A.3
01AF: GOTO 2FD (RETURN)
....................
....................
....................
532,13 → 552,13
.................... {
.................... SSPBUF=MotorPattern; // znovu vysli stejnou hodnotu
*
0043: MOVF 68,W
0044: MOVWF 13
0037: MOVF 68,W
0038: MOVWF 13
.................... }
....................
0045: BCF 0C.3
0046: BCF 0A.3
0047: GOTO 022
0039: BCF 0C.3
003A: BCF 0A.3
003B: GOTO 022
.................... void pip() // pipnuti a bliknuti
.................... {
.................... int1 beep;
546,269 → 566,272
....................
.................... for(i=0; i<250; i++)
*
006B: CLRF 6F
006C: MOVF 6F,W
006D: SUBLW F9
006E: BTFSS 03.0
006F: GOTO 08B
005F: CLRF 71
0060: MOVF 71,W
0061: SUBLW F9
0062: BTFSS 03.0
0063: GOTO 081
.................... {
.................... output_bit(PIEZO, beep);
0070: BTFSC 6E.0
0071: GOTO 074
0072: BCF 05.6
0073: GOTO 075
0074: BSF 05.6
0075: BSF 03.5
0076: BCF 05.6
0064: BTFSC 70.0
0065: GOTO 068
0066: BCF 05.6
0067: GOTO 069
0068: BSF 05.6
0069: BSF 03.5
006A: BCF 05.6
.................... beep=~beep;
0077: MOVLW 01
0078: BCF 03.5
0079: XORWF 6E,F
006B: MOVLW 01
006C: XORWF 70,F
.................... output_bit(LED, beep);
007A: BTFSC 6E.0
007B: GOTO 07E
007C: BCF 05.7
007D: GOTO 07F
007E: BSF 05.7
007F: BSF 03.5
0080: BCF 05.7
006D: BTFSC 70.0
006E: GOTO 073
006F: BCF 03.5
0070: BCF 05.7
0071: GOTO 075
0072: BSF 03.5
0073: BCF 03.5
0074: BSF 05.7
0075: BSF 03.5
0076: BCF 05.7
.................... delay_us(100);
0081: CLRWDT
0082: MOVLW 1F
0083: MOVWF 77
0084: DECFSZ 77,F
0085: GOTO 084
0086: NOP
0087: NOP
0077: CLRWDT
0078: MOVLW 1F
0079: MOVWF 77
007A: DECFSZ 77,F
007B: GOTO 07A
007C: NOP
007D: NOP
.................... };
0088: BCF 03.5
0089: INCF 6F,F
008A: GOTO 06C
007E: INCF 71,F
007F: BCF 03.5
0080: GOTO 060
.................... output_high(PIEZO);
008B: BSF 03.5
008C: BCF 05.6
008D: BCF 03.5
008E: BSF 05.6
0081: BSF 03.5
0082: BCF 05.6
0083: BCF 03.5
0084: BSF 05.6
.................... output_high(LED);
008F: BSF 03.5
0090: BCF 05.7
0091: BCF 03.5
0092: BSF 05.7
0085: BSF 03.5
0086: BCF 05.7
0087: BCF 03.5
0088: BSF 05.7
.................... }
0093: BCF 0A.3
0094: GOTO 2A3 (RETURN)
0089: BCF 0A.3
008A: GOTO 2B1 (RETURN)
....................
.................... void cvak() // pouze cvaknuti piezoelementem bez bliknuti
.................... {
.................... output_bit(PIEZO,~input(PIEZO));
*
005E: BSF 03.5
005F: BSF 05.6
0060: BCF 03.5
0061: BTFSS 05.6
0062: GOTO 065
0063: BCF 05.6
0064: GOTO 066
0065: BSF 05.6
0066: BSF 03.5
0067: BCF 05.6
0052: BSF 03.5
0053: BSF 05.6
0054: BCF 03.5
0055: BTFSS 05.6
0056: GOTO 059
0057: BCF 05.6
0058: GOTO 05A
0059: BSF 05.6
005A: BSF 03.5
005B: BCF 05.6
.................... }
0068: BCF 03.5
0069: BCF 0A.3
006A: GOTO 25A (RETURN)
005C: BCF 03.5
005D: BCF 0A.3
005E: GOTO 263 (RETURN)
....................
.................... void main()
.................... {
*
01BA: CLRF 04
01BB: MOVLW 1F
01BC: ANDWF 03,F
01BD: BSF 03.5
01BE: BCF 1F.4
01BF: BCF 1F.5
01C0: MOVF 1B,W
01C1: ANDLW 80
01C2: MOVWF 1B
01C3: MOVLW 07
01C4: MOVWF 1C
01C3: CLRF 04
01C4: MOVLW 1F
01C5: ANDWF 03,F
01C6: BSF 03.5
01C7: BCF 1F.4
01C8: BCF 1F.5
01C9: MOVF 1B,W
01CA: ANDLW 80
01CB: MOVWF 1B
01CC: MOVLW 07
01CD: MOVWF 1C
.................... int8 n;
.................... int8 perioda;
.................... int8 razeni;
.................... int8 uclanku;
.................... int16 ble;
....................
.................... setup_timer_0(RTCC_INTERNAL);setup_wdt(WDT_1152MS);
*
01E2: BSF 03.5
01E3: MOVF 01,W
01E4: ANDLW C0
01E5: MOVWF 01
01E6: MOVLW 0E
01E7: MOVWF 77
01E8: MOVLW 07
01E9: BCF 03.5
01EA: CLRF 01
01EB: MOVLW 81
01EC: MOVWF 04
01ED: MOVF 00,W
01EE: ANDLW F0
01EF: IORLW 07
01F0: MOVWF 00
01F1: CLRWDT
01F2: MOVF 00,W
01F3: ANDLW F7
01F4: BTFSC 77.3
01F5: ANDLW F0
01F6: IORWF 77,W
01F7: MOVWF 00
01EB: BSF 03.5
01EC: MOVF 01,W
01ED: ANDLW C0
01EE: MOVWF 01
01EF: MOVLW 0E
01F0: MOVWF 77
01F1: MOVLW 07
01F2: BCF 03.5
01F3: CLRF 01
01F4: MOVLW 81
01F5: MOVWF 04
01F6: MOVF 00,W
01F7: ANDLW F0
01F8: IORLW 07
01F9: MOVWF 00
01FA: CLRWDT
01FB: MOVF 00,W
01FC: ANDLW F7
01FD: BTFSC 77.3
01FE: ANDLW F0
01FF: IORWF 77,W
0200: MOVWF 00
.................... setup_timer_1(T1_DISABLED);
01F8: CLRF 10
0201: CLRF 10
.................... setup_adc_ports(ADC_CLOCK_INTERNAL|sAN0|sAN1|sAN4|VSS_VDD);
01F9: BSF 03.5
01FA: BCF 1F.4
01FB: BCF 1F.5
01FC: MOVF 1B,W
01FD: ANDLW 80
01FE: IORLW D3
01FF: MOVWF 1B
0202: BSF 03.5
0203: BCF 1F.4
0204: BCF 1F.5
0205: MOVF 1B,W
0206: ANDLW 80
0207: IORLW D3
0208: MOVWF 1B
.................... setup_adc(ADC_CLOCK_INTERNAL);
0200: BCF 1F.6
0201: BCF 03.5
0202: BSF 1F.6
0203: BSF 1F.7
0204: BSF 03.5
0205: BCF 1F.7
0206: BCF 03.5
0207: BSF 1F.0
0209: BCF 1F.6
020A: BCF 03.5
020B: BSF 1F.6
020C: BSF 1F.7
020D: BSF 03.5
020E: BCF 1F.7
020F: BCF 03.5
0210: BSF 1F.0
.................... setup_spi(FALSE);
0208: BCF 14.5
0209: BSF 03.5
020A: BCF 06.2
020B: BSF 06.1
020C: BCF 06.4
020D: MOVLW 00
020E: BCF 03.5
020F: MOVWF 14
0210: BSF 03.5
0211: MOVWF 14
0211: BCF 14.5
0212: BSF 03.5
0213: BCF 06.2
0214: BSF 06.1
0215: BCF 06.4
0216: MOVLW 00
0217: BCF 03.5
0218: MOVWF 14
0219: BSF 03.5
021A: MOVWF 14
.................... setup_comparator(NC_NC_NC_NC);
0212: MOVLW 07
0213: MOVWF 1C
0214: MOVF 05,W
0215: CLRWDT
0216: MOVLW 02
0217: MOVWF 77
0218: DECFSZ 77,F
0219: GOTO 218
021A: NOP
021B: MOVF 1C,W
021C: BCF 03.5
021D: BCF 0D.6
021B: MOVLW 07
021C: MOVWF 1C
021D: MOVF 05,W
021E: CLRWDT
021F: MOVLW 02
0220: MOVWF 77
0221: DECFSZ 77,F
0222: GOTO 221
0223: NOP
0224: MOVF 1C,W
0225: BCF 03.5
0226: BCF 0D.6
.................... setup_vref(FALSE);
021E: BSF 03.5
021F: CLRF 1D
0227: BSF 03.5
0228: CLRF 1D
....................
.................... output_low(MENIC); // Vsechno zastav
0220: BCF 06.3
0221: BCF 03.5
0222: BCF 06.3
0229: BCF 06.3
022A: BCF 03.5
022B: BCF 06.3
.................... output_low(MOTOR);
0223: BSF 03.5
0224: BCF 06.2
0225: BCF 03.5
0226: BCF 06.2
022C: BSF 03.5
022D: BCF 06.2
022E: BCF 03.5
022F: BCF 06.2
.................... output_low(REFPWR);
0227: BSF 03.5
0228: BCF 06.1
0229: BCF 03.5
022A: BCF 06.1
0230: BSF 03.5
0231: BCF 06.1
0232: BCF 03.5
0233: BCF 06.1
.................... output_high(LED);
022B: BSF 03.5
022C: BCF 05.7
022D: BCF 03.5
022E: BSF 05.7
0234: BSF 03.5
0235: BCF 05.7
0236: BCF 03.5
0237: BSF 05.7
.................... output_high(PIEZO);
022F: BSF 03.5
0230: BCF 05.6
0231: BCF 03.5
0232: BSF 05.6
0238: BSF 03.5
0239: BCF 05.6
023A: BCF 03.5
023B: BSF 05.6
....................
.................... set_adc_channel(NAPETI); // Vyber AD kanal pro pomerne mereni napeti
0233: MOVLW 20
0234: MOVWF 78
0235: MOVF 1F,W
0236: ANDLW C7
0237: IORWF 78,W
0238: MOVWF 1F
023C: MOVLW 20
023D: MOVWF 78
023E: MOVF 1F,W
023F: ANDLW C7
0240: IORWF 78,W
0241: MOVWF 1F
.................... set_pwm1_duty(0); // Spust PWM, ale zatim s trvalou 0 na vystupu
0239: CLRF 15
0242: CLRF 15
.................... setup_ccp1(CCP_PWM);
023A: BSF 03.5
023B: BCF 06.3
023C: BCF 03.5
023D: BCF 06.3
023E: MOVLW 0C
023F: MOVWF 17
0243: BSF 03.5
0244: BCF 06.3
0245: BCF 03.5
0246: BCF 06.3
0247: MOVLW 0C
0248: MOVWF 17
.................... setup_timer_2(T2_DIV_BY_1,100,1); // perioda
0240: MOVLW 00
0241: MOVWF 78
0242: IORLW 04
0243: MOVWF 12
0244: MOVLW 64
0245: BSF 03.5
0246: MOVWF 12
0249: MOVLW 00
024A: MOVWF 78
024B: IORLW 04
024C: MOVWF 12
024D: MOVLW 64
024E: BSF 03.5
024F: MOVWF 12
....................
.................... setup_oscillator(OSC_4MHZ|OSC_INTRC); // rozjed PIC (zvysi se odber)
0247: MOVLW 62
0248: MOVWF 0F
0250: MOVLW 62
0251: MOVWF 0F
....................
.................... // jsme v depu?
.................... set_pwm1_duty(DUTY1); // PWM pro zatizeni clanku pri malem osvetleni
0249: MOVLW 02
024A: BCF 03.5
024B: MOVWF 15
0252: MOVLW 02
0253: BCF 03.5
0254: MOVWF 15
.................... n=0;
024C: CLRF 6A
0255: CLRF 6A
.................... do
.................... {
.................... output_low(REFPWR); // Vypni napajeni napetove reference, aby se setrilo
024D: BSF 03.5
024E: BCF 06.1
024F: BCF 03.5
0250: BCF 06.1
0256: BSF 03.5
0257: BCF 06.1
0258: BCF 03.5
0259: BCF 06.1
.................... delay_ms(100);
0251: MOVLW 64
0252: MOVWF 6F
0253: CALL 048
025A: MOVLW 64
025B: MOVWF 71
025C: CALL 03C
.................... if (4==n++) {cvak(); n=0;}; // Kazdy 4. pruchod cvakni
0254: MOVF 6A,W
0255: INCF 6A,F
0256: SUBLW 04
0257: BTFSS 03.2
0258: GOTO 25B
0259: GOTO 05E
025A: CLRF 6A
025D: MOVF 6A,W
025E: INCF 6A,F
025F: SUBLW 04
0260: BTFSS 03.2
0261: GOTO 264
0262: GOTO 052
0263: CLRF 6A
.................... output_high(REFPWR); // Zapni napajeni napetove reference
025B: BSF 03.5
025C: BCF 06.1
025D: BCF 03.5
025E: BSF 06.1
0264: BSF 03.5
0265: BCF 06.1
0266: BCF 03.5
0267: BSF 06.1
.................... delay_ms(1); // Pockej na ustaleni napeti
025F: MOVLW 01
0260: MOVWF 6F
0261: CALL 048
0268: MOVLW 01
0269: MOVWF 71
026A: CALL 03C
.................... } while (read_adc()>REFSTART); // Odkryl starter clanky?
0262: BSF 1F.2
0263: BTFSC 1F.2
0264: GOTO 263
0265: MOVF 1E,W
0266: SUBLW 5F
0267: BTFSS 03.0
0268: GOTO 24D
026B: BSF 1F.2
026C: BTFSC 1F.2
026D: GOTO 26C
026E: MOVF 1E,W
026F: SUBLW 5F
0270: BTFSS 03.0
0271: GOTO 256
.................... output_low(REFPWR); // Vypni napajeni napetove reference, aby se setrilo
0269: BSF 03.5
026A: BCF 06.1
026B: BCF 03.5
026C: BCF 06.1
0272: BSF 03.5
0273: BCF 06.1
0274: BCF 03.5
0275: BCF 06.1
....................
.................... // port_b_pullups(TRUE); // Zapni pullupy, aby slo cist DIPswitch
.................... // do
815,311 → 838,270
.................... // {
.................... // Precti trimry
.................... set_adc_channel(PWM); // Zjisteni nastaveni PWM
026D: MOVLW 00
026E: MOVWF 78
026F: MOVF 1F,W
0270: ANDLW C7
0271: IORWF 78,W
0272: MOVWF 1F
0276: MOVLW 00
0277: MOVWF 78
0278: MOVF 1F,W
0279: ANDLW C7
027A: IORWF 78,W
027B: MOVWF 1F
.................... delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku
0273: CLRWDT
0274: MOVLW 1F
0275: MOVWF 77
0276: DECFSZ 77,F
0277: GOTO 276
0278: NOP
0279: NOP
.................... perioda=(read_adc()>>1)+40; // rozsah: 40 az 167
027A: BSF 1F.2
027B: BTFSC 1F.2
027C: GOTO 27B
027D: MOVF 1E,W
027C: CLRWDT
027D: MOVLW 1F
027E: MOVWF 77
027F: BCF 03.0
0280: RRF 77,F
0281: MOVF 77,W
0282: ADDLW 28
0283: MOVWF 6B
027F: DECFSZ 77,F
0280: GOTO 27F
0281: NOP
0282: NOP
.................... perioda=(read_adc()>>2)+40; // rozsah: 40 az 103
0283: BSF 1F.2
0284: BTFSC 1F.2
0285: GOTO 284
0286: MOVF 1E,W
0287: MOVWF 77
0288: RRF 77,F
0289: RRF 77,F
028A: MOVLW 3F
028B: ANDWF 77,F
028C: MOVF 77,W
028D: ADDLW 28
028E: MOVWF 6B
....................
.................... set_adc_channel(ROZJEZD); // Zjisteni nastaveni rozjezdu
0284: MOVLW 08
0285: MOVWF 78
0286: MOVF 1F,W
0287: ANDLW C7
0288: IORWF 78,W
0289: MOVWF 1F
028F: MOVLW 08
0290: MOVWF 78
0291: MOVF 1F,W
0292: ANDLW C7
0293: IORWF 78,W
0294: MOVWF 1F
.................... delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku
028A: CLRWDT
028B: MOVLW 1F
028C: MOVWF 77
028D: DECFSZ 77,F
028E: GOTO 28D
028F: NOP
0290: NOP
.................... razeni=read_adc()>>1; // rozsah: 0 az 127
0291: BSF 1F.2
0292: BTFSC 1F.2
0293: GOTO 292
0294: BCF 03.0
0295: RRF 1E,W
0296: MOVWF 6C
0295: CLRWDT
0296: MOVLW 1F
0297: MOVWF 77
0298: DECFSZ 77,F
0299: GOTO 298
029A: NOP
029B: NOP
.................... razeni=read_adc()>>3; // rozsah: 0 az 31
029C: BSF 1F.2
029D: BTFSC 1F.2
029E: GOTO 29D
029F: RRF 1E,W
02A0: MOVWF 6C
02A1: RRF 6C,F
02A2: RRF 6C,F
02A3: MOVLW 1F
02A4: ANDWF 6C,F
....................
.................... // Rozjeti menice
.................... set_pwm1_duty(0); // Zastav PWM, aby slo nastavit jinou frekvenci
0297: CLRF 15
02A5: CLRF 15
.................... setup_timer_2(T2_DIV_BY_1,perioda,1); // perioda
0298: MOVLW 00
0299: MOVWF 78
029A: IORLW 04
029B: MOVWF 12
029C: MOVF 6B,W
029D: BSF 03.5
029E: MOVWF 12
02A6: MOVLW 00
02A7: MOVWF 78
02A8: IORLW 04
02A9: MOVWF 12
02AA: MOVF 6B,W
02AB: BSF 03.5
02AC: MOVWF 12
.................... set_pwm1_duty(DUTY2); // PWM pro zatizeni clanku pri jedne 500W zarovce
029F: MOVLW 13
02A0: BCF 03.5
02A1: MOVWF 15
02AD: MOVLW 13
02AE: BCF 03.5
02AF: MOVWF 15
....................
.................... pip(); // potvrzeni odstartovani / servisni mod
02A2: GOTO 06B
02B0: GOTO 05F
.................... delay_ms(500);
02A3: MOVLW 02
02A4: MOVWF 6E
02A5: MOVLW FA
02A6: MOVWF 6F
02A7: CALL 048
02A8: DECFSZ 6E,F
02A9: GOTO 2A5
02B1: MOVLW 02
02B2: MOVWF 70
02B3: MOVLW FA
02B4: MOVWF 71
02B5: CALL 03C
02B6: DECFSZ 70,F
02B7: GOTO 2B3
....................
.................... // } while (input(SW1)); // Je zapnut servisni mod? SW1(OFF)=ANO
.................... // port_b_pullups(FALSE); // Vypni pullupy, aby se setrilo energii
....................
.................... // Regulace nabíjení
.................... // zmereni napeti na clancich
.................... output_high(REFPWR); // Prepni AD na mereni napeti clanku
02AA: BSF 03.5
02AB: BCF 06.1
02AC: BCF 03.5
02AD: BSF 06.1
02B8: BSF 03.5
02B9: BCF 06.1
02BA: BCF 03.5
02BB: BSF 06.1
.................... set_adc_channel(NAPETI); // Prepni Zmer napeti clanku
02AE: MOVLW 20
02AF: MOVWF 78
02B0: MOVF 1F,W
02B1: ANDLW C7
02B2: IORWF 78,W
02B3: MOVWF 1F
02BC: MOVLW 20
02BD: MOVWF 78
02BE: MOVF 1F,W
02BF: ANDLW C7
02C0: IORWF 78,W
02C1: MOVWF 1F
.................... delay_us(50); // Pockej na prepnuti kanalu A/D prevodniku
02B4: CLRWDT
02B5: MOVLW 0F
02B6: MOVWF 77
02B7: DECFSZ 77,F
02B8: GOTO 2B7
02B9: NOP
.................... for(n=1;n<=10;n++)
02BA: MOVLW 01
02BB: MOVWF 6A
02BC: MOVF 6A,W
02BD: SUBLW 0A
02BE: BTFSS 03.0
02BF: GOTO 2DC
.................... {
.................... // Zmer napeti (aktualni zatizeni clanku)
.................... uclanku=read_adc();
02C0: BSF 1F.2
02C1: BTFSC 1F.2
02C2: GOTO 2C1
02C3: MOVF 1E,W
02C4: MOVWF 6D
.................... // Uprav parametry menice
.................... if (uclanku>105)
02C5: MOVF 6D,W
02C6: SUBLW 69
02C7: BTFSC 03.0
02C8: GOTO 2CB
.................... {
.................... perioda++;
02C9: INCF 6B,F
.................... }
.................... else
02CA: GOTO 2CC
.................... {
.................... perioda--;
02CB: DECF 6B,F
.................... }
.................... set_pwm1_duty(0); // Zastav PWM, aby slo nastavit jinou frekvenci
02CC: CLRF 15
.................... setup_timer_2(T2_DIV_BY_1,perioda,1); // perioda
02CD: MOVLW 00
02CE: MOVWF 78
02CF: IORLW 04
02D0: MOVWF 12
02D1: MOVF 6B,W
02D2: BSF 03.5
02D3: MOVWF 12
.................... set_pwm1_duty(DUTY2); // PWM pro zatizeni clanku pri jedne 500W zarovce
02D4: MOVLW 13
02D5: BCF 03.5
02D6: MOVWF 15
.................... delay_ms(100);
02D7: MOVLW 64
02D8: MOVWF 6F
02D9: CALL 048
.................... }
02DA: INCF 6A,F
02DB: GOTO 2BC
.................... output_low(REFPWR);
02DC: BSF 03.5
02DD: BCF 06.1
02DE: BCF 03.5
02DF: BCF 06.1
02C2: CLRWDT
02C3: MOVLW 0F
02C4: MOVWF 77
02C5: DECFSZ 77,F
02C6: GOTO 2C5
02C7: NOP
.................... uclanku=read_adc();
02C8: BSF 1F.2
02C9: BTFSC 1F.2
02CA: GOTO 2C9
02CB: MOVF 1E,W
02CC: MOVWF 6D
.................... output_low(REFPWR); // odpoj odpor pro mereni napeti
02CD: BSF 03.5
02CE: BCF 06.1
02CF: BCF 03.5
02D0: BCF 06.1
....................
.................... // posli telemetrii
.................... sprintf(AXstring,"p=%u r=%u u=%u", perioda, razeni, uclanku); // Convert DATA to String.
*
01E1: CLRF 69
01EA: CLRF 69
*
02E0: MOVLW 40
02E1: MOVWF 69
02E2: MOVLW 70
02E3: MOVWF 70
02E4: CALL 095
02E5: MOVLW 3D
02E6: MOVWF 70
02E7: CALL 095
02E8: MOVF 6B,W
02E9: MOVWF 6E
02EA: MOVLW 1B
02EB: MOVWF 6F
02EC: CALL 0B2
02ED: MOVLW 20
02EE: MOVWF 70
02EF: CALL 095
02F0: MOVLW 72
02F1: MOVWF 70
02F2: CALL 095
02F3: MOVLW 3D
02F4: MOVWF 70
02F5: CALL 095
02F6: MOVF 6C,W
02F7: MOVWF 6E
02F8: MOVLW 1B
02F9: MOVWF 6F
02FA: CALL 0B2
02FB: MOVLW 20
02FC: MOVWF 70
02FD: CALL 095
02FE: MOVLW 75
02FF: MOVWF 70
0300: CALL 095
0301: MOVLW 3D
0302: MOVWF 70
0303: CALL 095
0304: MOVF 6D,W
0305: MOVWF 6E
0306: MOVLW 1B
0307: MOVWF 6F
0308: CALL 0B2
02D1: MOVLW 40
02D2: MOVWF 69
02D3: MOVLW 70
02D4: MOVWF 72
02D5: CALL 08B
02D6: MOVLW 3D
02D7: MOVWF 72
02D8: CALL 08B
02D9: MOVF 6B,W
02DA: MOVWF 70
02DB: MOVLW 1B
02DC: MOVWF 71
02DD: CALL 0A8
02DE: MOVLW 20
02DF: MOVWF 72
02E0: CALL 08B
02E1: MOVLW 72
02E2: MOVWF 72
02E3: CALL 08B
02E4: MOVLW 3D
02E5: MOVWF 72
02E6: CALL 08B
02E7: MOVF 6C,W
02E8: MOVWF 70
02E9: MOVLW 1B
02EA: MOVWF 71
02EB: CALL 0A8
02EC: MOVLW 20
02ED: MOVWF 72
02EE: CALL 08B
02EF: MOVLW 75
02F0: MOVWF 72
02F1: CALL 08B
02F2: MOVLW 3D
02F3: MOVWF 72
02F4: CALL 08B
02F5: MOVF 6D,W
02F6: MOVWF 70
02F7: MOVLW 1B
02F8: MOVWF 71
02F9: CALL 0A8
.................... SendPacket(&AXstring[0]);
0309: MOVLW 40
030A: MOVWF 6E
030B: GOTO 177
02FA: MOVLW 40
02FB: MOVWF 70
02FC: GOTO 16D
....................
.................... delay_ms(13000); // Pockame 14s
030C: MOVLW 34
030D: MOVWF 6E
030E: MOVLW FA
030F: MOVWF 6F
0310: CALL 048
0311: DECFSZ 6E,F
0312: GOTO 30E
.................... delay_ms(14000); // Pockame do 14.5s
02FD: MOVLW 38
02FE: MOVWF 70
02FF: MOVLW FA
0300: MOVWF 71
0301: CALL 03C
0302: DECFSZ 70,F
0303: GOTO 2FF
....................
.................... // rozjezd
.................... SSPSTAT = 0; // inicializace SPI jednotky
0313: BSF 03.5
0314: CLRF 14
.................... SSPCON1 = 0x22; // SPI OSC/64
0315: MOVLW 22
0316: BCF 03.5
0317: MOVWF 14
.................... MotorPattern=0x02; // prvni data pro vyslani
0318: MOVLW 02
0319: MOVWF 68
.................... SSPBUF=MotorPattern;
031A: MOVF 68,W
031B: MOVWF 13
.................... enable_interrupts(global);
031C: MOVLW C0
031D: IORWF 0B,F
.................... enable_interrupts(INT_SSP); // az budou vyslana, prijde interrupt od SSP
031E: BSF 03.5
031F: BSF 0C.3
....................
.................... for(n=0; n<=7; n++) // razeni osmi rychlostnich stupnu
0320: BCF 03.5
0321: CLRF 6A
0322: MOVF 6A,W
0323: SUBLW 07
0324: BTFSS 03.0
0325: GOTO 32F
.................... {
.................... MotorPattern=Pattern[n];
0326: MOVF 6A,W
0327: CALL 037
0328: MOVWF 78
0329: MOVWF 68
.................... delay_ms(razeni); // Pockej na dalsi razeni
032A: MOVF 6C,W
032B: MOVWF 6F
032C: CALL 048
.................... };
.................... // rozjezd
.................... for(ble=1;ble<=1000;ble++)
0304: CLRF 6F
0305: MOVLW 01
0306: MOVWF 6E
0307: MOVF 6F,W
0308: SUBLW 03
0309: BTFSS 03.0
030A: GOTO 333
030B: BTFSS 03.2
030C: GOTO 311
030D: MOVF 6E,W
030E: SUBLW E8
030F: BTFSS 03.0
0310: GOTO 333
.................... {
.................... for(n=0;n<=razeni;n++)
0311: CLRF 6A
0312: MOVF 6A,W
0313: SUBWF 6C,W
0314: BTFSS 03.0
0315: GOTO 32F
.................... {
.................... output_high(MOTOR);
0316: BSF 03.5
0317: BCF 06.2
0318: BCF 03.5
0319: BSF 06.2
.................... delay_us(ble);
031A: MOVF 6E,W
031B: MOVWF 72
031C: CALL 1B0
.................... output_low(MOTOR);
031D: BSF 03.5
031E: BCF 06.2
031F: BCF 03.5
0320: BCF 06.2
.................... delay_us(1000-ble);
0321: MOVF 6E,W
0322: SUBLW E8
0323: MOVWF 70
0324: MOVLW 03
0325: MOVWF 71
0326: MOVF 6F,W
0327: BTFSS 03.0
0328: INCFSZ 6F,W
0329: SUBWF 71,F
032A: MOVF 70,W
032B: MOVWF 72
032C: CALL 1B0
.................... }
032D: INCF 6A,F
032E: GOTO 322
.................... SSPSTAT = 0;
032F: BSF 03.5
0330: CLRF 14
.................... SSPCON1 = 0; // SPI stop
0331: BCF 03.5
0332: CLRF 14
.................... disable_interrupts(INT_SSP); // zastav preruseni od SSP
0333: BSF 03.5
0334: BCF 0C.3
032E: GOTO 312
.................... }
032F: INCF 6E,F
0330: BTFSC 03.2
0331: INCF 6F,F
0332: GOTO 307
....................
.................... // jedem co to da
.................... output_high(MOTOR);
0335: BCF 06.2
0336: BCF 03.5
0337: BSF 06.2
0333: BSF 03.5
0334: BCF 06.2
0335: BCF 03.5
0336: BSF 06.2
....................
.................... /*
.................... if (TRUE) // Venkovni jizda?
.................... {
.................... delay_ms(5000); // Venku muzeme jet 5s
.................... set_pwm1_duty(0); // Zastav menic
.................... // output_low(MOTOR); // Zastav motor
.................... while(TRUE) restart_wdt(); // Cekej porad
.................... };
.................... delay_ms(3000);
.................... */
.................... delay_ms(1300); // Nemeli bysme jet dele nez 1,3s :-)
0338: MOVLW 0A
0339: MOVWF 6E
033A: MOVLW 82
033B: MOVWF 6F
033C: CALL 048
033D: DECFSZ 6E,F
033E: GOTO 33A
0337: MOVLW 0A
0338: MOVWF 70
0339: MOVLW 82
033A: MOVWF 71
033B: CALL 03C
033C: DECFSZ 70,F
033D: GOTO 339
.................... output_low(MOTOR); // Zastav motor
033F: BSF 03.5
0340: BCF 06.2
0341: BCF 03.5
0342: BCF 06.2
033E: BSF 03.5
033F: BCF 06.2
0340: BCF 03.5
0341: BCF 06.2
.................... // Menic je stale zapnut a zatezuje clanky
....................
.................... while(TRUE); // Cekej, dokud se neztrati svetlo,
0343: GOTO 343
0342: GOTO 342
.................... // nebo prijde WatchDog
....................
.................... }
0344: SLEEP
0343: SLEEP
 
Configuration Fuses:
Word 1: 273C WDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT DEBUG CCPB3 NOPROTECT INTRC_IO
Word 1: 2738 NOWDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT DEBUG CCPB3 NOPROTECT INTRC_IO
Word 2: 3FFC NOFCMEN NOIESO
/roboti/solarni/2006/scamnum_specularis/menic.SYM
1,8 → 1,8
003 STATUS
013 SSPBUF
014 SSPCON1
015 CCP_1_LOW
015-016 CCP_1
015 CCP_1_LOW
016 CCP_1_HIGH
020 @INTERRUPT_AREA
021 @INTERRUPT_AREA
28,26 → 28,26
06B main.perioda
06C main.razeni
06D main.uclanku
06E SendPacket.data
06E @PRINTF_U_324.P1
06E.0 pip.beep
06E main.@SCRATCH
06F pip.i
06F @PRINTF_U_324.P1
06F @delay_ms1.P2
06F SendPacket.@SCRATCH
06F main.@SCRATCH
070 @DIV88.P1
070 @SPRINTF.P2
070 SendByte.inbyte
071 SendByte.k
071 @DIV88.P1
072 SendByte.bt
072 @DIV88.@SCRATCH
073 fcsbit.tbyte
073 SendByte.@SCRATCH
074 fcsbit.@SCRATCH
075 fcsbit.@SCRATCH
06E-06F main.ble
070 SendPacket.data
070 @PRINTF_U_325.P1
070.0 pip.beep
070 main.@SCRATCH
071 pip.i
071 @delay_ms1.P1
071 @PRINTF_U_325.P2
071 SendPacket.@SCRATCH
071 main.@SCRATCH
072 @delay_us1.P1
072 SendByte.inbyte
072 @DIV88.P1
072 @SPRINTF.P2
073 @DIV88.P1
073 SendByte.k
074 SendByte.bt
074 @DIV88.@SCRATCH
075 fcsbit.tbyte
075 SendByte.@SCRATCH
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
54,25 → 54,27
079 @SCRATCH
07A @SCRATCH
07B @SCRATCH
07C fcsbit.@SCRATCH
07D fcsbit.@SCRATCH
094 SSPSTAT
09C.6 C1OUT
09C.7 C2OUT
 
0048 @delay_ms1
00E7 flipout
0149 fcsbit
00EE SendBit
012E SendByte
0177 SendPacket
0037 @const57
0043 IntSSP
006B pip
005E cvak
01BA main
0095 @SPRINTF
009D @DIV88
00B2 @PRINTF_U_324
01BA @cinit
003C @delay_ms1
01B0 @delay_us1
00DD flipout
013F fcsbit
00E4 SendBit
0124 SendByte
016D SendPacket
0037 IntSSP
005F pip
0052 cvak
01C3 main
008B @SPRINTF
0093 @DIV88
00A8 @PRINTF_U_325
01C3 @cinit
 
Project Files:
D:\KAKL\roboti\solarni\2006\scamnum\menic.c
/roboti/solarni/2006/scamnum_specularis/menic.c
73,6 → 73,7
int8 perioda;
int8 razeni;
int8 uclanku;
int16 ble;
 
setup_timer_0(RTCC_INTERNAL);setup_wdt(WDT_1152MS);
setup_timer_1(T1_DISABLED);
114,11 → 115,11
// Precti trimry
set_adc_channel(PWM); // Zjisteni nastaveni PWM
delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku
perioda=(read_adc()>>1)+40; // rozsah: 40 az 167
perioda=(read_adc()>>2)+40; // rozsah: 40 az 103
 
set_adc_channel(ROZJEZD); // Zjisteni nastaveni rozjezdu
delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku
razeni=read_adc()>>1; // rozsah: 0 az 127
razeni=read_adc()>>3; // rozsah: 0 az 31
 
// Rozjeti menice
set_pwm1_duty(0); // Zastav PWM, aby slo nastavit jinou frekvenci
131,65 → 132,34
// } while (input(SW1)); // Je zapnut servisni mod? SW1(OFF)=ANO
// port_b_pullups(FALSE); // Vypni pullupy, aby se setrilo energii
 
// Regulace nabíjení
// zmereni napeti na clancich
output_high(REFPWR); // Prepni AD na mereni napeti clanku
set_adc_channel(NAPETI); // Prepni Zmer napeti clanku
delay_us(50); // Pockej na prepnuti kanalu A/D prevodniku
for(n=1;n<=10;n++)
{
// Zmer napeti (aktualni zatizeni clanku)
uclanku=read_adc();
// Uprav parametry menice
if (uclanku>105)
{
perioda++;
}
else
{
perioda--;
}
set_pwm1_duty(0); // Zastav PWM, aby slo nastavit jinou frekvenci
setup_timer_2(T2_DIV_BY_1,perioda,1); // perioda
set_pwm1_duty(DUTY2); // PWM pro zatizeni clanku pri jedne 500W zarovce
delay_ms(100);
}
output_low(REFPWR);
uclanku=read_adc();
output_low(REFPWR); // odpoj odpor pro mereni napeti
 
// posli telemetrii
sprintf(AXstring,"p=%u r=%u u=%u", perioda, razeni, uclanku); // Convert DATA to String.
SendPacket(&AXstring[0]);
 
delay_ms(13000); // Pockame 14s
delay_ms(14000); // Pockame do 14.5s
 
// rozjezd
SSPSTAT = 0; // inicializace SPI jednotky
SSPCON1 = 0x22; // SPI OSC/64
MotorPattern=0x02; // prvni data pro vyslani
SSPBUF=MotorPattern;
enable_interrupts(global);
enable_interrupts(INT_SSP); // az budou vyslana, prijde interrupt od SSP
// rozjezd
for(ble=1;ble<=1000;ble++)
{
for(n=0;n<=razeni;n++)
{
output_high(MOTOR);
delay_us(ble);
output_low(MOTOR);
delay_us(1000-ble);
}
}
 
for(n=0; n<=7; n++) // razeni osmi rychlostnich stupnu
{
MotorPattern=Pattern[n];
delay_ms(razeni); // Pockej na dalsi razeni
};
SSPSTAT = 0;
SSPCON1 = 0; // SPI stop
disable_interrupts(INT_SSP); // zastav preruseni od SSP
 
// jedem co to da
output_high(MOTOR);
 
/*
if (TRUE) // Venkovni jizda?
{
delay_ms(5000); // Venku muzeme jet 5s
set_pwm1_duty(0); // Zastav menic
// output_low(MOTOR); // Zastav motor
while(TRUE) restart_wdt(); // Cekej porad
};
delay_ms(3000);
*/
delay_ms(1300); // Nemeli bysme jet dele nez 1,3s :-)
output_low(MOTOR); // Zastav motor
// Menic je stale zapnut a zatezuje clanky
/roboti/solarni/2006/scamnum_specularis/menic.cof
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/roboti/solarni/2006/scamnum_specularis/menic.h
2,7 → 2,7
 
#device adc=8
 
#fuses WDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, \
#fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, \
NOWRT, DEBUG, NOPROTECT, NOFCMEN, NOIESO, CCPB3
 
#use delay(clock=3900000,RESTART_WDT)
/roboti/solarni/2006/scamnum_specularis/menic.sta
1,42 → 1,42
 
ROM used: 837 (20%)
837 (20%) including unused fragments
ROM used: 836 (20%)
836 (20%) including unused fragments
 
1 Average locations per line
5 Average locations per statement
6 Average locations per statement
 
RAM used: 85 (49%) at main() level
91 (52%) worst case
RAM used: 87 (50%) at main() level
94 (54%) worst case
 
Lines Stmts % Files
----- ----- --- -----
201 92 58 D:\KAKL\roboti\solarni\2006\scamnum\menic.c
171 75 53 D:\KAKL\roboti\solarni\2006\scamnum\menic.c
10 0 0 D:\KAKL\roboti\solarni\2006\scamnum\menic.h
279 0 0 C:\Program Files\PICC\devices\16F88.h
140 67 27 D:\KAKL\roboti\solarni\2006\scamnum\AX25.c
140 67 31 D:\KAKL\roboti\solarni\2006\scamnum\AX25.c
----- -----
1260 318 Total
1200 284 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 22 3 1 @delay_ms1
0 19 2 1 @delay_us1
0 7 1 0 flipout
0 64 8 0 SendBit
0 73 9 4 SendByte
0 67 8 2 SendPacket
0 12 1 0 @const57
0 5 1 0 IntSSP
0 42 5 2 pip
0 44 5 2 pip
0 13 2 0 cvak
0 395 47 6 main
0 385 46 8 main
0 8 1 1 @SPRINTF
0 21 3 3 @DIV88
0 53 6 2 @PRINTF_U_324
0 53 6 2 @PRINTF_U_325
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-00036 51 0
00037-007FF 782 1211
00037-007FF 781 1212
00800-00FFF 0 2048
 
/roboti/solarni/2006/scamnum_specularis/menic.tre
1,15 → 1,14
ÀÄmenic
ÃÄmain 0/395 Ram=6
ÃÄmain 0/385 Ram=8
³ ÃÄ??0??
³ ÃÄ@delay_ms1 0/22 Ram=1
³ ÃÄcvak 0/13 Ram=0
³ ÃÄ@delay_ms1 0/22 Ram=1
³ ÃÄpip 0/42 Ram=2
³ ÃÄpip 0/44 Ram=2
³ ÃÄ@delay_ms1 0/22 Ram=1
³ ÃÄ@delay_ms1 0/22 Ram=1
³ ÃÄ@SPRINTF 0/8 Ram=1
³ ÃÄ@SPRINTF 0/8 Ram=1
³ ÃÄ@PRINTF_U_324 0/53 Ram=2
³ ÃÄ@PRINTF_U_325 0/53 Ram=2
³ ³ ÃÄ@DIV88 0/21 Ram=3
³ ³ ÃÄ@SPRINTF 0/8 Ram=1
³ ³ ÃÄ@DIV88 0/21 Ram=3
18,7 → 17,7
³ ÃÄ@SPRINTF 0/8 Ram=1
³ ÃÄ@SPRINTF 0/8 Ram=1
³ ÃÄ@SPRINTF 0/8 Ram=1
³ ÃÄ@PRINTF_U_324 0/53 Ram=2
³ ÃÄ@PRINTF_U_325 0/53 Ram=2
³ ³ ÃÄ@DIV88 0/21 Ram=3
³ ³ ÃÄ@SPRINTF 0/8 Ram=1
³ ³ ÃÄ@DIV88 0/21 Ram=3
27,7 → 26,7
³ ÃÄ@SPRINTF 0/8 Ram=1
³ ÃÄ@SPRINTF 0/8 Ram=1
³ ÃÄ@SPRINTF 0/8 Ram=1
³ ÃÄ@PRINTF_U_324 0/53 Ram=2
³ ÃÄ@PRINTF_U_325 0/53 Ram=2
³ ³ ÃÄ@DIV88 0/21 Ram=3
³ ³ ÃÄ@SPRINTF 0/8 Ram=1
³ ³ ÃÄ@DIV88 0/21 Ram=3
71,7 → 70,7
³ ³ ÃÄflipout 0/7 Ram=0
³ ³ ÀÄSendBit 0/64 Ram=0
³ ÃÄ@delay_ms1 0/22 Ram=1
³ ÃÄ@const57 0/12 Ram=0
³ ÃÄ@delay_ms1 0/22 Ram=1
³ ÃÄ@delay_us1 0/19 Ram=1
³ ÃÄ@delay_us1 0/19 Ram=1
³ ÀÄ@delay_ms1 0/22 Ram=1
ÀÄIntSSP 0/5 Ram=0