/Designs/Laboratory_instruments/High_voltage_power_supply/SW/PIC16F887/main.c
0,0 → 1,209
#include ".\main.h"
 
#define LED1 PIN_C6 //CHANGE PIN_XX TO YOUR LED PIN NUMBER
#define LED2 PIN_C5 //CHANGE PIN_XX TO YOUR LED PIN NUMBER
#define LED3 PIN_C4 //CHANGE PIN_XX TO YOUR LED PIN NUMBER
#define LED4 PIN_D3 //CHANGE PIN_XX TO YOUR LED PIN NUMBER
 
#define S1 PIN_B0 //Raw up
#define S2 PIN_B1 //Raw down
#define S3 PIN_D0 //Fine up
#define S4 PIN_D1 //Fine down
 
#define BEEP PIN_D2 //piezo beeper
 
#define LCD_ENABLE_PIN PIN_E0 ////
#define LCD_RS_PIN PIN_E1 ////
#define LCD_RW_PIN PIN_E2 ////
#define LCD_DATA4 PIN_D4 ////
#define LCD_DATA5 PIN_D5 ////
#define LCD_DATA6 PIN_D6 ////
#define LCD_DATA7 PIN_D7
#include <lcd.c>
 
#define OUTPUT_ENABLE PIN_B5
 
 
//#define MAXDUTY (int16)160 // 50 kHz
#define MAXDUTY (int16)400 // 20 kHz
//#define MAXDUTY (int16)800 // 10 kHz
#define HALFDUTY (int16)MAXDUTY/2
//#define DIVISOR 199 // 10 kHz
#define DIVISOR 99 // 20 kHz
//#define DIVISOR 39 // 50 kHz
 
#define MAX_OUTPUT 530
#define MIN_OUTPUT 220
#define raw_step 50
#define fine_step 5
 
 
 
/// Linear interpolation parameters
//
 
#define k 0.333961
#define q 206.952
 
 
unsigned int16 setpoint;
unsigned int16 adc_value;
int1 output_permit=FALSE;
 
#INT_AD
void adc_handler() {
 
adc_value = read_adc(ADC_READ_ONLY);
if(output_permit == TRUE)
{
if (adc_value <= setpoint)
{
set_pwm2_duty((int16)255); // zapnuti menice
output_low(LED2);
}
else // vypnuti menice
{
set_pwm2_duty((int16)MAXDUTY);
output_high(LED2);
}
 
}
else
{
set_pwm2_duty((int16)MAXDUTY);
output_high(LED2);
}
read_adc(ADC_START_ONLY);
}
 
void sound_beep( unsigned int lenght, int16 frequency)
{
unsigned int i;
for(i=0;i<=lenght;i++)
{
output_toggle(BEEP);
delay_us(1/frequency);
}
}
 
void main()
{
unsigned int1 button_press; // semafor pro cteni tlacitek
float output_voltage;
float voltage_setpoint = 300;
 
setup_adc_ports(sAN0|VSS_VREF);
setup_adc(ADC_CLOCK_DIV_32);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DIV_BY_1,DIVISOR,1);
setup_ccp1(CCP_PWM);
setup_ccp2(CCP_PWM);
set_pwm1_duty(HALFDUTY);
set_pwm2_duty(MAXDUTY);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
setup_oscillator(OSC_8MHZ);
 
enable_interrupts(INT_AD);
enable_interrupts(GLOBAL);
 
output_high(LED1);
output_high(LED2);
output_high(LED3);
output_high(LED4);
output_low(BEEP);
 
set_pwm2_duty((int16)MAXDUTY);
 
lcd_init();
set_adc_channel(0);
setpoint =(int16) ((voltage_setpoint - q) / k);
 
lcd_gotoxy(1,1);
lcd_putc("HVPS01A");
lcd_gotoxy(1,2);
lcd_putc(" MLAB.cz");
Delay_ms(1000);
lcd_putc("\f");
 
