Subversion Repositories svnkaklik

Compare Revisions

No changes between revisions

Ignore whitespace Rev 1 → Rev 2

/roboti/solarni/2005/jumpk/menic.BAK
0,0 → 1,7
#include <16F88.h>
 
#device adc=8
#fuses WDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, \
NODEBUG, NOPROTECT, NOFCMEN, NOIESO, CCPB3
#use delay(clock=4000000, RESTART_WDT)
 
/roboti/solarni/2005/jumpk/menic.HEX
0,0 → 1,44
:1000000000308A005F280000FF00030E8301A1007A
:100010007F08A0000A08A8008A01A00E0408A20018
:100020007708A3007808A4007908A5007A08A6003C
:100030007B08A700831383128C308400801D222844
:100040008C193528220884002308F7002408F800BA
:100050002508F9002608FA002708FB0028088A006E
:10006000210E8300FF0E7F0E09008A1143280A101B
:100070008A100A118207023406340E341E343E34CC
:100080007E34FE34FF34290893008C118A11222813
:100090002F308400000803195E280130F800BF30BB
:1000A000F7006400F70B5128F80B4F284A30F7008F
:1000B000F70B582800006400800B4D2800348401A1
:1000C0001F30830583161F129F121B0880399B0067
:1000D00007309C001C0883120D13603083168F00BC
:1000E0000108C03981000E30F7000730831281010A
:1000F000813084000008F03907388000640000086F
:10010000F739F719F0397704800083161F129F1210
:100110001B088039D2389B001F1383121F179F17AB
:1001200083169F1383121F149412831606118614CC
:1001300006120030831294008316940083129001FB
:10014000073083169C00050864000230F700F70BA7
:10015000A728000000001C0883120D1383169D01C0
:1001600086118312861183160611831206118316D7
:100170008610831286102030F8001F08C7397804D3
:100180009F00950183168611831286110C3097000B
:100190000030F80004389200643083169200623018
:1001A0008F0002308312950083168610831286100A
:1001B0006430AF00482083168610831286141430F2
:1001C000AF0048201F151F19E3281E08783C031CA8
:1001D000D42883168610831286100830F8001F0872
:1001E000C73978049F0064002030F700F70BF62829
:1001F000000000001F151F19FB281E08F700031040
:10020000F70C7708283EAC0095010030F800043860
:1002100092002C088316920014308312950032301D
:10022000AE00FA30AF004820AE0B112983169401BE
:100230002230831294000230A90029089300C030B4
:100240008B0483168C158312AA012A08073C031C11
:1002500032292A083720F800A9003730AF0048209B
:10026000AA0A2529831694018312940183168C11FE
:100270000611831206150A30AE008230AF00482006
:10028000AE0B3D2983160611831206114629630021
:04400E003C2FFC3F08
:00000001FF
;PIC16F88
/roboti/solarni/2005/jumpk/menic.LST
0,0 → 1,463
CCS PCM C Compiler, Version 3.221, 27853 18-IX-05 23:22
 
Filename: C:\PIC\jumpk\menic.LST
 
ROM used: 328 words (8%)
Largest free fragment is 2048
RAM used: 21 (12%) at main() level
21 (12%) worst case
Stack: 2 worst case (1 in main + 1 for interrupts)
 
