/Designs/MRAKOMER2/SW/Ondrejov/motor/irmrak.c
48,7 → 48,7
{
output_B(0); // vypnuti motoru
printf("E"); // Hlasime chybu
err=0;
reset_cpu();
}
};
delay_ms(500); // cas na ustaleni trubky
58,9 → 58,9
// --- Najeti na vychozi polohu dole ---
void nula()
{
port=0b10100000; // vychozi nastaveni fazi pro rizeni motoru
port=0b10010000; // vychozi nastaveni fazi pro rizeni motoru
output_B(port);
j=0; // smer dolu
j=1; // smer dolu
delay_ms(500);
}
 
68,26 → 68,25
//------------------------------------------------
void main()
{
setup_oscillator(OSC_8MHZ|OSC_INTRC); // 8 MHz interni RC oscilator
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_OFF);
setup_spi(FALSE);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
setup_comparator(NC_NC_NC_NC);
setup_vref(FALSE);
setup_oscillator(OSC_8MHZ|OSC_INTRC);
 
output_B(0); // vypnuti motoru a topeni
set_tris_B(0b00000111); // faze a topeni jako vystupy
 
 
nula();
dolu(); // otoc trubku do vychozi pozice dolu
while(true)
{
nula();
dolu(); // otoc trubku do vychozi pozice dolu
 
CREN=0; CREN=1; // Reinitialise USART
 
while(!kbhit())
107,13 → 106,13
 
krok(18);
printf("A"); // mereni teploty 45° nad obzorem
delay_ms(200);
delay_ms(300);
krok(7);
printf("B"); // mereni teploty v zenitu
delay_ms(200);
delay_ms(300);
krok(7);
printf("C"); // mereni teploty 45° nad obzorem na druhou stranu
delay_ms(200);
delay_ms(300);
 
j++; // reverz
dolu();
124,11 → 123,11
if ('i'==uhel) {printf("I"); continue;} // Predani prikazu pro Info
if ('h'==uhel) {printf("H"); continue;} // Predani prikazu pro Topeni
if ('c'==uhel) {printf("C"); continue;} // Predani prikazu pro vypnuti topeni
if ('f'==uhel) {printf("F"); continue;} // Predani prikazu pro vypnuti topeni
if ('x'==uhel) // Zjisteni verze FW
{
printf("Mrakomer - Motor V%s (C) 2006 KAKL\n\r", VER);
printf("%s\n\r", REV);
printf("%s\r\n", REV);
}
 
if ((uhel>='0') && (uhel<='@')) // mereni v pozadovanem uhlu [0..;]=(0..11)
147,7 → 146,7
krok(2);
};
printf("S");
delay_ms(200);
delay_ms(300);
 
j++; // reverz
dolu();
/Designs/MRAKOMER2/SW/Ondrejov/motor/irmrak.h
1,6 → 1,6
#include <16F88.h>
#device adc=8
#fuses NOWDT,INTRC_IO, NOPUT, NOMCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, NOFCMEN, NOIESO, CCPB3
#fuses NOWDT,INTRC_IO, NOPUT, MCLR, NOBROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG, NOPROTECT, NOFCMEN, NOIESO
#use delay(clock=8000000)
#use rs232(baud=2400,parity=N,xmit=PIN_A6,rcv=PIN_A7,bits=8)
 
