/Modules/Sensors/HUM01A/SW/PIC16F877/main.c
0,0 → 1,26
#include "main.h"
 
 
void main()
{
 
setup_adc_ports(AN0);
setup_adc(ADC_CLOCK_DIV_32);
setup_psp(PSP_DISABLED);
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);
 
set_adc_channel(0);
 
while(true)
{
float humidity;
// temperature = ds1820_read();
delay_ms(500);
humidity=0.14732142 * read_adc() - 22.85714150; //linear interpolation of sensor analog data
printf("RH: %f %%\r\n",humidity); //display relative humidity value
 
}
}
/Modules/Sensors/HUM01A/SW/PIC16F877/main.h
0,0 → 1,16
#include <16F877.h>
#device adc=10
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
#FUSES NOPUT //No Power Up Timer
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOBROWNOUT //No brownout reset
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NOCPD //No EE protection
#FUSES NOWRT //Program memory not write protected
#FUSES NODEBUG //No Debug mode for ICD
 
#use delay(clock=20000000)
#use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8)
 
/Modules/Sensors/HUM01A/SW/PIC16F877/main.hex
0,0 → 1,133
:020000040000FA
:1000000003308A004E2B00000A108A100A11820762
:10001000523448343A34203425346634203425347C
:1000200025340D340A34003426308400831300084C
:10003000031927280630F800F701F70B1D28F80BE5
:100040001C287B30F700F70B2328800B1A288A1115
:100050000A12992B8E30F7002608F8002508F900BF
:10006000FA01F808031D3E287908F800F901083064
:10007000F702F808031D3E28F70146280310F81B75
:100080004528F90DF80DF7033E28F8138A110A12D6
:10009000A72B32080319B928BA0036080319B92862
:1000A000BA0703185A287F30BA02031CB92803196B
:1000B000B9285E288130BA070318B9283A08F70032
:1000C000F801F901FA013308BE00BE173408BD007B
:1000D0003508BC001830BA00BB013C1C8728390821
:1000E000FA07031C7928F90A031D7928F80A03196D
:1000F000BB173808F907031C8028F80A0319BB1737
:100100003708B400B4173408F8070318BB17BB0D41
:10011000F80CF90CFA0CBE0CBD0CBC0C0310BA0B9D
:100120006C280130F7070318B928F81B9E28BE0D6C
:10013000FA0DF90DF80DF7030319B928BE1FAF2802
:10014000FA0A031DAF28F90A031DAF28F80A031D98
:10015000AF28F80CF90CFA0CF70A0319B928330880
:10016000BB003708BB06BB1FB728F817BD28F8131C
:10017000BD28F701F801F901FA0100348030831835
:10018000AE06B301B4012A08B2002E08B20629084F
:100190000319AE29B100F7002D080319B729B102E0
:1001A00003195329031C11292E08B700B7172F086C
:1001B000B6003008B500B4010310B70CB60CB50C8E
:1001C000B40CB10BDB28B21FE8283314CB29331051
:1001D000311033162C3084008313E0293312B21B04
:1001E000FB28311C0629B70CB60CB50CB40CF70A69
:1001F0000319C6290629B71B09290310B40DB50D2B
:10020000B60DB70DF7030319C629FB283317732959
:1002100033132A08B200B21F0F29B717BF29B7132B
:10022000BF292D08B100F7002908B1022A08B7003C
:10023000B7172B08B6002C08B500B4010310B70C93
:10024000B60CB50CB40CB10B1D29B21F2A29B3147E
:10025000CB29B3103110B316303084008313E0295A
:10026000B312B21B3D29311C4829B70CB60CB50C92
:10027000B40CF70A0319C6294829B71B4B290310E8
:10028000B40DB50DB60DB70DF7030319C6293D29F9
:10029000B3177329B3132E08B200B21F5129B71731
:1002A000BF29B713BF292E08B700B7172F08B6000C
:1002B0003008B500B21F6029B7133315CB293311AD
:1002C000B40131102C3084008313E029B21B89293A
:1002D0002A08B200311C7329B70CB60CB50CB40C4B
:1002E000F70A0319C629B41F8429B50A031D8429F6
:1002F000B60A031D8429B70A031D8429B70CB60C5E
:10030000B50CF70A0319C629331B0829B31B4A2960
:10031000A8298030B706B71F9129CB292E08B20033
:100320009E292A08B200B708031D9E29B608031D9E
:100330009E29B508031D9E29F701BF29B71BA829CF
:100340000310B40DB50DB60DB70DF70B9E29C629D8
:10035000B21FAC29B717BF29B713BF292D08F70063
:100360002E08B7002F08B6003008B500BF292908AD
:10037000F7002A08B7002B08B6002C08B50037088C
:10038000F8003608F9003508FA00FE29F701F801EF
:10039000F901FA01FE29B401B509B609B709B40992
:1003A000B40A031DD929B50A031DD929B60A0319B0
:1003B000B70A3318E728B318292933195F298E297A
:1003C0000008B507031CEA29B60A031DEA29B70A83
:1003D0000319311484030008B607031CF229B70A75
:1003E0000319311484030008801F803AB7070318EB
:1003F0003114331AEE28B31A302966298A110A12E9
:10040000D22B83168613831286130830F800082A2D
:100410000000F817192AF813B20C03188617031CEA
:1004200086137817192A7813F80B0C2A172A00005C
:100430008617A7308400840B1B2A1E2AF81B0B2A60
:10044000781B132A0034F701F801F901FA01BA0107
:10045000BB01BC01BD013908380437043604031957
:10046000612A2030BE000310B20DB30DB40DB50DDE
:10047000BA0DBB0DBC0DBD0D39083D02031D4A2A46
:1004800038083C02031D4A2A37083B02031D4A2A4A
:1004900036083A02031C5B2A3608BA023708031CE6
:1004A000370FBB023808031C380FBC023908031C85
:1004B000390FBD020314F70DF80DF90DFA0DBE0B3F
:1004C000332A3A308400831300340408AA00290830
:1004D000AC000319842A2808B5002708B4002608B0
:1004E000B3002508B200B901B8012030B70082304E
:1004F000B60049207A08A8007908A7007808A60065
:100500007708A500AC0B6B2A2808B5002708B400B3
:100510002608B3002508B2003208B63CB200FA0142
:100520003308B600B3170310B30CB40CB50CFA0CB7
:10053000F90CF80CF70CB20B932AB61FAA2AF7098C
:10054000F809F909FA09F70A0319F80A0319F90A67
:100550000319FA0A7A08A8007908A7007808A60003
:100560007708A500A81FC12AAA03AA16A509A609EB
:10057000A709A809A50A0319A60A0319A70A0319B6
:10058000A80A3B30B1009A30B000CA30AF00AE01CB
:100590000A30AC0029080319AA0A2808B500270860
:1005A000B4002608B3002508B2003108B9003008AD
:1005B000B8002F08B7002E08B60023220008A500B7
:1005C000840A0008A600840A0008A700840A00081C
:1005D000A800FD308407F708031D012B290A2C020F
:1005E0000319012B2A080319032B0F392C020319B5
:1005F000FB2A0318332BAA1B332B2A1B032B203077
:100600002F2B2030AA05AA1E112BAA122908031D80
:10061000AA037708AA002D30B20001222A08F700A9
:10062000AA0129082C02031D1F2B7708AA002E30CF
:10063000B20001222A08F7002030AA05003030302D
:10064000AA1E2F2BAA122908031DAA037708AA00A5
:100650002D30B20001222A08F700AA013030F70736
:100660007708B20001223108B5003008B4002F0825
:10067000B3002E08B200B901B801B7010A30B600C4
:1006800023227A08B1007908B0007808AF00770813
:10069000AE00AC0BCD2A8A110A12F22B840183130F
:1006A0001F308305831686138312861783161F1443
:1006B0009F141F159F11FF308312A00083161F1077
:1006C0009F141F159F1583121F139F1783169F17C3
:1006D00083121F148316091283129412A012200889
:1006E0008316870083122016200883168700831242
:1006F000A011200883168700013083129400003077
:10070000831694000108C7390838810083129001CC
:100710000030F8009200003083169200F800831237
:100720001F08C73978049F000230A500FA30A600E0
:100730001428A50B962B1F151F199C2B1E08FA00B9
:1007400083161E088312A5001E08A6002A286D30F5
:10075000B500DB30B4001630B3007C30B2007A084C
:10076000B9007908B8007808B7007708B6004920C2
:100770007708A5007808A6007908A7007A08A800DD
:1007800083147A08AC007908AB007808AA007708CF
:10079000A9006D30B000DB30AF003630AE008330E2
:1007A000AD00BE287A08A4007908A3007808A2004A
:1007B0007708A100A50125080420A50AF700B200CA
:1007C000012204302502031DDB2B8930840024081C
:1007D000A8002308A7002208A6002108A5000230CF
:1007E000A900652A2030B20001222530B200012282
:1007F0000D30B20001220A30B2000122942B6300B6
:02400E003A3F37
:00000001FF
;PIC16F877
;CRC=100B CREATED="05-II-11 01:27"
/Modules/Sensors/HUM01A/SW/PIC16F877/main.pjt
0,0 → 1,29
[PROJECT]
Target=D:\MLAB\Modules\Sensors\HUM01A\SW\main.hex
Development_Mode=
Processor_Text=PIC16F877
ToolSuite=CCS
Processor=0x877F
[D:\MLAB\Modules\Sensors\HUM01A\SW\main]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
[mru-list]
1=D:\MLAB\Modules\Sensors\HUM01A\SW\main.c
[Windows]
0=0000 %S 0 0 796 451 3 0
[Opened Files]
1=main.c
2=
3=C:\Program Files\PICC\devices\16F877.h
4=..\..\..\TDC\GP201A\SW\PICinterface\main.c
5=
[Target Data]
OptionString=-p +FM
FileList=D:\MLAB\Modules\Sensors\HUM01A\SW\PIC16F877\main.c
[Units]
Count=1
1=main.c (main)