*
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 05F
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.3
001F: GOTO 022
0020: BTFSC 0C.3
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
.................... //----------------------------
.................... // Sagitta - 9. 9. 2005
.................... //----------------------------
....................
.................... #include ".\menic.h"
.................... #include <16F88.h>
.................... //////// Standard Header file for the PIC16F88 device ////////////////
.................... #device PIC16F88
.................... #list
....................
....................
.................... #device adc=8
....................
.................... #fuses WDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, \
.................... NODEBUG, NOPROTECT, NOFCMEN, NOIESO, CCPB3
....................
.................... #use delay(clock=4000000, RESTART_WDT)
*
0048: MOVLW 2F
0049: MOVWF 04
004A: MOVF 00,W
004B: BTFSC 03.2
004C: GOTO 05E
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 4A
0057: MOVWF 77
0058: DECFSZ 77,F
0059: GOTO 058
005A: NOP
005B: CLRWDT
005C: DECFSZ 00,F
005D: GOTO 04D
005E: RETLW 00
....................
....................
....................
.................... #define RAZENI 55 // Po kolika ms se bude menit rychlost pri rozjizdeni
.................... #define REFSTART 120 // Hodnota komparatoru odpovidajici 1,7V pri
.................... // nezatizenych solarnich clancich
.................... #define DUTY1 2 // Delka sepnuti PWM v us pro sero
.................... #define DUTY2 20 // Delka sepnuti PWM v us pro jednu zarovku 500W
....................
.................... // Tabulka napeti vuci referencni LED (cca 1,7V)
.................... // hodnota prevodniku / napeti na clancich
.................... // 250 1,6V
.................... // 200 2,1V
.................... // 150 2,8V
.................... // 145 2,9V
.................... // 120 3,6V
.................... // 110 4,0V
....................
.................... #define MENIC PIN_B3 // Spinani tranzistoru menice
.................... #define REFPWR PIN_B1 // Napajeni zdroje referencniho napeti
.................... #define MOTOR PIN_B2 // Spinani tranzistoru motoru
....................
.................... #byte SSPBUF = 0x13 // Registry jednotky SSP
.................... #byte SSPCON1 = 0x14
.................... #byte SSPSTAT = 0x94
....................
.................... // Vzorky pro generovani PWM pomoci SSP
.................... unsigned int8 const Pattern[8] = {0x02,0x06,0x0e,0x1e,0x3e,0x7e,0xfe,0xff};
.................... unsigned int8 MotorPattern;
....................
.................... #INT_SSP
.................... void IntSSP() // Vyvola se po odeslani znaku pres SSP
.................... {
.................... SSPBUF=MotorPattern; // znovu vysli stejnou hodnotu
*
0043: MOVF 29,W
0044: MOVWF 13
.................... }
....................
0045: BCF 0C.3
0046: BCF 0A.3
0047: GOTO 022
.................... void main()
.................... {
*
005F: CLRF 04
0060: MOVLW 1F
0061: ANDWF 03,F
0062: BSF 03.5
0063: BCF 1F.4
0064: BCF 1F.5
0065: MOVF 1B,W
0066: ANDLW 80
0067: MOVWF 1B
0068: MOVLW 07
0069: MOVWF 1C
006A: MOVF 1C,W
006B: BCF 03.5
006C: BCF 0D.6
006D: MOVLW 60
006E: BSF 03.5
006F: MOVWF 0F
.................... int8 n;
.................... int8 cekej;
.................... int8 perioda;
.................... int8 rozjezd;
....................
.................... // Inicializace casovacu a prevodniku
.................... setup_timer_0(RTCC_INTERNAL);setup_wdt(WDT_1152MS);
0070: MOVF 01,W
0071: ANDLW C0
0072: MOVWF 01
0073: MOVLW 0E
0074: MOVWF 77
0075: MOVLW 07
0076: BCF 03.5
0077: CLRF 01
0078: MOVLW 81
0079: MOVWF 04
007A: MOVF 00,W
007B: ANDLW F0
007C: IORLW 07
007D: MOVWF 00
007E: CLRWDT
007F: MOVF 00,W
0080: ANDLW F7
0081: BTFSC 77.3
0082: ANDLW F0
0083: IORWF 77,W
0084: MOVWF 00
.................... setup_adc_ports(ADC_CLOCK_INTERNAL|sAN1|sAN4|VSS_VDD);
0085: BSF 03.5
0086: BCF 1F.4
0087: BCF 1F.5
0088: MOVF 1B,W
0089: ANDLW 80
008A: IORLW D2
008B: MOVWF 1B
.................... setup_adc(ADC_CLOCK_INTERNAL);
008C: BCF 1F.6
008D: BCF 03.5
008E: BSF 1F.6
008F: BSF 1F.7
0090: BSF 03.5
0091: BCF 1F.7
0092: BCF 03.5
0093: BSF 1F.0
.................... setup_spi(FALSE);
0094: BCF 14.5
0095: BSF 03.5
0096: BCF 06.2
0097: BSF 06.1
0098: BCF 06.4
0099: MOVLW 00
009A: BCF 03.5
009B: MOVWF 14
009C: BSF 03.5
009D: MOVWF 14
.................... setup_timer_1(T1_DISABLED);
009E: BCF 03.5
009F: CLRF 10
.................... setup_comparator(NC_NC_NC_NC);
00A0: MOVLW 07
00A1: BSF 03.5
00A2: MOVWF 1C
00A3: MOVF 05,W
00A4: CLRWDT
00A5: MOVLW 02
00A6: MOVWF 77
00A7: DECFSZ 77,F
00A8: GOTO 0A7
00A9: NOP
00AA: NOP
00AB: MOVF 1C,W
00AC: BCF 03.5
00AD: BCF 0D.6
.................... setup_vref(FALSE);
00AE: BSF 03.5
00AF: CLRF 1D
....................
.................... output_low(MENIC); // Vsechno zastav
00B0: BCF 06.3
00B1: BCF 03.5
00B2: BCF 06.3
.................... output_low(MOTOR);
00B3: BSF 03.5
00B4: BCF 06.2
00B5: BCF 03.5
00B6: BCF 06.2
.................... output_low(REFPWR);
00B7: BSF 03.5
00B8: BCF 06.1
00B9: BCF 03.5
00BA: BCF 06.1
....................
.................... set_adc_channel(4); // Vyber AD kanal pro pomerne mereni napeti
00BB: MOVLW 20
00BC: MOVWF 78
00BD: MOVF 1F,W
00BE: ANDLW C7
00BF: IORWF 78,W
00C0: MOVWF 1F
.................... set_pwm1_duty(0); // Spust PWM, ale zatim s trvalou 0 na vystupu
00C1: CLRF 15
.................... setup_ccp1(CCP_PWM); // PWM pro zatizeni clanku v seru
00C2: BSF 03.5
00C3: BCF 06.3
00C4: BCF 03.5
00C5: BCF 06.3
00C6: MOVLW 0C
00C7: MOVWF 17
.................... setup_timer_2(T2_DIV_BY_1,100,1); // perioda PWM
00C8: MOVLW 00
00C9: MOVWF 78
00CA: IORLW 04
00CB: MOVWF 12
00CC: MOVLW 64
00CD: BSF 03.5
00CE: MOVWF 12
....................
.................... setup_oscillator(OSC_4MHZ|OSC_INTRC); // rozjed PIC (zvysi se odber)
00CF: MOVLW 62
00D0: MOVWF 0F
....................
.................... // jsme v depu?
.................... set_pwm1_duty(DUTY1); // delka sepnuti
00D1: MOVLW 02
00D2: BCF 03.5
00D3: MOVWF 15
.................... do
.................... {
.................... output_low(REFPWR);
00D4: BSF 03.5
00D5: BCF 06.1
00D6: BCF 03.5
00D7: BCF 06.1
.................... delay_ms(100);
00D8: MOVLW 64
00D9: MOVWF 2F
00DA: CALL 048
.................... output_high(REFPWR); // zapni napajeni napetove reference (LED)
00DB: BSF 03.5
00DC: BCF 06.1
00DD: BCF 03.5
00DE: BSF 06.1
.................... delay_ms(20);
00DF: MOVLW 14
00E0: MOVWF 2F
00E1: CALL 048
.................... } while (read_adc()>REFSTART); // Odkryl starter clanky?
00E2: BSF 1F.2
00E3: BTFSC 1F.2
00E4: GOTO 0E3
00E5: MOVF 1E,W
00E6: SUBLW 78
00E7: BTFSS 03.0
00E8: GOTO 0D4
.................... output_low(REFPWR);
00E9: BSF 03.5
00EA: BCF 06.1
00EB: BCF 03.5
00EC: BCF 06.1
....................
.................... // Precti trimr
.................... set_adc_channel(1); // Zjisteni nastaveni trimru PWM
00ED: MOVLW 08
00EE: MOVWF 78
00EF: MOVF 1F,W
00F0: ANDLW C7
00F1: IORWF 78,W
00F2: MOVWF 1F
.................... delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku
00F3: CLRWDT
00F4: MOVLW 20
00F5: MOVWF 77
00F6: DECFSZ 77,F
00F7: GOTO 0F6
00F8: NOP
00F9: NOP
.................... perioda=(read_adc()>>1)+40; // rozsah: 40 az 167
00FA: BSF 1F.2
00FB: BTFSC 1F.2
00FC: GOTO 0FB
00FD: MOVF 1E,W
00FE: MOVWF 77
00FF: BCF 03.0
0100: RRF 77,F
0101: MOVF 77,W
0102: ADDLW 28
0103: MOVWF 2C
.................... set_pwm1_duty(0); // Zastav PWM, aby slo zmenit periodu
0104: CLRF 15
.................... setup_timer_2(T2_DIV_BY_1,perioda,1); // Zapis nastavenou periodu
0105: MOVLW 00
0106: MOVWF 78
0107: IORLW 04
0108: MOVWF 12
0109: MOVF 2C,W
010A: BSF 03.5
010B: MOVWF 12
....................
.................... // nabíjíme
.................... set_pwm1_duty(DUTY2); // delka sepnuti PWM
010C: MOVLW 14
010D: BCF 03.5
010E: MOVWF 15
.................... delay_ms(12500);
010F: MOVLW 32
0110: MOVWF 2E
0111: MOVLW FA
0112: MOVWF 2F
0113: CALL 048
0114: DECFSZ 2E,F
0115: GOTO 111
....................
.................... // rozjezd
.................... SSPSTAT = 0; // inicializace SPI jednotky
0116: BSF 03.5
0117: CLRF 14
.................... SSPCON1 = 0x22; // SPI OSC/64
0118: MOVLW 22
0119: BCF 03.5
011A: MOVWF 14
.................... MotorPattern=Pattern[0];
011B: MOVLW 02
011C: MOVWF 29
.................... SSPBUF=MotorPattern; // 1. data pro vyslani
011D: MOVF 29,W
011E: MOVWF 13
.................... enable_interrupts(global);
011F: MOVLW C0
0120: IORWF 0B,F
.................... enable_interrupts(INT_SSP); // az budou vyslana, prijde preruseni
0121: BSF 03.5
0122: BSF 0C.3
....................
.................... for(n=0; n<=7; n++) // razeni osmi rychlostnich stupnu
0123: BCF 03.5
0124: CLRF 2A
0125: MOVF 2A,W
0126: SUBLW 07
0127: BTFSS 03.0
0128: GOTO 132
.................... {
.................... MotorPattern=Pattern[n];
0129: MOVF 2A,W
012A: CALL 037
012B: MOVWF 78
012C: MOVWF 29
.................... delay_ms(RAZENI); // Pockej na dalsi razeni
012D: MOVLW 37
012E: MOVWF 2F
012F: CALL 048
.................... };
0130: INCF 2A,F
0131: GOTO 125
.................... SSPSTAT = 0;
0132: BSF 03.5
0133: CLRF 14
.................... SSPCON1 = 0; // SPI stop
0134: BCF 03.5
0135: CLRF 14
.................... disable_interrupts(INT_SSP); // zastav preruseni od SSP
0136: BSF 03.5
0137: BCF 0C.3
....................
.................... // jedem co to da
.................... output_high(MOTOR);
0138: BCF 06.2
0139: BCF 03.5
013A: BSF 06.2
.................... delay_ms(1300); // dyl jak 1,3s bysme nemeli jet :)
013B: MOVLW 0A
013C: MOVWF 2E
013D: MOVLW 82
013E: MOVWF 2F
013F: CALL 048
0140: DECFSZ 2E,F
0141: GOTO 13D
.................... output_low(MOTOR); // zastav motor
0142: BSF 03.5
0143: BCF 06.2
0144: BCF 03.5
0145: BCF 06.2
.................... // Menic je stale zapnut a zatezuje clanky
....................
.................... while(TRUE); // Cekej, dokud se neztrati svetlo,
0146: GOTO 146
.................... // nebo prijde WatchDog
.................... }
....................
0147: SLEEP
 
