/Designs/Measuring_instruments/GM_counter/SW/main.c
1,9 → 1,18
#include ".\main.h"
//#include <LCD.C>
 
#define LED1 PIN_C6 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5
#define LED2 PIN_C5 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5
#define LED3 PIN_C4 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5
#define LED4 PIN_D3 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5
 
#define LED PIN_C6 //CHANGE PIN_XX TO YOUR LED PIN NUMBER, EX: PIN_A5
 
#int_EXT
void EXT_isr(void)
{
output_toggle(LED3);
}
 
//#define LCD_TYPE 1
//#include <lcd.c>
void main()
10,7 → 19,7
{
unsigned int setpoint;
unsigned int napeti;
unsigned int plneni=0;
unsigned int16 plneni=0;
 
/* lcd_init();
 
41,9 → 50,18
set_pwm2_duty(0);
 
 
output_high(LED1);
output_high(LED2);
output_high(LED3);
output_high(LED4);
 
ext_int_edge( L_TO_H ); // Sets up EXT
enable_interrupts(INT_EXT);
enable_interrupts(GLOBAL);
 
// lcd_init();
setpoint = 60;
setpoint = 43;
while(true)
{
53,20 → 71,20
 
if (napeti <= setpoint)
{
if (plneni < 150) plneni++;
if (plneni < 300) plneni++;
output_low(LED2);
}
else
{
if (plneni > 0) plneni--;
output_high(LED2);
}
 
set_pwm1_duty(plneni);
set_pwm2_duty(plneni);
set_pwm2_duty(1023-plneni);
 
output_low(LED);
delay_ms(100);
output_high(LED);
delay_ms(100);
output_toggle(LED1);
delay_ms(10);
}
 
}
/Designs/Measuring_instruments/GM_counter/SW/main.hex
1,30 → 1,48
:1000000000308A0018280000243084008313000880
:10001000031917280230F800F701F70B0D28F80B29
:100020000C289730F700F70B1328800B0A280800DC
:10003000840183131F308305713083168F000F08EE
:10004000061383120617831603170908C03989009F
:1000500003131F129F1200300317880083128701B9
:1000600088018901FF300313A000A3018316031741
:100070000908C039890003131F129F1201300317AA
:100080008800831203131F139F1783169F17831271
:100090001F149412A01220088316870083122016C2
:1000A0002008831687008312A0112008831687007A
:1000B0000130831294000030831694000108C73980
:1000C00028388100831290010030F8000438920033
:1000D000FF308316920083122011200883168700B8
:1000E00083120711831609130C30831297008316AD
:1000F0009B019C0101309D008312A01020088316F3
:100100008700831287100C309D0001308000031798
:100110008701880189017130831603138F000F084E
:10012000831295019B013C30A1000430F8001F08A8
:10013000C33978049F004230F700F70B9D28000078
:100140009F149F18A12883161E088312A20022085C
:100150002102031CB0282308953C0318A30AB328E6
:10016000A308031DA3032308950023089B00201365
:10017000200883168700831207136430A40004202C
:100180002013200883168700831207176430A40009
:0601900004209528630025
:1000000000308A0050280000FF00030E8301A10089
:100010000A08A0008A010408A2007708A300780853
:10002000A4007908A5007A08A600831383120B1E8A
:100030001B288B182C28220884002308F70024088A
:10004000F8002508F9002608FA0020088A00210E89
:100050008300FF0E7F0E09008A110A122F28271233
:100060002708831687001030831287068B108A11A9
:100070000A121B282C3084008313000803194D2812
:100080000230F800F701F70B4328F80B42289730AD
:10009000F700F70B4928800B40288A110A125929CA
:1000A000840183131F308305713083168F000F087E
:1000B000061383120617831603170908C03989002F
:1000C00003131F129F120030031788008312870149
:1000D00088018901FF300313A700AB01AA01831631
:1000E00003170908C039890003131F129F1201303A
:1000F00003178800831203131F139F1783169F177C
:1001000083121F149412A7122708831687008312E4
:1001100027162708831687008312A711270883163E
:100120008700013083129400003083169400010888
:10013000C73928388100831290010030F800043854
:100140009200FF308316920083122711270883162E
:10015000870083120711831609130C30831297004E
:1001600083169B019C0101309D008312A710270874
:1001700083168700831287100C309D0001308000A9
:1001800003178701880189017130831603138F00DB
:100190000F08831295019B012713270883168700F8
:1001A00083120717A7122708831687008312871662
:1001B00027122708831687008312071683168811D3
:1001C000831288158316011783120B16C0308B0417
:1001D0002B30A8000430F8001F08C33978049F00B2
:1001E0004230F700F70BF22800009F149F18F62802
:1001F00083161E088312A90029082802031C14294B
:100200002B08013C031C0D29031D0A292A082B3C3D
:10021000031C0D29AA0A0319AB0AA7122708831683
:100220008700831287122429AA08031D1A29AB0804
:1002300003191E292A080319AB03AA03A7122708CA
:1002400083168700831287162B08F9002A08F80006
:10025000F90CF80CF90CF80CF90C78089500F90C6D
:10026000790C3039F7001708CF39770497002A083E
:10027000FF3CAC000330AD002B08031C2B0FAD027C
:10028000AD0CAC0CAD0CAC0CAD0C2C089B00AD0C4B
:100290002D0C3039F7001D08CF3977049D00271346
:1002A0002708831687004030831287060A30AC0087
:0602B0003A28EA28630071
:04400E00F52CFF3F4F
:00000001FF
;PIC16F887
;CRC=3E77 CREATED="29-IX-12 23:52"
;CRC=C04F CREATED="01-X-12 01:39"
/Designs/Measuring_instruments/GM_counter/SW/main.pjt
21,7 → 21,7
3=
[Target Data]
OptionString=-p +FM
FileList=D:\MLAB\Designs\Measuring_instruments\GM_counter\SW\main.c
FileList=d:\mlab\designs\measuring_instruments\gm_counter\sw\main.c
[Units]
Count=1
1=main (main)