/Designs/MRAKOMER2/SW/Ondrejov/motor/irmrak.hex
1,84 → 1,88
:1000000001308A00392900004D39E135EF36653974
:1000000001308A003B2900004D39E135EF36653972
:10001000A016A0266F3A6F392010D6127310A821AF
:1000200029103218301BA025C1254C050D005E306B
:1000300084008313000803192A280230F800F7010E
:10004000F70B2028F80B1F289730F700F70B26280E
:10005000800B1D280800A030D8008316860183126B
:1000600058088600D9010230DC00FA30DE00172083
:10007000DC0B352808005D08DD03003A031954281D
:1000800059080139013C031D4828C030D8064A28C8
:100090003030D80683168601831258088600143043
:1000A000DE001720D90A3B280800831605138312A7
:1000B00005130830F8005C280000F8176D28F813C5
:1000C000E00C03180517031C051378176D28781327
:1000D000F80B60286B28000005170130F700840139
:1000E000840B7028F70B6F280E308400840B762861
:1000F0000000F81B5F28781B67280800DC018316C6
:1001000005168312051A95280130DD003B20DC0A14
:100110005C08283C031D94288316860183128601FF
:100120004530E0005520DC017F280230DD00FA3048
:10013000DE001720DD0B97288316860183128601C7
:1001400008000408F800831685178312851BA6286B
:100150000830F700DC01F717BD28F713BD2803109E
:10016000851B0314DC0C7717BD287713F70BAF281A
:10017000780884005C08F800D22801308400003040
:10018000F71B5530F800F80BC328840BBF280D303F
:10019000F71B0330F800F80BCB28F71BAD28771BB3
:1001A000B528AF288A11EA29831603178C170C1477
:1001B000000000000318032983120C087F39031381
:1001C000DD0003170D080313DE0003170F080313E8
:1001D000DF005D08E00055205E0803178D00031363
:1001E0005F0803178F0083168C170C1400000000A3
:1001F00083120313DC0BFD28002983160317032940
:1002000022298316031783120C0D0E0D7F39031359
:10021000DD0003170D080313DE0003170F08031397
:10022000DF005D08E00055205E0803178D00031312
:100230005F0803178F008D0A03198F0A0310031339
:10024000DC0BD4280800800803193829DD010408D4
:10025000DC005D10831B5D140008E00055205C0885
:10026000840083135D188317840A0319850A2329E0
:100270000800840183131F308305723083168F00BA
:100280000F0805138312051783161F129F121B08F0
:1002900080399B0007309C008312A001A1013330FC
:1002A000A2002E30A3003030A400A5012430A60007
:1002B0004930A7006430A8003A30A9002030AA00D5
:1002C0006930AB007230AC006D30AD007230AE0002
:1002D0006130AF006B30B0002E30B1006330B2003F
:1002E0002030B3003430B4003230B5003030B600C6
:1002F0002030B7003230B8003030B900BA003630A4
:10030000BB002D30BC003130BD003230BE002D307E
:10031000BF003230C0003930C1002030C20032305E
:10032000C3003130C4003A30C5003430C600333029
:10033000C7003A30C8003130C900CA005A30CB007B
:100340002030CC006B30CD006130CE006B30CF0060
:100350006C30D0002030D1002430D200D301723074
:1003600083168F000F081F129F121B0880399B00F5
:1003700083121F10940183160108C73908388100C1
:100380008312900183168615831297010730831616
:100390009C00050885000630F700F70BCD2900000A
:1003A0001C0883120D1383169D018601831286019A
:1003B00007308316860083122B207E201812181611
:1003C000851FE929831605168312051AE8297E2060
:1003D000E029A1287808DA005A086D3C031D132A89
:1003E0002B20D90A1230DD003B204130E00055209F
:1003F000C830DE0017200730DD003B204230E0002F
:100400005520C830DE0017200730DD003B20433088
:10041000E0005520C830DE001720D90A7E20473082
:10042000E0005520DC295A08693C031D1B2A49308D
:10043000E0005520DC295A08683C031D232A483077
:10044000E0005520DC295A08633C031D2B2A433069
:10045000E0005520DC295A08783C031D512A04305D
:1004600003178D0000308F00031013300313DC00DE
:10047000D42022308400831323210E3003178D00F3
:1004800000308F00031410300313DC00D42026301A
:100490008400831323210A30E00055200D30E00052
:1004A00055205A082F3C03185B2A5A08403C031C6D
:1004B0005B2A3030DA025A080B3C031CDC292B2063
:1004C000D90A0C30DD003B20DB015A085B0203181F
:1004D0006E2A0230DD003B20DB0A652A5330E00043
:1004E0005520C830DE001720D90A7E204730E000B2
:0604F0005520DC29630029
:04400E00182FFC3F2C
:10005000800B1D2808009030D8008316860183127B
:10006000580886000130D9000230DC00FA30DE008A
:100070001720DC0B362808005D08DD03003A031961
:10008000552859080139013C031D4928C030D806BC
:100090004B283030D8068316860183125808860014
:1000A0001430DE001720D90A3C28080083160513F7
:1000B000831205130830F8005D280000F8176E2839
:1000C000F813E00C03180517031C051378176E28A6
:1000D0007813F80B61286C28000005170130F70031
:1000E0008401840B7128F70B70280E308400840B78
:1000F00077280000F81B6028781B68280800DC01BE
:10010000831605168312051A97280130DD003C205E
:10011000DC0A5C08283C031D96288316860183129E
:1001200086014530E00056208A01002880280230F0
:10013000DD00FA30DE001720DD0B992883168601DA
:100140008312860108000408F800831685178312BD
:10015000851BA8280830F700DC01F717BF28F71324
:10016000BF280310851B0314DC0C7717BF287713F7
:10017000F70BB128780884005C08F800D428013017
:1001800084000030F71B5530F800F80BC528840BAD
:10019000C1280D30F71B0330F800F80BCD28F71BF2
:1001A000AF28771BB728B1288A11FA2983160317BD
:1001B0008C170C14000000000318052983120C088A
:1001C0007F390313DD0003170D080313DE00031747
:1001D0000F080313DF005D08E00056205E080317D8
:1001E0008D0003135F0803178F0083168C170C1400
:1001F0000000000083120313DC0BFF280229831682
:100200000317052924298316031783120C0D0E0DDD
:100210007F390313DD0003170D080313DE000317F6
:100220000F080313DF005D08E00056205E08031787
:100230008D0003135F0803178F008D0A03198F0ABF
:1002400003100313DC0BD6280800800803193A2991
:10025000DD010408DC005D10831B5D140008E00074
:1002600056205C08840083135D188317840A0319E1
:10027000850A25290800840183131F308305723005
:1002800083168F000F0805138312051783161F129C
:100290009F121B0880399B0007309C008312A0012D
:1002A000A1013330A2002E30A3003030A400A501FC
:1002B0002430A6004930A7006430A8003A30A900D5
:1002C0002030AA006930AB007230AC006D30AD0058
:1002D0007230AE006130AF006B30B0002E30B10034
:1002E0006330B2002030B3003430B4003230B50097
:1002F0003030B6002030B7003230B8003030B900AE
:10030000BA003630BB002D30BC003130BD00323079
:10031000BE002D30BF003230C0003930C100203067
:10032000C2003230C3003130C4003A30C50034302E
:10033000C6003330C7003A30C8003130C900CA00A7
:100340005A30CB002030CC006B30CD006130CE0075
:100350006B30CF006C30D0002030D1002430D20080
:10036000D30183161F129F121B0880399B00831232
:100370001F10941283160611861406120130831280
:1003800094000030831694000108C73908388100B2
:10039000831290010030F800920000308316920022
:1003A000061483129701073083169C000508850008
:1003B0000630F700F70BDA2900001C0883120D1332
:1003C00083169D0172308F000F088601831286010B
:1003D00007308316860083122B207F2018121816F0
:1003E000851FF929831605168312051AF8297F201F
:1003F000F029A3287808DA005A086D3C031D2F2A3B
:100400002B20D90A1230DD003C204130E00056207C
:100410000230DC009630DE001720DC0B0A2A0730A1
:10042000DD003C204230E00056200230DC009630F7
:10043000DE001720DC0B172A0730DD003C2043309C
:10044000E00056200230DC009630DE001720DC0B86
:10045000242AD90A7F204730E0005620EE295A0886
:10046000693C031D372A4930E0005620EE295A081E
:10047000683C031D3F2A4830E0005620EE295A0808
:10048000663C031D472A4630E0005620EE295A08F4
:10049000783C031D6D2A043003178D0000308F0057
:1004A000031013300313DC00D620223084008313A2
:1004B00025210E3003178D0000308F0003141030FB
:1004C0000313DC00D62026308400831325210D3051
:1004D000E00056200A30E00056205A082F3C03184E
:1004E000772A5A08403C031C772A3030DA025A082F
:1004F0000B3C031CEE292B20D90A0C30DD003C20DC
:10050000DB015A085B0203188A2A0230DD003C2016
:10051000DB0A812A5330E00056200230DC0096309E
:10052000DE001720DC0B8F2AD90A7F204730E0003D
:060530005620EE296300D5
:04400E00383FFC3FFC
:00000001FF
;PIC16F88
;CRC=345C CREATED="20-VIII-10 19:02"
;CRC=2D65 CREATED="22-VIII-10 09:57"