Configuration Fuses:
Word 1: 2F3C WDT NOPUT MCLR NOBROWNOUT NOLVP NOCPD NOWRT NODEBUG CCPB3 NOPROTECT INTRC_IO
Word 2: 3FFC NOFCMEN NOIESO
/roboti/solarni/2005/jumpk/menic.PJT
0,0 → 1,53
[PROJECT]
Target=menic.HEX
Development_Mode=
Processor=0x688F
ToolSuite=CCS
 
[Directories]
Include=C:\Program Files\PICC\devices\
Library=
LinkerScript=
 
[Target Data]
FileList=menic.c;
BuildTool=C-COMPILER
OptionString=+FM
AdditionalOptionString=
BuildRequired=1
 
[menic.c]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
 
[mru-list]
1=menic.c
 
[Windows]
0=0000 menic.c 0 0 796 451 3 0
 
[Opened Files]
1=D:\KAKLIK\programy\PIC_C\roboti\solarni\2005\jumpk\menic.c
2=C:\Program Files\PICC\devices\16F88.h
3=
4=
5=
[debugperif]
selected=Analog/Digital Conv
[debugram]
autoread=1
[debugeedata]
autoread=1
[debugbreak]
count=0
[pcwdebug]
watchcol0=75
[debugwatch]
count=0
[debugexpr]
expr=
sideeffects=0
/roboti/solarni/2005/jumpk/menic.SYM
0,0 → 1,58
013 SSPBUF
014 SSPCON1
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 MotorPattern
02A main.n
02B main.cekej
02C main.perioda
02D main.rozjezd
02E main.@SCRATCH
02F @delay_ms1.P1
02F main.@SCRATCH
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
079 @SCRATCH
07A @SCRATCH
07B @SCRATCH
094 SSPSTAT
09C.6 C1OUT
09C.7 C2OUT
 