read_adc(ADC_START_ONLY);
while(true)
{
if(input(OUTPUT_ENABLE)) output_permit=TRUE;
else output_permit=FALSE;
 
output_voltage = adc_value * k + q;
 
lcd_gotoxy(1,1); // output voltage out of range
if (output_voltage > 215) printf(lcd_putc,"%3.0f",output_voltage);
else printf(lcd_putc,"---");
 
lcd_gotoxy(1,2);
voltage_setpoint = setpoint * k + q;
if(input(OUTPUT_ENABLE))printf(lcd_putc,"Set:%3.0f ", voltage_setpoint); // setpoint print
else printf(lcd_putc,"DISABLED");
 
if(button_press==false ) // tlacitka se ctou znovu pouze pokud v redchozim cyklu nebyla zmacknuta.
{
 
if(!input(S1))
{
delay_ms(20);
if(!input(S1))
{
button_press=true;
sound_beep(100,700);
if(voltage_setpoint < (MAX_OUTPUT - raw_step) ) voltage_setpoint += raw_step;
else voltage_setpoint = MAX_OUTPUT;
}
}
 
if(!input(S2))
{
delay_ms(20);
if(!input(S2))
{
button_press=true;
sound_beep(100,600);
if(voltage_setpoint > (raw_step + MIN_OUTPUT) ) voltage_setpoint -= raw_step;
else voltage_setpoint = MIN_OUTPUT;
}
}
 
if(!input(S3))
{
delay_ms(20);
if(!input(S3))
{
button_press=true;
sound_beep(100,500);
if(voltage_setpoint < MAX_OUTPUT - fine_step )voltage_setpoint += fine_step ;
else voltage_setpoint = MAX_OUTPUT;
}
}
 
if(!input(S4))
{
delay_ms(20);
if(!input(S4))
{
button_press=true;
sound_beep(100,400);
if(voltage_setpoint > (fine_step + MIN_OUTPUT) ) voltage_setpoint -= fine_step;
else voltage_setpoint = MIN_OUTPUT;
}
}
 
setpoint =(int16) ((voltage_setpoint - q) / k);
}
if ( input(S1) && input(S2) && input(S3) && input(S4) ) button_press=false;
output_toggle(LED1);
}
}
/Designs/Laboratory_instruments/High_voltage_power_supply/SW/PIC16F887/main.hex
0,0 → 1,342
:1000000008308A0000280000FF00030E8301A100D1
:100010000A08A0008A010408A2007708A300780853
:10002000A4007908A5007A08A600831383128C30F7
:100030008400001F1D280C1B2E2822088400230882
:10004000F7002408F8002508F9002608FA0020081F
:100050008A00210E8300FF0E7F0E09008A110A120A
:1000600039280A108A100A11820728340C34013406
:1000700006349F18392883161E088312A9001E080B
:10008000AA002B1C66282A082802031C5A28031DD4
:100090004D2829082702031C5A283F309B001D08C1
:1000A000CF3930389D00AC122C088316870083129C
:1000B0008712652864309B001D08CF399D00AC1263
:1000C0002C088316870083128716712864309B00E2
:1000D0001D08CF399D00AC122C08831687008312AF
:1000E00087169F140C138A110A121D28482BD02939
:1000F000B0184100A026CC204217633D00010C003F
:10010000D332741DA5192E1866100000C424D32004
:10011000422645220000443084008313000803195E
:100120009E280230F800F701F70B9428F80B93286B
:100130009730F700F70B9A28800B912808004B188E
:10014000A3280812A4280816831608128312CB18B5
:10015000AB288812AC2888168316881283124B1994
:10016000B3280813B4280817831608138312CB1971
:10017000BB288813BC2888178316881300008312B5
:10018000091483160910C428C52883120910831680
:10019000091083120800CC01831608160030831260
:1001A000081A0130CC048316881600308312881A8E
:1001B0000130F7000310F70D7708CC0483160817F9
:1001C00000308312081B0130F700F70DF70DFC30EB
:1001D000F7057708CC048316881700308312881B34
:1001E0000130F700F70DF70DF70DF830F705770838
:1001F000CC044C08F8000800831609108910091176
:100200008312891083168910081688160817881714
:10021000831209158316091100008312091483162D
:10022000091000008312CB207808CB000910831638
:100230000910000083120914831609101F29831264
:10024000CB207808CA0009108316091008128812FA
:100250000813881383124B0EF700F030F705770868
:100260004A04F8007808CA00CA1F382983160429EE
:10027000C808031D3D2989103E2989148316891059
:10028000000083120911831609110000831209105E
:10029000831609108312490ECA000F30CA054A0896
:1002A000CB009F2049080F39CA00CB009F200800CF
:1002B000831608128812081388130910891009116F
:1002C000831289108316891083120911831609116C
:1002D00083120910831609100F308312C4008B207B
:1002E0000130B6003608033C031C7E290330CB00E6
:1002F0009F200530C4008B20B60A72290230CB0043
:100300009F20B6013608033C031C8F293608312094
:10031000B700C8013708C900FC20B60A82298A152F
:100320000A12AD2880308318BF06C401C5013B08FE
:10033000C3003F08C3063A080319822AC200F70027
:100340003E0803198B2AC2020319272A031CE52938
:100350003F08C800C8174008C7004108C600C501CB
:100360000310C80CC70CC60CC50CC20BAF29C31FA9
:10037000BC2944149F2A4410421044163D30840086
:100380008313B42A4412C31BCF29421CDA29C80C98
:10039000C70CC60CC50CF70A03199A2ADA29C81B20
:1003A000DD290310C50DC60DC70DC80DF7030319D0
:1003B0009A2ACF294417472A44133B08C300C31F76
:1003C000E329C817932AC813932A3E08C200F700EE
:1003D0003A08C2023B08C800C8173C08C7003D08DD
:1003E000C600C5010310C80CC70CC60CC50CC20B57
:1003F000F129C31FFE29C4149F2AC4104210C41639
:10040000413084008313B42AC412C31B112A421C36
:100410001C2AC80CC70CC60CC50CF70A03199A2A6B
:100420001C2AC81B1F2A0310C50DC60DC70DC80DF9
:10043000F70303199A2A112AC417472AC4133F083D
:10044000C300C31F252AC817932AC813932A3F083D
:10045000C800C8174008C7004108C600C31F342A97
:10046000C81344159F2A4411C50142103D30840031
:100470008313B42AC31B5D2A3B08C300421C472ACE
:10048000C80CC70CC60CC50CF70A03199A2AC51F5D
:10049000582AC60A031D582AC70A031D582AC80A23
:1004A000031D582AC80CC70CC60CF70A03199A2A50
:1004B000441BDC29C41B1E2A7C2A8030C806C81FA6
:1004C000652A9F2A3F08C300722A3B08C300C80858
:1004D000031D722AC708031D722AC608031D722A4B
:1004E000F701932AC81B7C2A0310C50DC60DC70D42
:1004F000C80DF70B722A9A2AC31F802AC817932A9D
:10050000C813932A3E08F7003F08C8004008C700F8
:100510004108C600932A3A08F7003B08C8003C0887
:10052000C7003D08C6004808F8004708F90046081B
:10053000FA00D22AF701F801F901FA01D22AC5011D
:10054000C609C709C809C509C50A031DAD2AC60AD7
:10055000031DAD2AC70A0319C80A4418BB29C418C9
:10056000FD294419332A622A0008C607031CBE2A43
:10057000C70A031DBE2AC80A0319421484030008CF
:10058000C707031CC62AC80A0319421484030008BB
:10059000801F803AC80703184214441AC229C41A9B
:1005A000042A3A2A08003A080319982BC6003E0884
:1005B0000319982BC602031CE22A7F30C6070318D2
:1005C000982BE82A8130C602031C982B0319982B1C
:1005D0004608F700F801F901FA01C5013B08C4001B
:1005E000C4173C08C3003D08C2001930C6004108CA
:1005F000C20203180B2B0130C30203180B2BC402D9
:1006000003180B2BC50203180B2BC50AC40AC30A17
:100610004108C2073D2B4008C3020318262B0130B6
:10062000C4020318262BC5020318262BC50AC40AC8
:100630004008C3074108C207031C3D2BC30A031D22
:100640003D2BC40A031D3D2BC50A3D2B3F088038B6
:10065000C40203183C2B0130C50203183C2BC50A09
:100660003F088038C4074008C307031C1A2BC40A7C
:10067000031D1A2BC50A1A2B7A14C60B402B4B2BC1
:100680000310C20DC30DC40DC50D0310FA0DF90DF5
:10069000F80DC70DF72A471C532B0310F80CF90C63
:1006A000FA0CC70C562BF7030319982BC71B7F2B8B
:1006B0000310C20DC30DC40DC50D4108C2020318BD
:1006C0006B2B0130C30203186B2BC40203186B2B76
:1006D000C502031C8E2B4008C3020318762B013081
:1006E000C4020318762BC502031C8E2B3F088038EA
:1006F000C40203187F2B0130C502031C8E2BFA0A9B
:10070000031D8E2BF90A031D8E2BF80A031D8E2B59
:10071000F70A0319982BF80CF90CFA0C3B08C600E1
:100720003F08C606C61F962BF8179C2BF8139C2B68
:10073000F701F801F901FA0108008E30F7003608D8
:10074000F7023708F9003808F800F917F708031915
:10075000B42B0310F908031DB02BF8080319B42BB0
:10076000F90CF80CF70BA92BB71FBB2BF809F909EB
:10077000F80A0319F90A0800450BBF2BC22B4030B9
:10078000C600C32BC60101304402C60746088038A4
:10079000C700C8014708C900FC2008004308073A01
:1007A0000319DC2B0B3A0319E12B063A0319E92B49
:1007B000023A0319EF2BF42B0130C400C500BC230F
:1007C000FA2BC8010130C900FC200230C4008B2084
:1007D000FA2B0130C4000230C500BC23FA2BC8013B
:1007E0001030C900FC20FA2B0130C8004308C900B2
:1007F000FC20FA2B0800831603178C170C1400003A
:10080000000083120C087F3903193F2C0313B60034
:1008100003170D080313B70003170F080313B800DD
:100820003608C300CE23370803178D00031338089A
:1008300003178F0083168C170C140000000083121E
:100840000C0D0E0D7F3903193F2C0313B60003174F
:100850000D080313B70003170F080313B800360879
:10086000C300CE23370803178D000313380803177E
:100870008F008D0A03198F0A0313FB2B0317031331
:1008800008008E30F7003708F8003608F900FA0142
:10089000F808031D552C7908F800F9010830F70213
:1008A000F808031D552CF7015D2C0310F81B5C2C78
:1008B000F90DF80DF703552CF81308004308031938
:1008C000CE2CCB0047080319CE2CCB0703186F2C76
:1008D0007F30CB02031CCE2C0319CE2C732C81301D
:1008E000CB070318CE2C4B08F700F801F901FA01E9
:1008F0004408CF00CF174508CE004608CD00183079
:10090000CB00CC014D1C9C2C4A08FA07031C8E2CF2
:10091000F90A031D8E2CF80A0319CC174908F907A8
:10092000031C952CF80A0319CC174808C500C517F5
:100930004508F8070318CC17CC0DF80CF90CFA0C85
:10094000CF0CCE0CCD0C0310CB0B812C0130F70754
:100950000318CE2CF81BB32CCF0DFA0DF90DF80DA2
:10096000F7030319CE2CCF1FC42CFA0A031DC42C85
:10097000F90A031DC42CF80A031DC42CF80CF90C49
:10098000FA0CF70A0319CE2C4408CC004808CC0610
:10099000CC1FCC2CF817D22CF813D22CF701F8016D
:1009A000F901FA0108003708BE003B08BE06BE1F69
:1009B000DE2C03110310B71B0314112D3708BE00E2
:1009C0003A08BF003608BF020319EC2CBE1F112DD8
:1009D0000308013A8300112D3B08BF003708BF020E
:1009E0000319F82CBE1F112D0308013A8300112DA5
:1009F0003C08BF003808BF020319042DBE1F112D8B
:100A00000308013A8300112D3D08BF003908BF02D9
:100A10000319102DBE1F112D0308013A8300112D5B
:100A200003100800F701F801F901FA01CB01CC012C
:100A3000CD01CE014A084904480447040319502D4A
:100A40002030CF000310C30DC40DC50DC60DCB0D56
:100A5000CC0DCD0DCE0D4A084E02031D392D49088F
:100A60004D02031D392D48084C02031D392D47083E
:100A70004B02031C4A2D4708CB024808031C480FB1
:100A8000CC024908031C490FCD024A08031C4A0F37
:100A9000CE020314F70DF80DF90DFA0DCF0B222D30
:100AA0004B308400831308000408BB003A08BD00E3
:100AB0000319732D3908C6003808C5003708C4006B
:100AC0003608C300CA01C9012030C8008230C700FF
:100AD0005E247A08B9007908B8007808B70077086A
:100AE000B600BD0B5A2D3908C6003808C5003708B6
:100AF000C4003608C3004308B63CC300FA014408EA
:100B0000C700C4170310C40CC50CC60CFA0CF90CB2
:100B1000F80CF70CC30B822DC71F992DF709F809A4
:100B2000F909FA09F70A0319F80A0319F90A031966
:100B3000FA0A7A08B9007908B8007808B700770887
:100B4000B600B91FB02DBB03BB16B609B709B8096B
:100B5000B909B60A0319B70A0319B80A0319B90A79
:100B60003B30C2009A30C100CA30C000BF010A3019
:100B7000BD003A080319BB0A3908C6003808C50089
:100B80003708C4003608C3004208CA004108C9003B
:100B90004008C8003F08C70012250008B600840AB4
:100BA0000008B700840A0008B800840A0008B900E9
:100BB000FD308407F708031DF02D3A0A3D020319A2
:100BC000F02D3B080319F22D0F393D020319EA2DD0
:100BD0000318222EBB1B222E3B1BF22D20301E2E73
:100BE0002030BB05BB1E002EBB123A08031DBB0301
:100BF0007708BB002D30C300CE233B08F700BB01B4
:100C00003A083D02031D0E2E7708BB002E30C300AC
:100C1000CE233B08F7002030BB0500303030BB1E30
:100C20001E2EBB123A08031DBB037708BB002D30F4
:100C3000C300CE233B08F700BB013030F70777082D
:100C4000C300CE234208C6004108C5004008C400C6
:100C50003F08C300CA01C901C8010A30C7001225F4
:100C60007A08C2007908C1007808C0007708BF0080
:100C7000BD0BBC2D0800831603178C170C14000045
:100C8000000003186A2E83120C087F390313B70083
:100C900003170D080313B80003170F080313B90057
:100CA0003708C300CE23380803178D000313390813
:100CB00003178F0083168C170C140000000083129A
:100CC0000313B60B642E672E831603176A2E892E24
:100CD0008316031783120C0D0E0D7F390313B70013
:100CE00003170D080313B80003170F080313B90007
:100CF0003708C300CE23380803178D0003133908C3
:100D000003178F008D0A03198F0A03100313B60B04
:100D10003B2E8A150A12F5290830BD02031C9C2EB1
:100D20003D30840083130310800C000803199C2EAF
:100D30009A2E0000800B992E0800B901390836025E
:100D4000031CE52E83160811043083128806BB01AC
:100D50000130BA003808BD003708BC00F801F901BD
:100D6000F701FA013D08031DB82E3C080319D22EE5
:100D70001030BE000310BA0DBB0DF70DFA0D3D0883
:100D80007A02031DC52E3C087702031CCE2E3C08B8
:100D9000F702031CFA033D08FA020314F80DF90DDB
:100DA000BE0BBA2E7908BB007808BA003B08BC001D
:100DB000BC0ABC030319E02EFF30BD008C26D92EDF
:0C0DC0003A08BD008C26B90A9E2E0800DF
:10100000840183131F308305713083168F000F080E
:101010000613831206172B10831603170908C0390D
:10102000890003131F129F120030031788008312D8
:10103000870188018901FF300313AC00B501B401B9
:101040001630B3008730B200831603170908C03981
:10105000890003131F169F120130031788008312A3
:1010600003131F139F1783169F1783121F149412C5
:10107000AC122C088316870083122C162C088316BA
:1010800087008312AC112C0883168700013083126D
:1010900094000030831694000108C7392838810075
:1010A000831290010030F8000438920063308316F8
:1010B000920083122C112C088316870083120711CB
:1010C000831609130C308312970083169B019C0131
:1010D00001309D008312AC102C0883168700831208
:1010E00087100C309D0001308000323095001708C9
:1010F000CF39970064309B001D08CF399D0003173E
:101100008701880189017130831603138F000F084E
:101110000C17C03083128B042C132C088316870005
:1011200083120717AC122C088316870083128716C8
:101130002C122C0883168700831207168316881139
:1011400083128815831608118312081164309B00DE
:101150001D08CF399D008A1158298A150030F800E2
:101160001F08C33978049F0083143508BD00340874
:10117000BC003308BB003208BA00B630C100F330FF
:10118000C0004E30BF008630BE008A1192218A1501
:101190007708B6007808B7007908B8007A08B9006F
:1011A000BD003808BC003708BB003608BA00F03074
:1011B000C100FC30C0002A30BF007D30BE008A1163
:1011C000D3228A157A08B9007908B8007808B700E0
:1011D0007708B6008A119D238A157908A800780837
:1011E000A7000130C400C5008A11BC238A157630DF
:1011F00003178D0000308F008A110313FB238A151B
:101200000130C4000230C5008A11BC238A157A302F
:1012100003178D0000308F008A110313FB238A15FA
:101220000430B600FA30C4008A118B208A15B60B40
:1012300012297F3003178D0000308F008A110313AD
:10124000FB238A159F14831686168312861E2A296D
:101250002B142B292B102A08B7002908B6008A1155
:1012600041248A157A08C6007908C5007808C400A8
:101270007708C300F030CA00FC30C9002A30C8002B
:101280007D30C7008A115E248A157708B600780879
:10129000B7007908B8007A08B90083103908BD0092
:1012A0003808BC003708BB003608BA00B630C100A9
:1012B000F330C0004E30BF008630BE008A1192214C
:1012C0008A157A08B1007908B0007808AF0077086D
:1012D000AE000130C400C5008A11BC238A15B901D3
:1012E000B8015730B7008630B6003108BD0030086D
:1012F000BC002F08BB002E08BA008A11D3248A151F
:10130000031C9129023084003108B9003008B8006C
:101310002F08B7002E08B600BA018A1154258A1585
:10132000A0292D30C3008A11CE238A152D30C30089
:101330008A11CE238A152D30C3008A11CE238A1537
:101340000130C4000230C5008A11BC238A15280868
:10135000B7002708B6008A1141248A157A08C6000A
:101360007908C5007808C4007708C300F030CA00C7
:10137000FC30C9002A30C8007D30C7008A115E24C5
:101380008A157708B6007808B7007908B8007A0897
:10139000B90083103908BD003808BC003708BB000D
:1013A0003608BA00B630C100F330C0004E30BF007E
:1013B0008630BE008A1192218A157A08B500790814
:1013C000B4007808B3007708B2008316861683123B
:1013D000861E0A2A803003178D0000308F0003100C
:1013E00004300313B6008A113B2E8A1502308400A4
:1013F0003508B9003408B8003308B7003208B60021
:10140000BA018A1154258A152030C3008A11CE23CF
:101410008A15132A863003178D0000308F008A1139
:101420000313FB238A152D18892B831606148312A8
:101430000618632A1430C4008A118B208A1583167B
:10144000061483120618632A2D146430B600023085
:10145000B800BC30B7008A119D268A153508B9003E
:101460003408B8003308B7003208B600BD01BC012B
:101470007030BB008730BA008A11D3248A15031C50
:101480005C2A83103508BD003408BC003308BB005B
:101490003208BA00C101C0014830BF008430BE002C
:1014A0008A1192218A157A08B5007908B400780863
:1014B000B3007708B200632AB5018030B40004306D
:1014C000B3008830B2008316861483128618B02ABF
:1014D0001430C4008A118B208A1583168614831257
:1014E0008618B02A2D146430B6000230B800583087
:1014F000B7008A119D268A15B901B8010730B700D7
:101500008730B6003508BD003408BC003308BB0086
:101510003208BA008A11D3248A15031CAA2A83141C
:101520003508BD003408BC003308BB003208BA00DF
:10153000C101C0014830BF008430BE008A11922131
:101540008A157A08B5007908B4007808B3007708DE
:10155000B200B02AB501B4015C30B3008630B200ED
:101560008316081483120818FF2A1430C4008A1145
:101570008B208A158316081483120818FF2A2D144D
:101580006430B6000130B800F430B7008A119D26EF
:101590008A153508B9003408B8003308B700320896
:1015A000B600BD014030BC000330BB008830BA003B
:1015B0008A11D3248A15031CF82A83103508BD002C
:1015C0003408BC003308BB003208BA00C101C001B6
:1015D0002030BF008130BE008A1192218A157A081E
:1015E000B5007908B4007808B3007708B200FF2A84
:1015F000B5018030B4000430B3008830B2008316E7
:101600008814831288184C2B1430C4008A118B2044
:101610008A1583168814831288184C2B2D14643075
:10162000B6000130B8009030B7008A119D268A15A7
:10163000B901B8016130B7008630B6003508BD0089
:101640003408BC003308BB003208BA008A11D32426
:101650008A15031C462B83143508BD003408BC00D2
:101660003308BB003208BA00C101C0012030BF00FE
:101670008130BE008A1192218A157A08B500790856
:10168000B4007808B3007708B2004C2BB501B40160
:101690005C30B3008630B20083143508BD003408D6
:1016A000BC003308BB003208BA00B630C100F330CA
:1016B000C0004E30BF008630BE008A1192218A15CC
:1016C0007708B6007808B7007908B8007A08B9003A
:1016D000BD003808BC003708BB003608BA00F0303F
:1016E000C100FC30C0002A30BF007D30BE008A112E
:1016F000D3228A157A08B9007908B8007808B700AB
:101700007708B6008A119D238A157908A800780801
:10171000A700831606148312061C9D2B83168614BD
:101720008312861C9D2B831608148312081C9D2B84
:1017300083168814831288182D102C132C088316F6
:0C174000870040308312870623296300D5
:04400E00F52CFF3F4F
:00000001FF
;PIC16F887
;CRC=FB55 CREATED="28-IX-13 15:02"
/Designs/Laboratory_instruments/High_voltage_power_supply/SW/PIC16F887/main.pjt
0,0 → 1,29
[PROJECT]
Target=D:\MLAB\Designs\Measuring_instruments\GM_counter\SW\main.hex
Development_Mode=
Processor_Text=PIC16F887
ToolSuite=CCS
Processor=0x887F
[D:\MLAB\Designs\Measuring_instruments\GM_counter\SW\main]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
[mru-list]
1=D:\MLAB\Designs\Measuring_instruments\GM_counter\SW\main.c
[Windows]
0=0000 %S 0 0 796 451 3 0
[Opened Files]
1=main.c
2=C:\Program Files\PICC\drivers\lcd.c
3=main.h
4=C:\Program Files\PICC\devices\16F887.h
5=
[Target Data]
OptionString=-p +FM
FileList=Z:\home\kaklik\svnMLAB\Designs\Measuring_instruments\GM_counter\SW\HV_source\main.c
[Units]
Count=1
1=main (main)
/Designs/Laboratory_instruments/High_voltage_power_supply/SW/PIC16F887/main.h
0,0 → 1,20
#include <16F887.h>
#device adc=10
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC //Internal RC Osc
#FUSES NOPUT //No Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOCPD //No EE protection
#FUSES NOBROWNOUT //No brownout reset
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOWRT //Program memory not write protected
#FUSES BORV40 //Brownout reset at 4.0V
 
#use delay(clock=8000000)
#use rs232(baud=9600,parity=N,xmit=PIN_B6,rcv=PIN_B7,bits=5)