/Designs/Measuring_instruments/AWS01A/SW/PIC16F887/main.c
64,20 → 64,17
{
unsigned int16 seq=0;
 
/* setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1);
setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1|T1_CLK_OUT);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC); // This device COMP currently not supported by the PICWizard
/* setup_comparator(NC_NC_NC_NC); // This device COMP currently not supported by the PICWizard
setup_oscillator(OSC_8MHZ);
setup_wdt(WDT_1152MS|WDT_DIV_16);
setup_spi(SPI_MASTER | SPI_MODE_0 | SPI_CLK_DIV_64);
output_high(CSN_SPI);
// enable_interrupts(INT_TIMER1);
// enable_interrupts(INT_TIMER0);
// enable_interrupts(GLOBAL);
 
*/
delay_ms(100);
87,6 → 84,10
sht_init();
MPL_init(); // get correction coefficients from the sensor
 
// enable_interrupts(INT_TIMER1); // interrupts used for anemometer readings
// enable_interrupts(INT_TIMER0);
// enable_interrupts(GLOBAL);
 
while (TRUE)
{
char output[8]; // Output buffer
/Designs/Measuring_instruments/AWS01A/SW/PIC16F887/main.hex
1,4 → 1,4
:0C0000000B308A009B2B00001028080029
:0C00000010308A000028000010280800C2
:10002000FF00030E8301A1000A08A0008A01040852
:10003000A2007708A3007808A4007908A5007A0830
:10004000A600831383128C308400001C29280C180E
82,12 → 82,12
:100520006430A2003A30A3002030A4006D30A50052
:100530006130A6006930A7006E30A8002E30A900F7
:100540006330AA002030AB003230AC003830AD0050
:100550003230AE003030AF002030B0003230B10069
:100550003230AE003130AF002030B0003230B10068
:100560003030B2003130B3003330B4002D30B5003C
:100570003030B6003330B7002D30B8003130B9001C
:100580003030BA002030BB003130BC003430BD0008
:100590003A30BE003330BF003730C0003A30C100BF
:1005A0003430C2003730C3005A30C4002030C50098
:100590003A30BE003430BF003730C0003A30C100BE
:1005A0003530C2003330C3005A30C4002030C5009B
:1005B0006B30C6006130C7006B30C8006C30C900BA
:1005C0006930CA006B30CB002030CC002430CD0025
:1005D000CE01D301A030D2008312E921013078028C
113,7 → 113,7
:10071000D300831203170F0883160313D400520863
:1007200083120C1E912B9900831653088312031712
:100730008D00831603135408831203178F008D0A4C
:1007400003198F0A4C2B640003138A150A12DA2B43
:1007400003198F0A4C2B640003138A110A166D28B3
:1007500083160814881083128810AE2BAF2B8316D3
:10076000881083128814B42BB52B831608108312BB
:100770000810BA2BBB2B8316881083128810033005
123,7 → 123,7
:1007B000F70BD82BE8016808083C031CF12B8316C3
:1007C0008810831288140330F700F70BE52B83168B
:1007D0008810831288100330F700F70BED2BE80A1E
:1007E000DB2BA8231430E800D5218A150A12DD2B53
:1007E000DB2BA8231430E800D5218A110A167028C3
:1007F0008030831CFE2B8316BF0683128316C40130
:10080000C5013B08C3003F08C3063A080319EC2C96
:10081000C200F7003E080319F52CC2020319912CFF
229,7 → 229,7
:100E500003179300790892007808910077089000B2
:100E60009701960195019730940003136320A71B07
:100E70008B177A08BF007908BE007808BD00770894
:100E8000BC008A150A12E02B0830F202031C542F12
:100E8000BC008A110A1673280830F202031C542F82
:100E90007230840083130310800C00080319542F50
:100EA000522F0000800B512F0800AF132F0883161C
:100EB0008700831287130230F100F830F2004427D4
270,7 → 270,7
:1010E00096019501833094008A11031363208A15B9
:1010F000A71B8B177A08F0007908EF007808EE003C
:101100007708ED006D08F7006E08F8006F08F90029
:101110007008FA008A150A12E82B80308316A200A4
:101110007008FA008A110A167D2880308316A20012
:101120000330F700F70B9228A1012108073C031CAC
:10113000B32888108312881083162008220503190B
:10114000A3280814A7280810831208108316A828BB
310,7 → 310,7
:10136000F901FA018312080080080319CB29E90169
:101370000408E8006910831B69140008F5008A114D
:10138000F1278A1568088400831369188317840A73
:101390000319850AB4298A150A12282EF0010408B7
:101390000319850AB4298A110A16E92AF0010408FA
:1013A000EF007010831B7014690EF038EB00EB0730
:1013B000E23EEC00323EEE0069080F39EC07EC0724
:1013C000EE07E93EED00ED07ED07680E0F39ED077A
323,7 → 323,7
:101430001B2A20301E2AEF156F123030F707E90102
:101440000408E8006910831B69147708F5008A1105
:10145000F1278A1568088400831369188317840AA2
:101460006F1F0B2A8A150A12552EF701F801F90190
:101460006F1F0B2A8A110A161A2BF701F801F901CE
:10147000FA018316A401A501A601A70123082204ED
:10148000210420040319742A2030A8000310FB0D46
:10149000FC0DFD0DFE0DA40DA50DA60DA70D230839
368,146 → 368,162
:10170000832B6908F7077708F5008A11F1278A15F6
:101710000F30E8050A3068020318902B3030922B06
:10172000E9136908E8076808F5008A11F1278A15A6
:101730008A150A12B72F840183131F308305713075
:1017400083168F000F08031787110C3003139900BD
:10175000A2309800903083129800C101C001C501E9
:10176000C401C301C201831603170908C0398900E7
:1017700003131F129F120030031788008312870182
:10178000880189010313A801A901AA013030AB0027
:101790002E30AC003130AD00AE01FF30AF00C601DD
:1017A000C701C901C8016430E8008A11D5218A1532
:1017B0008A118B2A8A158A11D12B8A158A113E2DFE
:1017C0008A15D3016430E8008A11D5218A150028D2
:1017D0007708E8007808E9007908EA007A08EB0061
:1017E000ED010408EC006D10831B6D1483107A0862
:1017F0008316BD00831279088316BC008312780813
:101800008316BB00831277088316BA003330C100F9
:101810009330C0000830BF008730BE008A118312A9
:10182000F8238A156C08840083136D1883177A08CF
:10183000DF007908DE007808DD007708DC00E901C8
:10184000E801DB01DA01D901D8018A11A8238A1540
:1018500003308316A00083128D207C1078187C142E
:101860007C183E2C8A11CA278A15D2207908FE00DE
:101870007808FD007D08F8007E08F9007908E90085
:101880007808E8008A11A8238A1505308316A0007D
:1018900083128D207C1078187C147C185B2C8A11A4
:1018A000CA278A15D2207908FE007808FD007D0835
:1018B000F8007E08F9007908EB007808EA0069086A
:1018C000FD006808FC006B088316A10083126A08FB
:1018D0008316A0008312A7018B1BA7178B137D080B
:1018E000031792007C0891008A11031344208A1583
:1018F000A71B8B1777088316AA007808AB00790816
:10190000AC007A08AD00C1002C08C0002B08BF0055
:101910002A08BE000A30C500D730C4002330C300F7
:101920007830C20083123D2177088316AA00780818
:10193000AB007908AC007A08AD0083142D08BD0017
:101940002C08BC002B08BB002A08BA00C101C0014A
:101950002030BF008430BE008A118312F8238A151C
:101960007A08D7007908D6007808D5007708D4001F
:10197000A7018B1BA7178B1383162108831203174C
:1019800092008316031320088312031791008A1113
:10199000031344208A15A71B8B177A088316A90006
:1019A0007908A8007808A7007708A6002908C100D0
:1019B0002808C0002708BF002608BE005430C50014
:1019C000E330C4002530C3007A30C20083123D21C9
:1019D00077088316AA007808AB007908AC007A086B
:1019E000AD002908C1002808C0002708BF0026084C
:1019F000BE002908C5002808C4002708C30026081F
:101A0000C20083123D2177088316AE007808AF002C
:101A10007908B0007A08B100C1003008C0002F0872
:101A2000BF002E08BE00A230C500E730C4003B3026
:101A3000C3006C30C20083123D21831483162D082D
:101A4000BD002C08BC002B08BB002A08BA007A088D
:101A5000C1007908C0007808BF007708BE008A116D
:101A60008312F8238A1577088316AA007808AB003A
:101A70007908AC007A08AD0083142D08BD002C084D
:101A8000BC002B08BB002A08BA00C101C001BF017D
:101A90008130BE008A118312F8238A157A08EF007C
:101AA0007908EE007808ED007708EC0083145708F9
:101AB0008316BD00831256088316BC008312550896
:101AC0008316BB00831254088316BA00C101C001FB
:101AD0004830BF008330BE008A118312F8238A1574
:101AE00077088316AA007808AB007908AC007A085A
:101AF000AD00AC30C100C530C0002730BF00713030
:101B0000BE002908C5002808C4002708C30026080D
:101B1000C20083123D2183100A308316BD00D730E6
:101B2000BC002330BB007830BA007A08C1007908C5
:101B3000C0007808BF007708BE008A118312F8231E
:101B40008A1583162D08C1002C08C0002B08BF0081
:101B50002A08BE007A08C5007908C4007808C300C6
:101B60007708C20083123D2177088316AA007808FF
:101B7000AB007908AC007A08AD0083102D08BD00D9
:101B80002C08BC002B08BB002A08BA0083126F087F
:101B90008316C10083126E088316C00083126D087D
:101BA0008316BF0083126C088316BE008A1183124D
:101BB000F8238A157A08DB007908DA007808D9005A
:101BC0007708D800831057088316BD008312560883
:101BD0008316BC00831255088316BB008312540879
:101BE0008316BA003330C1009330C0000830BF0004
:101BF0008730BE008A118312F8238A157A08D7002D
:101C00007908D6007808D5007708D4002130F7008D
:101C1000F70B082E24300C1E0B2E99002130F700F4
:101C2000F70B102EC7014A30C6004130F5008A116B
:101C3000F1278A155730F5008A11F1278A1553309C
:101C4000F5008A11F1278A152B3084008313B429FB
:101C50002030F5008A11F1278A15D2014A30520747
:101C600084008313800803194B2E2130F700F70BF3
:101C7000372E4A305207840083130008E8006808B2
:101C80000C1E402E99005208D20A4A3E840083134B
:101C90000008D3062E2EC7014A30C600103084003B
:101CA0004908E9004808E800CE292030F5008A11EB
:101CB000F1278A15D2014A30520784008313800825
:101CC0000319782E2130F700F70B642E4A305207A3
:101CD000840083130008E80068080C1E6D2E99002C
:101CE0005208D20A4A3E840083130008D3065B2EB2
:101CF000C7014A30C600893084005F08EB005E08E7
:101D0000EA005D08E9005C08E8000230EC00792296
:101D10002030F5008A11F1278A15D2014A30520786
:101D20008400831380080319AB2E2130F700F70BD2
:101D3000972E4A305207840083130008E800680891
:101D40000C1EA02E99005208D20A4A3E840083132A
:101D50000008D3068E2EC7014A30C60089308400A1
:101D60005708EB005608EA005508E9005408E80057
:101D70000230EC0079222030F5008A11F1278A1513
:101D8000D2014A3052078400831380080319DE2EE3
:101D90002130F700F70BCA2E4A3052078400831314
:101DA0000008E80068080C1ED32E99005208D20AD9
:101DB0004A3E840083130008D306C12EC7014A306F
:101DC000C600023084005B08EB005A08EA0059089C
:101DD000E9005808E8000130EC0079222030F500D5
:101DE0008A11F1278A15D2014A30520784008313E1
:101DF00080080319112F2130F700F70BFD2E4A3010
:101E00005207840083130008E80068080C1E062FA0
:101E100099005208D20A4A3E840083130008D30670
:101E2000F42EC7014A30C600893084006308EB00F5
:101E30006208EA006108E9006008E8000230EC008E
:101E400079222030F5008A11F1278A15D2014A3013
:101E500052078400831380080319442F2130F700B0
:101E6000F70B302F4A305207840083130008E80034
:101E700068080C1E392F99005208D20A4A3E840085
:101E800083130008D306272FC7014A30C600043049
:101E900084006708EB006608EA006508E90064084A
:101EA000E8000130EC0079222030F5008A11F1279A
:101EB0008A15D2014A30520784008313800803191F
:101EC000772F2130F700F70B632F4A305207840039
:101ED00083130008E80068080C1E6C2F9900520854
:101EE000D20A4A3E840083130008D3065A2FC70142
:101EF0004A30C600023084004508EB004408EA007E
:101F00004308E9004208E8000130EC007922203063
:101F1000F5008A11F1278A15D2014A305207840050
:101F2000831380080319AA2F2130F700F70B962F8F
:101F30004A305207840083130008E80068080C1E2A
:101F40009F2F99005208D20A4A3E8400831300084A
:101F5000D3068D2FC7014A30C6002A30F5008A11FA
:101F6000F1278A155308E8003730E900742B0D304B
:101F7000F5008A11F1278A150A30F5008A11F12738
:101F80008A15D2014A30520784008313800803194E
:101F9000D92F2130F700F70BCB2F5208D20A4A3E37
:101FA000840083130008E80068080C1ED52F9900F0
:101FB000C22F2130F700F70BDB2F6400C80A03198A
:061FC000C90AE12B6300D9
:061730008A110A16982C34
:10200000840183131F308305713083168F000F08FE
:10201000031787110C3003139900A23098009030F9
:1020200083129800C101C001C501C401C301C201EE
:10203000831603170908C039890003131F129F1262
:102040000030031788008312870188018901031378
:10205000A801A901AA013030AB002E30AC0031300C
:10206000AD00AE01FF30AF00C601C701C901C80114
:10207000831603170908C039890003131F129F1222
:10208000003003178800831203131F139F13831656
:102090009F1783121F1483160108C739283881003F
:1020A0000F30831290000030F80092000030831649
:1020B000920083122F152F08831687008312970131
:1020C00083169B019C0101309D0064308312E8005F
:1020D0000A12D5210A160A128B2A0A160A12D12BC5
:1020E0000A160A123E2D0A16D3016430E8000A12BD
:1020F000D5210A160A128A1500280A168A117708AD
:10210000E8007808E9007908EA007A08EB00ED01B8
:102110000408EC006D10831B6D1483106B0883168C
:10212000BD0083126A088316BC00831269088316F7
:10213000BB00831268088316BA003330C1009330A5
:10214000C0000830BF008730BE000A128312F82397
:102150000A166C08840083136D1883177A08DF0051
:102160007908DE007808DD007708DC00E901E80185
:10217000DB01DA01D901D8010A12A8230A160330BB
:102180008316A0000A128A1583128D200A168A115E
:102190007C1078187C147C18DD280A12CA270A16CD
:1021A0000A128A15D2200A168A117908FE007808C8
:1021B000FD007D08F8007E08F9007908E90078083C
:1021C000E8000A12A8230A1605308316A0000A1296
:1021D0008A1583128D200A168A117C1078187C14B7
:1021E0007C1802290A12CA270A160A128A15D22056
:1021F0000A168A117908FE007808FD007D08F800AB
:102200007E08F9007908EB007808EA006908FD000B
:102210006808FC006B088316A10083126A08831605
:10222000A0008312A7018B1BA7178B137D08031730
:1022300092007C0891000A12031344200A16A71B7F
:102240008B1777088316AA007808AB007908AC00D2
:102250007A08AD00C1002C08C0002B08BF002A0876
:10226000BE000A30C500D730C4002330C300783028
:10227000C2000A128A1583123D210A168A117708B4
:102280008316AA007808AB007908AC007A08AD0084
:1022900083142D08BD002C08BC002B08BB002A08A5
:1022A000BA00C101C0012030BF008430BE000A1254
:1022B0008312F8230A167A08D7007908D60078081E
:1022C000D5007708D400A7018B1BA7178B138316A3
:1022D0002108831203179200831603132008831228
:1022E000031791000A12031344200A16A71B8B1729
:1022F0007A088316A9007908A8007808A70077084B
:10230000A6002908C1002808C0002708BF00260829
:10231000BE005430C500E330C4002530C3007A301D
:10232000C2000A128A1583123D210A168A11770803
:102330008316AA007808AB007908AC007A08AD00D3
:102340002908C1002808C0002708BF002608BE00D1
:102350002908C5002808C4002708C3002608C200B1
:102360000A128A1583123D210A168A1177088316EC
:10237000AE007808AF007908B0007A08B100C1005B
:102380003008C0002F08BF002E08BE00A230C500D4
:10239000E730C4003B30C3006C30C2000A128A151B
:1023A00083123D210A168A11831483162D08BD005D
:1023B0002C08BC002B08BB002A08BA007A08C10010
:1023C0007908C0007808BF007708BE000A1283129F
:1023D000F8230A1677088316AA007808AB00790854
:1023E000AC007A08AD0083142D08BD002C08BC0099
:1023F0002B08BB002A08BA00C101C001BF0181300F
:10240000BE000A128312F8230A167A08EF00790830
:10241000EE007808ED007708EC0083145708831667
:10242000BD00831256088316BC008312550883161C
:10243000BB00831254088316BA00C101C0014830A2
:10244000BF008330BE000A128312F8230A167708F1
:102450008316AA007808AB007908AC007A08AD00B2
:10246000AC30C100C530C0002730BF007130BE00A5
:102470002908C5002808C4002708C3002608C20090
:102480000A128A1583123D210A168A1183100A3016
:102490008316BD00D730BC002330BB007830BA00B3
:1024A0007A08C1007908C0007808BF007708BE002C
:1024B0000A128312F8230A1683162D08C1002C086D
:1024C000C0002B08BF002A08BE007A08C5007908A2
:1024D000C4007808C3007708C2000A128A15831264
:1024E0003D210A168A1177088316AA007808AB00E6
:1024F0007908AC007A08AD0083102D08BD002C08C7
:10250000BC002B08BB002A08BA0083126F08831690
:10251000C10083126E088316C00083126D088316F3
:10252000BF0083126C088316BE000A128312F823C0
:102530000A167A08DB007908DA007808D9007708EB
:10254000D800831057088316BD00831256088316DF
:10255000BC00831255088316BB00831254088316EF
:10256000BA003330C1009330C0000830BF0087305C
:10257000BE000A128312F8230A167A08D7007908D7
:10258000D6007808D5007708D4002130F700F70B83
:10259000C72A24300C1ECA2A99002130F700F70BF5
:1025A000CF2AC7014A30C6004130F5000A12F12790
:1025B0000A165730F5000A12F1270A165330F500B3
:1025C0000A12F1270A162B30840083130A128A1587
:1025D000B4290A168A112030F5000A12F1270A16CA
:1025E000D2014A30520784008313800803190E2B4E
:1025F0002130F700F70BFA2A4A3052078400831380
:102600000008E80068080C1E032B99005208D20A43
:102610004A3E840083130008D306F12AC7014A30DA
:10262000C600103084004908E9004808E8000A1292
:102630008A15CE290A168A112030F5000A12F127D0
:102640000A16D2014A305207840083138008031906
:102650003F2B2130F700F70B2B2B4A305207840019
:1026600083130008E80068080C1E342B99005208F8
:10267000D20A4A3E840083130008D306222BC701E6
:102680004A30C600893084005F08EB005E08EA002B
:102690005D08E9005C08E8000230EC000A128A15C7
:1026A00079220A168A112030F5000A12F1270A163B
:1026B000D2014A3052078400831380080319762B15
:1026C0002130F700F70B622B4A3052078400831346
:1026D0000008E80068080C1E6B2B99005208D20A0B
:1026E0004A3E840083130008D306592BC7014A30A1
:1026F000C600893084005708EB005608EA005508E8
:10270000E9005408E8000230EC000A128A15792228
:102710000A168A112030F5000A12F1270A16D20192
:102720004A3052078400831380080319AD2B2130EF
:10273000F700F70B992B4A305207840083130008E7
:10274000E80068080C1EA22B99005208D20A4A3EE3
:10275000840083130008D306902BC7014A30C600BB
:10276000023084005B08EB005A08EA005908E900CF
:102770005808E8000130EC000A128A1579220A167E
:102780008A112030F5000A12F1270A16D2014A30C8
:1027900052078400831380080319E42B2130F700CB
:1027A000F70BD02B4A305207840083130008E8004F
:1027B00068080C1ED92B99005208D20A4A3E8400A0
:1027C00083130008D306C72BC7014A30C6008930DF
:1027D00084006308EB006208EA006108E900600811
:1027E000E8000230EC000A128A1579220A168A11D2
:1027F0002030F5000A12F1270A16D2014A3052079A
:1028000084008313800803191B2C2130F700F70B79
:10281000072C4A305207840083130008E800680838
:102820000C1E102C99005208D20A4A3E84008313D1
:102830000008D306FE2BC7014A30C60004308400CE
:102840006708EB006608EA006508E9006408E8002C
:102850000130EC000A128A1579220A168A112030FA
:10286000F5000A12F1270A16D2014A3052078400F5
:10287000831380080319522C2130F700F70B3E2CEC
:102880004A305207840083130008E80068080C1ED1
:10289000472C99005208D20A4A3E8400831300084C
:1028A000D306352CC7014A30C600023084004508E3
:1028B000EB004408EA004308E9004208E800013060
:1028C000EC000A128A1579220A168A112030F500C6
:1028D0000A12F1270A16D2014A30520784008313E4
:1028E00080080319892C2130F700F70B752C4A302A
:1028F0005207840083130008E80068080C1E7E2C31
:1029000099005208D20A4A3E840083130008D30675
:102910006C2CC7014A30C6002A30F5000A12F12794
:102920000A165308E8003730E9000A128A15742B9A
:102930000A168A110D30F5000A12F1270A160A301C
:10294000F5000A12F1270A16D2014A305207840014
:10295000831380080319BC2C2130F700F70BAE2C31
:102960005208D20A4A3E840083130008E80068082F
:102970000C1EB82C9900A52C2130F700F70BBE2CAB
:0C2980006400C80A0319C90A7428630027
:0639E0008A010028080026
:04400E00FD2CFF3F47
:00000001FF
;PIC16F887
;CRC=1BCF CREATED="10-III-13 15:48"
;CRC=CE66 CREATED="10-III-13 15:51"