0048 @delay_ms1
0037 @const30
0043 IntSSP
005F main
005F @cinit
 
Project Files:
C:\PIC\jumpk\menic.c
C:\PIC\jumpk\menic.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: C:\PIC\jumpk\menic.err
INHX8: C:\PIC\jumpk\menic.HEX
Symbols: C:\PIC\jumpk\menic.SYM
List: C:\PIC\jumpk\menic.LST
Debug/COFF: C:\PIC\jumpk\menic.cof
Call Tree: C:\PIC\jumpk\menic.tre
Statistics: C:\PIC\jumpk\menic.sta
/roboti/solarni/2005/jumpk/menic.c
0,0 → 1,114
//----------------------------
// Sagitta - 9. 9. 2005
//----------------------------
 
#include ".\menic.h"
 
#define RAZENI 55 // Po kolika ms se bude menit rychlost pri rozjizdeni
#define REFSTART 120 // Hodnota komparatoru odpovidajici 1,7V pri
// nezatizenych solarnich clancich
#define DUTY1 2 // Delka sepnuti PWM v us pro sero
#define DUTY2 20 // Delka sepnuti PWM v us pro jednu zarovku 500W
 
// Tabulka napeti vuci referencni LED (cca 1,7V)
// hodnota prevodniku / napeti na clancich
// 250 1,6V
// 200 2,1V
// 150 2,8V
// 145 2,9V
// 120 3,6V
// 110 4,0V
 
#define MENIC PIN_B3 // Spinani tranzistoru menice
#define REFPWR PIN_B1 // Napajeni zdroje referencniho napeti
#define MOTOR PIN_B2 // Spinani tranzistoru motoru
 
#byte SSPBUF = 0x13 // Registry jednotky SSP
#byte SSPCON1 = 0x14
#byte SSPSTAT = 0x94
 
// Vzorky pro generovani PWM pomoci SSP
unsigned int8 const Pattern[8] = {0x02,0x06,0x0e,0x1e,0x3e,0x7e,0xfe,0xff};
unsigned int8 MotorPattern;
 
#INT_SSP
void IntSSP() // Vyvola se po odeslani znaku pres SSP
{
SSPBUF=MotorPattern; // znovu vysli stejnou hodnotu
}
 
void main()
{
int8 n;
int8 cekej;
int8 perioda;
int8 rozjezd;
 
// Inicializace casovacu a prevodniku
setup_timer_0(RTCC_INTERNAL);setup_wdt(WDT_1152MS);
setup_adc_ports(ADC_CLOCK_INTERNAL|sAN1|sAN4|VSS_VDD);
setup_adc(ADC_CLOCK_INTERNAL);
setup_spi(FALSE);
setup_timer_1(T1_DISABLED);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
 
output_low(MENIC); // Vsechno zastav
output_low(MOTOR);
output_low(REFPWR);
 
set_adc_channel(4); // Vyber AD kanal pro pomerne mereni napeti
set_pwm1_duty(0); // Spust PWM, ale zatim s trvalou 0 na vystupu
setup_ccp1(CCP_PWM); // PWM pro zatizeni clanku v seru
setup_timer_2(T2_DIV_BY_1,100,1); // perioda PWM
 
setup_oscillator(OSC_4MHZ|OSC_INTRC); // rozjed PIC (zvysi se odber)
 
// jsme v depu?
set_pwm1_duty(DUTY1); // delka sepnuti
do
{
output_low(REFPWR);
delay_ms(100);
output_high(REFPWR); // zapni napajeni napetove reference (LED)
delay_ms(20);
} while (read_adc()>REFSTART); // Odkryl starter clanky?
output_low(REFPWR);
 
// Precti trimr
set_adc_channel(1); // Zjisteni nastaveni trimru PWM
delay_us(100); // Pockej na prepnuti kanalu A/D prevodniku
perioda=(read_adc()>>1)+40; // rozsah: 40 az 167
set_pwm1_duty(0); // Zastav PWM, aby slo zmenit periodu
setup_timer_2(T2_DIV_BY_1,perioda,1); // Zapis nastavenou periodu
 
// nabíjíme
set_pwm1_duty(DUTY2); // delka sepnuti PWM
delay_ms(12500);
 
// rozjezd
SSPSTAT = 0; // inicializace SPI jednotky
SSPCON1 = 0x22; // SPI OSC/64
MotorPattern=Pattern[0];
SSPBUF=MotorPattern; // 1. data pro vyslani
enable_interrupts(global);
enable_interrupts(INT_SSP); // az budou vyslana, prijde preruseni
 
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);
delay_ms(1300); // dyl jak 1,3s bysme nemeli jet :)
output_low(MOTOR); // zastav motor
// Menic je stale zapnut a zatezuje clanky
 
while(TRUE); // Cekej, dokud se neztrati svetlo,
// nebo prijde WatchDog
}
/roboti/solarni/2005/jumpk/menic.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
/roboti/solarni/2005/jumpk/menic.err
0,0 → 1,0
No Errors
/roboti/solarni/2005/jumpk/menic.h
0,0 → 1,9
#include <16F88.h>
 
#device adc=8
 
#fuses WDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, \
NODEBUG, NOPROTECT, NOFCMEN, NOIESO, CCPB3
 
#use delay(clock=4000000, RESTART_WDT)
 
/roboti/solarni/2005/jumpk/menic.sta
0,0 → 1,32
 
ROM used: 328 (8%)
328 (8%) including unused fragments
 
1 Average locations per line
6 Average locations per statement
 
RAM used: 21 (12%) at main() level
21 (12%) worst case
 
Lines Stmts % Files
----- ----- --- -----
115 51 100 C:\PIC\jumpk\menic.c
10 0 0 C:\PIC\jumpk\menic.h
275 0 0 C:\Program Files\PICC\devices\16F88.h
----- -----
800 102 Total
 
Page ROM % RAM Functions:
---- --- --- --- ----------
0 23 7 1 @delay_ms1
0 12 4 0 @const30
0 5 2 0 IntSSP
0 233 71 6 main
 
Segment Used Free
--------- ---- ----
00000-00003 4 0
00004-00036 51 0
00037-007FF 273 1720
00800-00FFF 0 2048
 
/roboti/solarni/2005/jumpk/menic.tre
0,0 → 1,10
ÀÄmenic
ÃÄmain 0/233 Ram=6
³ ÃÄ??0??
³ ÃÄ@delay_ms1 0/23 Ram=1
³ ÃÄ@delay_ms1 0/23 Ram=1
³ ÃÄ@delay_ms1 0/23 Ram=1
³ ÃÄ@const30 0/12 Ram=0
³ ÃÄ@delay_ms1 0/23 Ram=1
³ ÀÄ@delay_ms1 0/23 Ram=1
ÀÄIntSSP 0/5 Ram=0