No changes between revisions
/Modules/Sensors/MAG01A/SW/PIC16F887/main.c
1,9 → 1,10
#include "main.h"
#include "HMC5883L.h"
#include <math.h>
 
void main()
{
int1 last;
float last,b,anemo_speed;
unsigned int16 anemo_round=0;
unsigned int16 i;
 
46,21 → 47,22
while(TRUE)
{
 
for( i=0;i<=1000;i++)
{
// delay_ms();
hmc5883l_read_data();
// for(i=0;i<=10;i++)
// {
hmc5883l_read_data();
// b = atan2((float)compass.y,(float)compass.x); // vypocet azimutu z kartezskych souradnic
// b = (b/3.141596)*180; // prevod na stupne
// b += 180;
 
if(compass.x < 0)
{
if(last == 1) anemo_round++;
last=0;
}
if(compass.x > 0) last=1;
}
// anemo_speed += (b-last);
// last=b;
// delay_ms(10);
// }
// anemo_speed=anemo_speed/10;
 
printf("%6Ld %6Ld %6Ld %6Ld \n\r", compass.x, compass.y, compass.z, anemo_round);
anemo_round=0;
printf("%6Ld %6Ld %6Ld \n\r", compass.x, compass.y, compass.z);
// delay_ms(100);
}
 
}
/Modules/Sensors/MAG01A/SW/PIC16F887/main.cof
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Modules/Sensors/MAG01A/SW/PIC16F887/main.err
1,2 → 1,7
Memory usage: ROM=10% RAM=5% - 7%
0 Errors, 0 Warnings.
>>> Warning 202 "main.c" Line 7(7,11): Variable never used: last
>>> Warning 202 "main.c" Line 7(12,13): Variable never used: b
>>> Warning 202 "main.c" Line 7(14,25): Variable never used: anemo_speed
>>> Warning 202 "main.c" Line 8(16,27): Variable never used: anemo_round
>>> Warning 202 "main.c" Line 9(16,17): Variable never used: i
Memory usage: ROM=9% RAM=8% - 10%
0 Errors, 5 Warnings.
/Modules/Sensors/MAG01A/SW/PIC16F887/main.esym
1,7 → 1,8
D G "__PCM__" 0 71 ""4.106""
D G "__DEVICE__" 0 71 "887"
D G "__DATE__" 0 71 ""15-V-13""
D G "__TIME__" 0 71 ""18:53:30"" "Standard Header file for the PIC16F887 device ////////////////"
C L "MAIN" 0 20 1 "FUNCTION"
D G "__PCM__" 0 73 ""4.106""
D G "__DEVICE__" 0 73 "887"
D G "__DATE__" 0 73 ""15-V-13""
D G "__TIME__" 0 73 ""20:34:15"" "Standard Header file for the PIC16F887 device ////////////////"
d G "PIN_A0" 2 20 "40"
d G "PIN_A1" 2 21 "41"
d G "PIN_A2" 2 22 "42"
308,16 → 309,173
C L "hmc5883l_read_data" 4 1 1 "FUNCTION"
C L "hmc5883l_read_data" 4 1 1 "FUNCTION"
C L "hmc5883l_read_data" 4 1 1 "FUNCTION"
F G "MAIN" 0 4 "void()"
V L "last" 0 6 "int1"
V L "anemo_round" 0 7 "int16"
V L "i" 0 8 "int16" "signed int16 X,Y,Z;"
C L "MAIN" 0 19 3 "FUNCTION"
C L "MAIN" 0 19 1 "FUNCTION"
C L "MAIN" 0 19 1 "FUNCTION"
C L "MAIN" 0 19 2 "FUNCTION"
C L "MAIN" 0 19 6 "FUNCTION"
C L "MAIN" 0 19 1 "FUNCTION"
D G "MATH_H" 5 21 ""
D G "PI" 5 26 "3.1415926535897932"
D G "SQRT2" 5 29 "1.4142135623730950"
C L "CEIL_FLOOR" 5 2 3 "FUNCTION"
F G "CEIL_FLOOR" 5 36 "float(float x,int8 n)"
V L "x" 5 36 "float"
V L "n" 5 36 "int8"
V L "y" 5 38 "float"
V L "res" 5 38 "float"
V L "l" 5 39 "int16"
V L "s" 5 40 "int1"
C L "floor" 5 2 5 "FUNCTION"
F G "floor" 5 192 "float(float x)"
V L "x" 5 192 "float"
C L "ceil" 5 2 5 "FUNCTION"
F G "ceil" 5 218 "float(float x)"
V L "x" 5 218 "float"
D G "fabs" 5 244 "abs"
C L "fmod" 5 2 6 "FUNCTION"
F G "fmod" 5 256 "float(float x,float y)"
V L "x" 5 256 "float"
V L "y" 5 256 "float"
V L "i" 5 258 "float"
D G "LN2" 5 319 "0.6931471805599453"
V G "pe" 5 321 "float[6]"
F G "exp" 5 325 "float(float x)"
V L "x" 5 325 "float"
V L "y" 5 327 "float"
V L "res" 5 327 "float"
V L "r" 5 327 "float"
V L "n" 5 331 "sint8"
V L "s" 5 332 "int1"
C L "exp" 5 2 1 "FUNCTION"
V G "pl" 5 496 "float[4]"
V G "ql" 5 497 "float[4]"
C L "log" 5 2 3 "FUNCTION"
F G "log" 5 505 "float(float x)"
V L "x" 5 505 "float"
V L "y" 5 507 "float"
V L "res" 5 507 "float"
V L "r" 5 507 "float"
V L "y2" 5 507 "float"
V L "n" 5 511 "sint8"
C L "log" 5 2 1 "FUNCTION"
D G "LN10" 5 729 "2.3025850929940456"
C L "log10" 5 2 3 "FUNCTION"
F G "log10" 5 737 "float(float x)"
V L "x" 5 737 "float"
V L "r" 5 739 "float"
C L "modf" 5 2 8 "FUNCTION"
F G "modf" 5 778 "float(float value,*float iptr)"
V L "value" 5 778 "float"
V L "iptr" 5 778 "*float"
C L "pwr" 5 2 6 "FUNCTION"
F G "pwr" 5 806 "float(float x,float y)"
V L "x" 5 806 "float"
V L "y" 5 806 "float"
C L "pow" 5 2 7 "FUNCTION"
F G "pow" 5 869 "float(float x,float y)"
V L "x" 5 869 "float"
V L "y" 5 869 "float"
C L "sqrt" 5 2 5 "FUNCTION"
F G "sqrt" 5 930 "float(float x)"
V L "x" 5 930 "float"
V L "y" 5 932 "float"
V L "res" 5 932 "float"
V L "p" 5 936 "*int8"
D G "PI_DIV_BY_TWO" 5 1125 "1.5707963267948966"
C L "cos" 5 2 3 "FUNCTION"
F G "cos" 5 1136 "float(float x)"
V L "x" 5 1136 "float"
V L "y" 5 1138 "float"
V L "t" 5 1138 "float"
V L "t2" 5 1138 "float"
V L "quad" 5 1139 "int8"
V L "i" 5 1139 "int8"
V L "frac" 5 1140 "float"
V L "p" 5 1141 "float[6]" "by the series definition for cosine"
C L "cos" 5 2 1 "FUNCTION"
C L "cos" 5 2 2 "FUNCTION"
C L "cos" 5 2 1 "FUNCTION"
C L "cos" 5 2 1 "FUNCTION"
C L "cos" 5 2 1 "FUNCTION"
C L "cos" 5 2 1 "FUNCTION"
C L "cos" 5 2 1 "FUNCTION"
C L "cos" 5 2 1 "FUNCTION"
C L "sin" 5 2 5 "FUNCTION"
F G "sin" 5 1278 "float(float x)"
V L "x" 5 1278 "float"
C L "tan" 5 2 5 "FUNCTION"
F G "tan" 5 1304 "float(float x)"
V L "x" 5 1304 "float"
V L "c" 5 1306 "float"
V L "s" 5 1306 "float"
V G "pas" 5 1344 "float[3]"
V G "qas" 5 1345 "float[3]"
F G "ASIN_COS" 5 1347 "float(float x,int8 n)"
V L "x" 5 1347 "float"
V L "n" 5 1347 "int8"
V L "y" 5 1349 "float"
V L "res" 5 1349 "float"
V L "r" 5 1349 "float"
V L "y2" 5 1349 "float"
V L "s" 5 1350 "int1"
C L "ASIN_COS" 5 2 1 "FUNCTION"
C L "ASIN_COS" 5 2 1 "FUNCTION"
C L "asin" 5 2 5 "FUNCTION"
F G "asin" 5 1493 "float(float x)"
V L "x" 5 1493 "float"
V L "r" 5 1495 "float"
C L "acos" 5 2 5 "FUNCTION"
F G "acos" 5 1527 "float(float x)"
V L "x" 5 1527 "float"
V L "r" 5 1529 "float"
V G "pat" 5 1555 "float[4]"
V G "qat" 5 1556 "float[4]"
C L "atan" 5 2 3 "FUNCTION"
F G "atan" 5 1564 "float(float x)"
V L "x" 5 1564 "float"
V L "y" 5 1566 "float"
V L "res" 5 1566 "float"
V L "r" 5 1566 "float"
V L "s" 5 1567 "int1"
V L "flag" 5 1567 "int1"
C L "atan" 5 2 1 "FUNCTION"
C L "atan2" 5 2 7 "FUNCTION"
F G "atan2" 5 1697 "float(float y,float x)"
V L "y" 5 1697 "float"
V L "x" 5 1697 "float"
V L "z" 5 1699 "float"
V L "sign" 5 1700 "int1"
V L "quad" 5 1701 "int8"
C L "atan2" 5 2 1 "FUNCTION"
C L "atan2" 5 2 1 "FUNCTION"
C L "cosh" 5 2 7 "FUNCTION"
F G "cosh" 5 1919 "float(float x)"
V L "x" 5 1919 "float"
C L "sinh" 5 2 6 "FUNCTION"
F G "sinh" 5 1946 "float(float x)"
V L "x" 5 1946 "float"
C L "tanh" 5 2 6 "FUNCTION"
F G "tanh" 5 1976 "float(float x)"
V L "x" 5 1976 "float"
D G "LOG2" 5 2006 ".30102999566398119521"
F G "frexp" 5 2007 "float(float x,*sint8 exp)"
V L "x" 5 2007 "float"
V L "exp" 5 2007 "*sint8"
V L "res" 5 2009 "float"
V L "sign" 5 2010 "int1"
C L "ldexp" 5 2 6 "FUNCTION"
F G "ldexp" 5 2152 "float(float value,sint8 exp)"
V L "value" 5 2152 "float"
V L "exp" 5 2152 "sint8"
C L "MAIN" 5 2 2 "FUNCTION"
F G "MAIN" 0 5 "void()"
V L "last" 0 7 "float"
V L "b" 0 7 "float"
V L "anemo_speed" 0 7 "float"
V L "anemo_round" 0 8 "int16"
V L "i" 0 9 "int16" "signed int16 X,Y,Z;"
C L "MAIN" 0 20 3 "FUNCTION"
C L "MAIN" 0 20 1 "FUNCTION"
C L "MAIN" 0 20 1 "FUNCTION"
C L "MAIN" 0 20 2 "FUNCTION"
C L "MAIN" 0 20 6 "FUNCTION"
C L "MAIN" 0 20 1 "FUNCTION"
C L "MAIN" 0 20 7 "FUNCTION"
F B "reset_cpu" 0 0
F B "abs" 1 0
F B "sleep_ulpwu" 1 0
/Modules/Sensors/MAG01A/SW/PIC16F887/main.h
17,5 → 17,5
 
#use delay(clock=8000000)
#use i2c(master, sda=PIN_C4, scl=PIN_C3)
#use rs232(baud=9600,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD
#use rs232(baud=115200,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD
 
/Modules/Sensors/MAG01A/SW/PIC16F887/main.hex
1,9 → 1,9
:1000000002308A00502A0000CD306737653AEF365B
:1000000002308A004F2A0000CD306737653AEF365C
:10001000653A721D20100D050000A831A936EC309C
:100020006210CA2043244F103218B1193A10A006AA
:100030000A005816A02C2C105A100D05000108308B
:10004000F80000008711A011200883168700000027
:100050008312B20D0712031C3328201620088316C2
:100050008312BD0D0712031C3328201620088316B7
:10006000870037288312201220088316870000009B
:100070008312A0152008831687008312871D3E284F
:10008000F80B212800008711A01120088316870093
14,94 → 14,88
:1000D0000800201620088316870000008312A01550
:1000E00020088316870000008312071220122008C0
:1000F00083168700000083128711A0112008831641
:1001000087003C308312B2001F202C08B2001F2051
:100110002D08B2001F20201220088316870000003F
:1001000087003C308312BD001F203708BD001F2030
:100110003808BD001F202012200883168700000029
:100120008312A0152008831687008312871D962846
:1001300000009A280000201620088316870000007F
:1001400083120800A01320088316870083128713E8
:100150000830F800AB280000F817BC28F813B50CDD
:1001600003188717031C87137817BC287813F80B1C
:10017000AF28BA28000087173F308400840BBE28C0
:100180000000F81BAE28781BB6280800831603175A
:100190008C170C140000000083120C087F3903191F
:1001A0000A290313AC0003170D080313AD0003174E
:1001B0000F080313AE002C08B500A2202D0803176A
:1001C0008D0003132E0803178F0083168C170C1451
:1001D0000000000083120C0D0E0D7F3903190A294F
:1001E0000313AC0003170D080313AD0003170F082A
:1001F0000313AE002C08B500A2202D0803178D00B4
:1002000003132E0803178F008D0A03198F0A031397
:10021000C6280317031308000830B3007708B4009A
:10022000201620088316870000008312A0152008DE
:10023000831687008312871D1B29071A0314071EC4
:100240000310F80D0000A011200883168700831208
:100250008711B30B10292016200883168700000091
:1002600083120712340803193A2920122008831632
:10027000870083120000A0152008831687008312D0
:10028000871D402900008711A011200883168700D0
:1002900000008312071220122008831687008312A1
:1002A0000800201620088316870000008312A0157E
:1002B00020088316870000008312071220122008EE
:1002C00083168700000083128711A011200883166F
:1002D00087003C308312B2001F200330B2001F2081
:1002E000201620088316870000008312A01520081E
:1002F0008316870000008312871D7C2907122012B5
:10030000200883168700000083128711A01120089F
:10031000831687003D308312B2001F200130F700A2
:100320000C217808AD000130F7000C217808AC00F2
:100330000130F7000C217808B1000130F7000C21E2
:100340007808B0000130F7000C217808AF00F70101
:100350000C217808AE0020122008831687000000C8
:100360008312A0152008831687008312871DB629E3
:100370000000BA290000201620088316870000001C
:1003800083122D08A2002C08A1002F08A4002E081B
:10039000A3003108A6003008A5008A110A12EE2A2F
:1003A000B4010408B3003410831B3414AD1FE029DA
:1003B000B317331EB30AAC09AD09AC0A0319AD0A71
:1003C0002D0EF038AF00AF07E23EB000323EB20073
:1003D0002D080F39B007B007B207E93EB100B107E9
:1003E000B1072C0E0F39B107B207B10DB20DB2092A
:1003F000B20D2C080F39B207AF0D0730AE000A302E
:10040000B207B103031C002AB107B003031C042A7E
:10041000B007AF03031C082AAF07AE03031C0C2A66
:100420002E308400831307303305331384033305E0
:10043000031D212A331A840A331A212A2030F70097
:100440003E2A840732300402031933170008F700EC
:10045000031D322A331B322A331A4C2AB319322A8B
:1004600020303D2AB31F3A2A2D30F700840333137E
:10047000B3133E2AB31533123030F707AD01040829
:10048000AC002D10831B2D147708B500A2202C087A
:10049000840083132D188317840A331F222A08002F
:1004A000840183131F308305713083168F000F087A
:1004B0008312A013200883168700831287178316E0
:1004C00003170908C039890003131F129F12003057
:1004D000031788008312870188018901FF30031305
:1004E000A000A101A201A301A401A501A601A901E7
:1004F000A801831603170908C039890003131F12C6
:100500009F12003003178800831203131F139F13D9
:1005100083169F1383121F149412A01220088316AF
:100520008700831220162008831687008312A011EB
:100530002008831687000130831294000030831650
:1005400094000108C73908388100831290010030F7
:10055000F8009200003083169200831220152008C4
:10056000831687008312970183169B019C0101303B
:100570009D00831203178701880189010313AC01D1
:100580001830AD0069200130AC00E030AD006920CA
:100590000230AC00AD016920043003178D0000303B
:1005A0008F000313C6200D3003178D0000308F001D
:1005B0000313C620193003178D0000308F0003137A
:1005C000C620AB01AA012B08033C031C032B031D0F
:1005D000ED2A2A08E83C031C032B5129A21FF62A06
:1005E000271CF52AA80A0319A90A2710A21BFF2A0B
:1005F000A208031DFE2A2108003C031C2714AA0A96
:100600000319AB0AE32A003084002208AD00210858
:10061000AC00D0212030B500A22000308400240896
:10062000AD002308AC00D0212030B500A22000305E
:1006300084002608AD002508AC00D0212030B5008C
:10064000A220003084002908AD002808AC00D02189
:100650002030B500A2200A30B500A2200D30B50030
:0A066000A220A901A801E12A63000D
:100150000830F800AB280000F817C028F813400852
:10016000F900F90C03188717031C87137817C028A8
:100170007813F80BB1287908C000BE280000871753
:10018000F81BAE28781BB8280800831603178C17B5
:100190000C140000000083120C087F390319092990
:1001A0000313B70003170D080313B80003170F0854
:1001B0000313B9003708C000A220380803178D00C8
:1001C0000313390803178F0083168C170C140000D3
:1001D000000083120C0D0E0D7F390319092903133A
:1001E000B70003170D080313B80003170F08031314
:1001F000B9003708C000A220380803178D00031388
:10020000390803178F008D0A03198F0A0313C528B5
:100210000317031308000830BE007708BF0020163C
:1002200020088316870000008312A015200883167B
:1002300087008312871D1A29071A0314071E03104B
:10024000F80D0000A0112008831687008312871183
:10025000BE0B0F292016200883168700000083128A
:1002600007123F0803193929201220088316870036
:1002700083120000A0152008831687008312871DB3
:100280003F2900008711A011200883168700000075
:100290008312071220122008831687008312080099
:1002A000201620088316870000008312A01520085E
:1002B000831687000000831207122012200883167D
:1002C0008700000083128711A01120088316870081
:1002D0003C308312BD001F200330BD001F202016BC
:1002E00020088316870000008312A01520088316BB
:1002F000870000008312871D7B2907122012200827
:1003000083168700000083128711A011200883162E
:1003100087003D308312BD001F200130F7000B2104
:100320007808B8000130F7000B217808B7000130D9
:10033000F7000B217808BC000130F7000B2178088A
:10034000BB000130F7000B217808BA00F7010B2140
:100350007808B90020122008831687000000831255
:10036000A0152008831687008312871DB529000079
:10037000B929000020162008831687000000831288
:100380003808A2003708A1003A08A4003908A300E1
:100390003C08A6003B08A5008A110A12E12ABF0109
:1003A0000408BE003F10831B3F14B81FDF29BE178F
:1003B0003E1EBE0AB709B809B70A0319B80A380EB3
:1003C000F038BA00BA07E23EBB00323EBD00380842
:1003D0000F39BB07BB07BD07E93EBC00BC07BC0724
:1003E000370E0F39BC07BD07BC0DBD0DBD09BD0DD6
:1003F00037080F39BD07BA0D0730B9000A30BD07FD
:10040000BC03031CFF29BC07BB03031C032ABB0757
:10041000BA03031C072ABA07B903031C0B2A393095
:100420008400831307303E053E1384033E05031DFD
:10043000202A3E1A840A3E1A202A2030F7003D2A3C
:1004400084073D30040203193E170008F700031D1E
:10045000312A3E1B312A3E1A4B2ABE19312A20303E
:100460003C2ABE1F392A2D30F70084033E13BE13E9
:100470003D2ABE153E123030F707B8010408B70018
:100480003810831B38147708C000A2203708840076
:10049000831338188317840A3E1F212A0800840119
:1004A00083131F308305713083168F000F0883126A
:1004B000A01320088316870083128717831603175B
:1004C0000908C039890003131F129F120030031757
:1004D00088008312870188018901FF300313A0007F
:1004E000A101A201A301A401A501A601B401B301C8
:1004F000831603170908C039890003131F129F12BE
:10050000003003178800831203131F139F138316F1
:100510009F1383121F149412A012200883168700C1
:10052000831220162008831687008312A01120084A
:1005300083168700013083129400003083169400E4
:100540000108C73908388100831290010030F80093
:100550009200003083169200831220152008831623
:1005600087008312970183169B019C0101309D0037
:10057000831203178701880189010313B70118301B
:10058000B80069200130B700E030B80069200230BF
:10059000B700B8016920043003178D0000308F00C8
:1005A0000313C5200D3003178D0000308F00031397
:1005B000C520193003178D0000308F000313C520AC
:1005C0005029003084002208B8002108B700CF214C
:1005D0002030C000A220003084002408B800230886
:1005E000B700CF212030C000A220003084002608B0
:1005F000B8002508B700CF212030C000A2200A3063
:0E060000C000A2200D30C000A220E02A63003E
:04400E00F52CFF3F4F
:00000001FF
;PIC16F887
;CRC=E057 CREATED="15-V-13 18:53"
;CRC=32C6 CREATED="15-V-13 20:34"
/Modules/Sensors/MAG01A/SW/PIC16F887/main.lst
1,17 → 1,17
CCS PCM C Compiler, Version 4.106, 47914 15-V-13 18:53
CCS PCM C Compiler, Version 4.106, 47914 15-V-13 20:34
 
Filename: Z:\home\kaklik\svnMLAB\Modules\Sensors\MAG01A\SW\PIC16F887\main.lst
 
ROM used: 821 words (10%)
ROM used: 775 words (9%)
Largest free fragment is 2048
RAM used: 18 (5%) at main() level
27 (7%) worst case
RAM used: 28 (8%) at main() level
38 (10%) worst case
Stack: 2 locations
 
*
0000: MOVLW 02
0001: MOVWF 0A
0002: GOTO 250
0002: GOTO 24F
0003: NOP
.................... #include "main.h"
.................... #include <16F887.h>
48,7 → 48,7
0026: MOVWF 07
0027: NOP
0028: BCF 03.5
0029: RLF 32,F
0029: RLF 3D,F
002A: BCF 07.4
002B: BTFSS 03.0
002C: GOTO 033
113,76 → 113,76
0067: BCF 03.5
0068: RETURN
*
010C: MOVLW 08
010D: MOVWF 33
010E: MOVF 77,W
010F: MOVWF 34
0110: BSF 20.4
0111: MOVF 20,W
0112: BSF 03.5
0113: MOVWF 07
0114: NOP
0115: BCF 03.5
0116: BSF 20.3
0117: MOVF 20,W
0118: BSF 03.5
0119: MOVWF 07
011A: BCF 03.5
011B: BTFSS 07.3
011C: GOTO 11B
011D: BTFSC 07.4
011E: BSF 03.0
011F: BTFSS 07.4
0120: BCF 03.0
0121: RLF 78,F
0122: NOP
0123: BCF 20.3
0124: MOVF 20,W
0125: BSF 03.5
0126: MOVWF 07
0127: BCF 03.5
0128: BCF 07.3
0129: DECFSZ 33,F
012A: GOTO 110
012B: BSF 20.4
012C: MOVF 20,W
012D: BSF 03.5
012E: MOVWF 07
012F: NOP
0130: BCF 03.5
0131: BCF 07.4
0132: MOVF 34,W
0133: BTFSC 03.2
0134: GOTO 13A
0135: BCF 20.4
0136: MOVF 20,W
0137: BSF 03.5
0138: MOVWF 07
0139: BCF 03.5
013A: NOP
013B: BSF 20.3
013C: MOVF 20,W
013D: BSF 03.5
013E: MOVWF 07
013F: BCF 03.5
0140: BTFSS 07.3
0141: GOTO 140
0142: NOP
0143: BCF 07.3
0144: BCF 20.3
0145: MOVF 20,W
0146: BSF 03.5
0147: MOVWF 07
0148: NOP
0149: BCF 03.5
014A: BCF 07.4
014B: BCF 20.4
014C: MOVF 20,W
014D: BSF 03.5
014E: MOVWF 07
014F: BCF 03.5
0150: RETURN
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD
010B: MOVLW 08
010C: MOVWF 3E
010D: MOVF 77,W
010E: MOVWF 3F
010F: BSF 20.4
0110: MOVF 20,W
0111: BSF 03.5
0112: MOVWF 07
0113: NOP
0114: BCF 03.5
0115: BSF 20.3
0116: MOVF 20,W
0117: BSF 03.5
0118: MOVWF 07
0119: BCF 03.5
011A: BTFSS 07.3
011B: GOTO 11A
011C: BTFSC 07.4
011D: BSF 03.0
011E: BTFSS 07.4
011F: BCF 03.0
0120: RLF 78,F
0121: NOP
0122: BCF 20.3
0123: MOVF 20,W
0124: BSF 03.5
0125: MOVWF 07
0126: BCF 03.5
0127: BCF 07.3
0128: DECFSZ 3E,F
0129: GOTO 10F
012A: BSF 20.4
012B: MOVF 20,W
012C: BSF 03.5
012D: MOVWF 07
012E: NOP
012F: BCF 03.5
0130: BCF 07.4
0131: MOVF 3F,W
0132: BTFSC 03.2
0133: GOTO 139
0134: BCF 20.4
0135: MOVF 20,W
0136: BSF 03.5
0137: MOVWF 07
0138: BCF 03.5
0139: NOP
013A: BSF 20.3
013B: MOVF 20,W
013C: BSF 03.5
013D: MOVWF 07
013E: BCF 03.5
013F: BTFSS 07.3
0140: GOTO 13F
0141: NOP
0142: BCF 07.3
0143: BCF 20.3
0144: MOVF 20,W
0145: BSF 03.5
0146: MOVWF 07
0147: NOP
0148: BCF 03.5
0149: BCF 07.4
014A: BCF 20.4
014B: MOVF 20,W
014C: BSF 03.5
014D: MOVWF 07
014E: BCF 03.5
014F: RETURN
.................... #use rs232(baud=115200,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD
*
00A2: BCF 20.7
00A3: MOVF 20,W
195,31 → 195,30
00AA: GOTO 0AB
00AB: NOP
00AC: BSF 78.7
00AD: GOTO 0BC
00AD: GOTO 0C0
00AE: BCF 78.7
00AF: RRF 35,F
00B0: BTFSC 03.0
00B1: BSF 07.7
00B2: BTFSS 03.0
00B3: BCF 07.7
00B4: BSF 78.6
00B5: GOTO 0BC
00B6: BCF 78.6
00B7: DECFSZ 78,F
00B8: GOTO 0AF
00B9: GOTO 0BA
00BA: NOP
00BB: BSF 07.7
00BC: MOVLW 3F
00BD: MOVWF 04
00BE: DECFSZ 04,F
00BF: GOTO 0BE
00C0: NOP
00C1: BTFSC 78.7
00C2: GOTO 0AE
00C3: BTFSC 78.6
00C4: GOTO 0B6
00C5: RETURN
00AF: MOVF 40,W
00B0: MOVWF 79
00B1: RRF 79,F
00B2: BTFSC 03.0
00B3: BSF 07.7
00B4: BTFSS 03.0
00B5: BCF 07.7
00B6: BSF 78.6
00B7: GOTO 0C0
00B8: BCF 78.6
00B9: DECFSZ 78,F
00BA: GOTO 0B1
00BB: MOVF 79,W
00BC: MOVWF 40
00BD: GOTO 0BE
00BE: NOP
00BF: BSF 07.7
00C0: BTFSC 78.7
00C1: GOTO 0AE
00C2: BTFSC 78.6
00C3: GOTO 0B8
00C4: RETURN
....................
....................
.................... #include "HMC5883L.h"
284,15 → 283,15
.................... i2c_write(HMC5883L_WRT_ADDR);
0081: MOVLW 3C
0082: BCF 03.5
0083: MOVWF 32
0083: MOVWF 3D
0084: CALL 01F
.................... i2c_write(reg);
0085: MOVF 2C,W
0086: MOVWF 32
0085: MOVF 37,W
0086: MOVWF 3D
0087: CALL 01F
.................... i2c_write(data);
0088: MOVF 2D,W
0089: MOVWF 32
0088: MOVF 38,W
0089: MOVWF 3D
008A: CALL 01F
.................... i2c_stop();
008B: BCF 20.4
348,12 → 347,12
.................... // from the HMC5883L x,y,z registers.
.................... hmc5883l_result compass = {0,0,0};
*
0271: CLRF 21
0272: CLRF 22
0273: CLRF 23
0274: CLRF 24
0275: CLRF 25
0276: CLRF 26
0270: CLRF 21
0271: CLRF 22
0272: CLRF 23
0273: CLRF 24
0274: CLRF 25
0275: CLRF 26
....................
.................... //------------------------------
.................... void hmc5883l_read_data(void)
369,196 → 368,2369
....................
.................... i2c_start();
*
0151: BSF 20.4
0152: MOVF 20,W
0153: BSF 03.5
0154: MOVWF 07
0155: NOP
0156: BCF 03.5
0157: BSF 20.3
0158: MOVF 20,W
0159: BSF 03.5
015A: MOVWF 07
015B: NOP
015C: BCF 03.5
015D: BCF 07.4
015E: BCF 20.4
015F: MOVF 20,W
0160: BSF 03.5
0161: MOVWF 07
0162: NOP
0163: BCF 03.5
0164: BCF 07.3
0165: BCF 20.3
0166: MOVF 20,W
0167: BSF 03.5
0168: MOVWF 07
0150: BSF 20.4
0151: MOVF 20,W
0152: BSF 03.5
0153: MOVWF 07
0154: NOP
0155: BCF 03.5
0156: BSF 20.3
0157: MOVF 20,W
0158: BSF 03.5
0159: MOVWF 07
015A: NOP
015B: BCF 03.5
015C: BCF 07.4
015D: BCF 20.4
015E: MOVF 20,W
015F: BSF 03.5
0160: MOVWF 07
0161: NOP
0162: BCF 03.5
0163: BCF 07.3
0164: BCF 20.3
0165: MOVF 20,W
0166: BSF 03.5
0167: MOVWF 07
.................... i2c_write(HMC5883L_WRT_ADDR);
0169: MOVLW 3C
016A: BCF 03.5
016B: MOVWF 32
016C: CALL 01F
0168: MOVLW 3C
0169: BCF 03.5
016A: MOVWF 3D
016B: CALL 01F
.................... i2c_write(HMC5883L_X_MSB_REG); // Point to X-msb register
016D: MOVLW 03
016E: MOVWF 32
016F: CALL 01F
016C: MOVLW 03
016D: MOVWF 3D
016E: CALL 01F
.................... i2c_start();
0170: BSF 20.4
0171: MOVF 20,W
0172: BSF 03.5
0173: MOVWF 07
0174: NOP
0175: BCF 03.5
0176: BSF 20.3
0177: MOVF 20,W
0178: BSF 03.5
0179: MOVWF 07
017A: NOP
017B: BCF 03.5
017C: BTFSS 07.3
017D: GOTO 17C
017E: BCF 07.4
017F: BCF 20.4
0180: MOVF 20,W
0181: BSF 03.5
0182: MOVWF 07
0183: NOP
0184: BCF 03.5
0185: BCF 07.3
0186: BCF 20.3
0187: MOVF 20,W
0188: BSF 03.5
0189: MOVWF 07
016F: BSF 20.4
0170: MOVF 20,W
0171: BSF 03.5
0172: MOVWF 07
0173: NOP
0174: BCF 03.5
0175: BSF 20.3
0176: MOVF 20,W
0177: BSF 03.5
0178: MOVWF 07
0179: NOP
017A: BCF 03.5
017B: BTFSS 07.3
017C: GOTO 17B
017D: BCF 07.4
017E: BCF 20.4
017F: MOVF 20,W
0180: BSF 03.5
0181: MOVWF 07
0182: NOP
0183: BCF 03.5
0184: BCF 07.3
0185: BCF 20.3
0186: MOVF 20,W
0187: BSF 03.5
0188: MOVWF 07
.................... i2c_write(HMC5883L_READ_ADDR);
018A: MOVLW 3D
018B: BCF 03.5
018C: MOVWF 32
018D: CALL 01F
0189: MOVLW 3D
018A: BCF 03.5
018B: MOVWF 3D
018C: CALL 01F
....................
.................... x_msb = i2c_read();
018E: MOVLW 01
018F: MOVWF 77
0190: CALL 10C
0191: MOVF 78,W
0192: MOVWF 2D
018D: MOVLW 01
018E: MOVWF 77
018F: CALL 10B
0190: MOVF 78,W
0191: MOVWF 38
.................... x_lsb = i2c_read();
0193: MOVLW 01
0194: MOVWF 77
0195: CALL 10C
0196: MOVF 78,W
0197: MOVWF 2C
0192: MOVLW 01
0193: MOVWF 77
0194: CALL 10B
0195: MOVF 78,W
0196: MOVWF 37
....................
.................... z_msb = i2c_read();
0198: MOVLW 01
0199: MOVWF 77
019A: CALL 10C
019B: MOVF 78,W
019C: MOVWF 31
0197: MOVLW 01
0198: MOVWF 77
0199: CALL 10B
019A: MOVF 78,W
019B: MOVWF 3C
.................... z_lsb = i2c_read();
019D: MOVLW 01
019E: MOVWF 77
019F: CALL 10C
01A0: MOVF 78,W
01A1: MOVWF 30
019C: MOVLW 01
019D: MOVWF 77
019E: CALL 10B
019F: MOVF 78,W
01A0: MOVWF 3B
....................
.................... y_msb = i2c_read();
01A2: MOVLW 01
01A3: MOVWF 77
01A4: CALL 10C
01A5: MOVF 78,W
01A6: MOVWF 2F
01A1: MOVLW 01
01A2: MOVWF 77
01A3: CALL 10B
01A4: MOVF 78,W
01A5: MOVWF 3A
.................... y_lsb = i2c_read(0); // do a NACK on last read
01A7: CLRF 77
01A8: CALL 10C
01A9: MOVF 78,W
01AA: MOVWF 2E
01A6: CLRF 77
01A7: CALL 10B
01A8: MOVF 78,W
01A9: MOVWF 39
....................
.................... i2c_stop();
01AB: BCF 20.4
01AC: MOVF 20,W
01AD: BSF 03.5
01AE: MOVWF 07
01AF: NOP
01B0: BCF 03.5
01B1: BSF 20.3
01B2: MOVF 20,W
01B3: BSF 03.5
01B4: MOVWF 07
01B5: BCF 03.5
01B6: BTFSS 07.3
01B7: GOTO 1B6
01B8: NOP
01B9: GOTO 1BA
01BA: NOP
01BB: BSF 20.4
01BC: MOVF 20,W
01BD: BSF 03.5
01BE: MOVWF 07
01BF: NOP
01AA: BCF 20.4
01AB: MOVF 20,W
01AC: BSF 03.5
01AD: MOVWF 07
01AE: NOP
01AF: BCF 03.5
01B0: BSF 20.3
01B1: MOVF 20,W
01B2: BSF 03.5
01B3: MOVWF 07
01B4: BCF 03.5
01B5: BTFSS 07.3
01B6: GOTO 1B5
01B7: NOP
01B8: GOTO 1B9
01B9: NOP
01BA: BSF 20.4
01BB: MOVF 20,W
01BC: BSF 03.5
01BD: MOVWF 07
01BE: NOP
....................
.................... // Combine high and low bytes into 16-bit values.
.................... compass.x = make16(x_msb, x_lsb);
01C0: BCF 03.5
01C1: MOVF 2D,W
01C2: MOVWF 22
01C3: MOVF 2C,W
01C4: MOVWF 21
01BF: BCF 03.5
01C0: MOVF 38,W
01C1: MOVWF 22
01C2: MOVF 37,W
01C3: MOVWF 21
.................... compass.y = make16(y_msb, y_lsb);
01C5: MOVF 2F,W
01C6: MOVWF 24
01C7: MOVF 2E,W
01C8: MOVWF 23
01C4: MOVF 3A,W
01C5: MOVWF 24
01C6: MOVF 39,W
01C7: MOVWF 23
.................... compass.z = make16(z_msb, z_lsb);
01C9: MOVF 31,W
01CA: MOVWF 26
01CB: MOVF 30,W
01CC: MOVWF 25
01C8: MOVF 3C,W
01C9: MOVWF 26
01CA: MOVF 3B,W
01CB: MOVWF 25
.................... }
01CD: BCF 0A.3
01CE: BCF 0A.4
01CF: GOTO 2EE (RETURN)
01CC: BCF 0A.3
01CD: BCF 0A.4
01CE: GOTO 2E1 (RETURN)
....................
....................
....................
....................
.................... #include <math.h>
.................... ////////////////////////////////////////////////////////////////////////////
.................... //// (C) Copyright 1996,2008 Custom Computer Services ////
.................... //// This source code may only be used by licensed users of the CCS C ////
.................... //// compiler. This source code may only be distributed to other ////
.................... //// licensed users of the CCS C compiler. No other use, reproduction ////
.................... //// or distribution is permitted without written permission. ////
.................... //// Derivative programs created using this software in object code ////
.................... //// form are not restricted in any way. ////
.................... ////////////////////////////////////////////////////////////////////////////
.................... //// ////
.................... //// History: ////
.................... //// * 9/20/2001 : Improvments are made to sin/cos code. ////
.................... //// The code now is small, much faster, ////
.................... //// and more accurate. ////
.................... //// * 2/21/2007 : Compiler handles & operator differently and does
.................... //// not return generic (int8 *) so type cast is done ////
.................... //// ////
.................... ////////////////////////////////////////////////////////////////////////////
....................
.................... #ifndef MATH_H
.................... #define MATH_H
....................
.................... #ifdef PI
.................... #undef PI
.................... #endif
.................... #define PI 3.1415926535897932
....................
....................
.................... #define SQRT2 1.4142135623730950
....................
.................... //float const ps[4] = {5.9304945, 21.125224, 8.9403076, 0.29730279};
.................... //float const qs[4] = {1.0000000, 15.035723, 17.764134, 2.4934718};
....................
.................... ///////////////////////////// Round Functions //////////////////////////////
....................
.................... float32 CEIL_FLOOR(float32 x, unsigned int8 n)
.................... {
.................... float32 y, res;
.................... unsigned int16 l;
.................... int1 s;
....................
.................... s = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... y = -y;
.................... }
....................
.................... if (y <= 32768.0)
.................... res = (float32)(unsigned int16)y;
....................
.................... else if (y < 10000000.0)
.................... {
.................... l = (unsigned int16)(y/32768.0);
.................... y = 32768.0*(y/32768.0 - (float32)l);
.................... res = 32768.0*(float32)l;
.................... res += (float32)(unsigned int16)y;
.................... }
....................
.................... else
.................... res = y;
....................
.................... y = y - (float32)(unsigned int16)y;
....................
.................... if (s)
.................... res = -res;
....................
.................... if (y != 0)
.................... {
.................... if (s == 1 && n == 0)
.................... res -= 1.0;
....................
.................... if (s == 0 && n == 1)
.................... res += 1.0;
.................... }
.................... if (x == 0)
.................... res = 0;
....................
.................... return (res);
.................... }
....................
.................... // Overloaded Functions to take care for new Data types in PCD
.................... // Overloaded function CEIL_FLOOR() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 CEIL_FLOOR(float48 x, unsigned int8 n)
.................... {
.................... float48 y, res;
.................... unsigned int16 l;
.................... int1 s;
....................
.................... s = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... y = -y;
.................... }
....................
.................... if (y <= 32768.0)
.................... res = (float48)(unsigned int16)y;
....................
.................... else if (y < 10000000.0)
.................... {
.................... l = (unsigned int16)(y/32768.0);
.................... y = 32768.0*(y/32768.0 - (float48)l);
.................... res = 32768.0*(float32)l;
.................... res += (float48)(unsigned int16)y;
.................... }
....................
.................... else
.................... res = y;
....................
.................... y = y - (float48)(unsigned int16)y;
....................
.................... if (s)
.................... res = -res;
....................
.................... if (y != 0)
.................... {
.................... if (s == 1 && n == 0)
.................... res -= 1.0;
....................
.................... if (s == 0 && n == 1)
.................... res += 1.0;
.................... }
.................... if (x == 0)
.................... res = 0;
....................
.................... return (res);
.................... }
....................
....................
.................... // Overloaded function CEIL_FLOOR() for data type - Float64
.................... float64 CEIL_FLOOR(float64 x, unsigned int8 n)
.................... {
.................... float64 y, res;
.................... unsigned int16 l;
.................... int1 s;
....................
.................... s = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... y = -y;
.................... }
....................
.................... if (y <= 32768.0)
.................... res = (float64)(unsigned int16)y;
....................
.................... else if (y < 10000000.0)
.................... {
.................... l = (unsigned int16)(y/32768.0);
.................... y = 32768.0*(y/32768.0 - (float64)l);
.................... res = 32768.0*(float64)l;
.................... res += (float64)(unsigned int16)y;
.................... }
....................
.................... else
.................... res = y;
....................
.................... y = y - (float64)(unsigned int16)y;
....................
.................... if (s)
.................... res = -res;
....................
.................... if (y != 0)
.................... {
.................... if (s == 1 && n == 0)
.................... res -= 1.0;
....................
.................... if (s == 0 && n == 1)
.................... res += 1.0;
.................... }
.................... if (x == 0)
.................... res = 0;
....................
.................... return (res);
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float floor(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : rounds down the number x.
.................... // Date : N/A
.................... //
.................... float32 floor(float32 x)
.................... {
.................... return CEIL_FLOOR(x, 0);
.................... }
.................... // Following 2 functions are overloaded functions of floor() for PCD
.................... // Overloaded function floor() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 floor(float48 x)
.................... {
.................... return CEIL_FLOOR(x, 0);
.................... }
....................
.................... // Overloaded function floor() for data type - Float64
.................... float64 floor(float64 x)
.................... {
.................... return CEIL_FLOOR(x, 0);
.................... }
.................... #endif
....................
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float ceil(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : rounds up the number x.
.................... // Date : N/A
.................... //
.................... float32 ceil(float32 x)
.................... {
.................... return CEIL_FLOOR(x, 1);
.................... }
.................... // Following 2 functions are overloaded functions of ceil() for PCD
.................... // Overloaded function ceil() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 ceil(float48 x)
.................... {
.................... return CEIL_FLOOR(x, 1);
.................... }
....................
.................... // Overloaded function ceil() for data type - Float64
.................... float64 ceil(float64 x)
.................... {
.................... return CEIL_FLOOR(x, 1);
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float fabs(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : Computes the absolute value of floating point number x
.................... // Returns : returns the absolute value of x
.................... // Date : N/A
.................... //
.................... #define fabs abs
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float fmod(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : Computes the floating point remainder of x/y
.................... // Returns : returns the value of x= i*y, for some integer i such that, if y
.................... // is non zero, the result has the same isgn of x na dmagnitude less than the
.................... // magnitude of y. If y is zero then a domain error occurs.
.................... // Date : N/A
.................... //
....................
.................... float fmod(float32 x,float32 y)
.................... {
.................... float32 i;
.................... if (y!=0.0)
.................... {
.................... i=(x/y < 0.0)? ceil(x/y): floor(x/y);
.................... return(x-(i*y));
.................... }
.................... else
.................... {
.................... #ifdef _ERRNO
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
.................... }
.................... }
.................... //Overloaded function for fmod() for PCD
.................... // Overloaded function fmod() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 fmod(float48 x,float48 y)
.................... {
.................... float48 i;
.................... if (y!=0.0)
.................... {
.................... i=(x/y < 0.0)? ceil(x/y): floor(x/y);
.................... return(x-(i*y));
.................... }
.................... else
.................... {
.................... #ifdef _ERRNO
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
.................... }
.................... }
.................... // Overloaded function fmod() for data type - Float64
.................... float64 fmod(float64 x,float64 y)
.................... {
.................... float64 i;
.................... if (y!=0.0)
.................... {
.................... i=(x/y < 0.0)? ceil(x/y): floor(x/y);
.................... return(x-(i*y));
.................... }
.................... else
.................... {
.................... #ifdef _ERRNO
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
.................... }
.................... }
.................... #endif
.................... //////////////////// Exponential and logarithmic functions ////////////////////
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float exp(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the value (e^x)
.................... // Date : N/A
.................... //
.................... #define LN2 0.6931471805599453
....................
.................... float const pe[6] = {0.000207455774, 0.00127100575, 0.00965065093,
.................... 0.0554965651, 0.240227138, 0.693147172};
....................
....................
.................... float32 exp(float32 x)
.................... {
.................... float32 y, res, r;
.................... #if defined(__PCD__)
.................... int8 data1;
.................... #endif
.................... signed int8 n;
.................... int1 s;
.................... #ifdef _ERRNO
.................... if(x > 88.722838)
.................... {
.................... errno=ERANGE;
.................... return(0);
.................... }
.................... #endif
.................... n = (signed int16)(x/LN2);
.................... s = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... n = -n;
.................... y = -y;
.................... }
....................
.................... res = 0.0;
.................... #if !defined(__PCD__)
.................... *((unsigned int8 *)(&res)) = n + 0x7F;
.................... #endif
....................
.................... #if defined(__PCD__) // Takes care of IEEE format for PCD
.................... data1 = n+0x7F;
.................... if(bit_test(data1,0))
.................... bit_set(*(((unsigned int8 *)(&res)+2)),7);
.................... rotate_right(&data1,1);
.................... bit_clear(data1,7);
.................... *(((unsigned int8 *)(&res)+3)) = data1;
.................... #endif
....................
.................... y = y/LN2 - (float32)n;
....................
.................... r = pe[0]*y + pe[1];
.................... r = r*y + pe[2];
.................... r = r*y + pe[3];
.................... r = r*y + pe[4];
.................... r = r*y + pe[5];
....................
.................... res = res*(1.0 + y*r);
....................
.................... if (s)
.................... res = 1.0/res;
.................... return(res);
.................... }
....................
....................
.................... //Overloaded function for exp() for PCD
.................... // Overloaded function exp() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 exp(float48 x)
.................... {
.................... float48 y, res, r;
.................... int8 data1;
.................... signed int8 n;
.................... int1 s;
.................... #ifdef _ERRNO
.................... if(x > 88.722838)
.................... {
.................... errno=ERANGE;
.................... return(0);
.................... }
.................... #endif
.................... n = (signed int16)(x/LN2);
.................... s = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... n = -n;
.................... y = -y;
.................... }
....................
.................... res = 0.0;
....................
.................... data1 = n+0x7F;
.................... if(bit_test(data1,0))
.................... bit_set(*(((unsigned int8 *)(&res)+4)),7);
.................... rotate_right(&data1,1);
.................... bit_clear(data1,7);
.................... *(((unsigned int8 *)(&res)+5)) = data1;
....................
.................... y = y/LN2 - (float48)n;
....................
.................... r = pe[0]*y + pe[1];
.................... r = r*y + pe[2];
.................... r = r*y + pe[3];
.................... r = r*y + pe[4];
.................... r = r*y + pe[5];
....................
.................... res = res*(1.0 + y*r);
....................
.................... if (s)
.................... res = 1.0/res;
.................... return(res);
.................... }
....................
.................... // Overloaded function exp() for data type - Float64
.................... float64 exp(float64 x)
.................... {
.................... float64 y, res, r;
.................... unsigned int16 data1, data2;
.................... unsigned int16 *p;
.................... signed int16 n;
.................... int1 s;
.................... #ifdef _ERRNO
.................... if(x > 709.7827128)
.................... {
.................... errno=ERANGE;
.................... return(0);
.................... }
.................... #endif
.................... n = (signed int16)(x/LN2);
.................... s = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... n = -n;
.................... y = -y;
.................... }
....................
.................... res = 0.0;
....................
.................... #if !defined(__PCD__)
.................... *((unsigned int16 *)(&res)) = n + 0x7F;
.................... #endif
.................... p= (((unsigned int16 *)(&res))+3);
.................... data1 = *p;
.................... data2 = *p;
.................... data1 = n + 0x3FF;
.................... data1 = data1 <<4;
.................... if(bit_test(data2,15))
.................... bit_set(data1,15);
.................... data2 = data2 & 0x000F;
.................... data1 ^= data2;
....................
.................... *(((unsigned int16 *)(&res)+3)) = data1;
....................
....................
.................... y = y/LN2 - (float64)n;
....................
.................... r = pe[0]*y + pe[1];
.................... r = r*y + pe[2];
.................... r = r*y + pe[3];
.................... r = r*y + pe[4];
.................... r = r*y + pe[5];
....................
.................... res = res*(1.0 + y*r);
....................
.................... if (s)
.................... res = 1.0/res;
.................... return(res);
.................... }
....................
.................... #ENDIF
....................
....................
.................... /************************************************************/
....................
.................... float32 const pl[4] = {0.45145214, -9.0558803, 26.940971, -19.860189};
.................... float32 const ql[4] = {1.0000000, -8.1354259, 16.780517, -9.9300943};
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float log(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the the natural log of x
.................... // Date : N/A
.................... //
.................... float32 log(float32 x)
.................... {
.................... float32 y, res, r, y2;
.................... #if defined(__PCD__)
.................... unsigned int8 data1,data2;
.................... #endif
.................... signed int8 n;
.................... #ifdef _ERRNO
.................... if(x <0)
.................... {
.................... errno=EDOM;
.................... }
.................... if(x ==0)
.................... {
.................... errno=ERANGE;
.................... return(0);
.................... }
.................... #endif
.................... y = x;
....................
.................... if (y != 1.0)
.................... {
.................... #if !defined(__PCD__)
.................... *((unsigned int8 *)(&y)) = 0x7E;
.................... #endif
....................
.................... #if defined(__PCD__) // Takes care of IEEE format
.................... data2 = *(((unsigned int8 *)(&y))+3);
.................... *(((unsigned int8 *)(&y))+3) = 0x3F;
.................... data1 = *(((unsigned int8 *)(&y))+2);
.................... bit_clear(data1,7);
.................... *(((unsigned int8 *)(&y))+2) = data1;
.................... if(bit_test(data2,7))
.................... bit_set(*(((unsigned int8 *)(&y))+3),7);
.................... #endif
....................
.................... y = (y - 1.0)/(y + 1.0);
....................
.................... y2=y*y;
....................
.................... res = pl[0]*y2 + pl[1];
.................... res = res*y2 + pl[2];
.................... res = res*y2 + pl[3];
....................
.................... r = ql[0]*y2 + ql[1];
.................... r = r*y2 + ql[2];
.................... r = r*y2 + ql[3];
....................
.................... res = y*res/r;
.................... #if !defined(__PCD__)
.................... n = *((unsigned int8 *)(&x)) - 0x7E;
.................... #endif
.................... #if defined(__PCD__)
.................... data1 = *(((unsigned int8 *)(&x)+3));
.................... rotate_left(&data1,1);
.................... data2 = *(((unsigned int8 *)(&x)+2));
.................... if(bit_test (data2,7))
.................... bit_set(data1,0);
.................... n = data1 - 0x7E;
.................... #endif
....................
.................... if (n<0)
.................... r = -(float32)-n;
.................... else
.................... r = (float32)n;
....................
.................... res += r*LN2;
.................... }
....................
.................... else
.................... res = 0.0;
....................
.................... return(res);
.................... }
....................
.................... //Overloaded function for log() for PCD
.................... // Overloaded function log() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 log(float48 x)
.................... {
.................... float48 y, res, r, y2;
.................... unsigned int8 data1,data2;
.................... signed int8 n;
.................... #ifdef _ERRNO
.................... if(x <0)
.................... {
.................... errno=EDOM;
.................... }
.................... if(x ==0)
.................... {
.................... errno=ERANGE;
.................... return(0);
.................... }
.................... #endif
.................... y = x;
....................
.................... if (y != 1.0)
.................... {
....................
.................... #if !defined(__PCD__)
.................... *((unsigned int8 *)(&y)) = 0x7E;
.................... #endif
.................... data2 = *(((unsigned int8 *)(&y))+5);
.................... *(((unsigned int8 *)(&y))+5) = 0x3F;
.................... data1 = *(((unsigned int8 *)(&y))+4);
.................... bit_clear(data1,7);
.................... *(((unsigned int8 *)(&y))+4) = data1;
....................
.................... if(bit_test(data2,7))
.................... bit_set(*(((unsigned int8 *)(&y))+4),7);
.................... y = (y - 1.0)/(y + 1.0);
....................
.................... y2=y*y;
....................
.................... res = pl[0]*y2 + pl[1];
.................... res = res*y2 + pl[2];
.................... res = res*y2 + pl[3];
....................
.................... r = ql[0]*y2 + ql[1];
.................... r = r*y2 + ql[2];
.................... r = r*y2 + ql[3];
....................
.................... res = y*res/r;
....................
.................... data1 = *(((unsigned int8 *)(&x)+5));
.................... rotate_left(&data1,1);
.................... data2 = *(((unsigned int8 *)(&x)+4));
.................... if(bit_test (data2,7))
.................... bit_set(data1,0);
....................
.................... n = data1 - 0x7E;
....................
.................... if (n<0)
.................... r = -(float48)-n;
.................... else
.................... r = (float48)n;
....................
.................... res += r*LN2;
.................... }
....................
.................... else
.................... res = 0.0;
....................
.................... return(res);
.................... }
....................
.................... // Overloaded function log() for data type - Float48
.................... #if defined(__PCD__)
.................... float32 const pl_64[4] = {0.45145214, -9.0558803, 26.940971, -19.860189};
.................... float32 const ql_64[4] = {1.0000000, -8.1354259, 16.780517, -9.9300943};
.................... #endif
.................... float64 log(float64 x)
.................... {
.................... float64 y, res, r, y2;
.................... unsigned int16 data1,data2;
.................... unsigned int16 *p;
.................... signed int16 n;
.................... #ifdef _ERRNO
.................... if(x <0)
.................... {
.................... errno=EDOM;
.................... }
.................... if(x ==0)
.................... {
.................... errno=ERANGE;
.................... return(0);
.................... }
.................... #endif
.................... y = x;
....................
.................... if (y != 1.0)
.................... {
.................... #if !defined(__PCD__)
.................... *((unsigned int8 *)(&y)) = 0x7E;
.................... #endif
.................... p= (((unsigned int16 *)(&y))+3);
.................... data1 = *p;
.................... data2 = *p;
.................... data1 = 0x3FE;
.................... data1 = data1 <<4;
.................... if(bit_test (data2,15))
.................... bit_set(data1,15);
.................... data2 = data2 & 0x000F;
.................... data1 ^=data2;
....................
.................... *p = data1;
....................
.................... y = (y - 1.0)/(y + 1.0);
....................
.................... y2=y*y;
....................
.................... res = pl_64[0]*y2 + pl_64[1];
.................... res = res*y2 + pl_64[2];
.................... res = res*y2 + pl_64[3];
....................
.................... r = ql_64[0]*y2 + ql_64[1];
.................... r = r*y2 + ql_64[2];
.................... r = r*y2 + ql_64[3];
....................
.................... res = y*res/r;
....................
.................... p= (((unsigned int16 *)(&x))+3);
.................... data1 = *p;
.................... bit_clear(data1,15);
.................... data1 = data1 >>4;
.................... n = data1 - 0x3FE;
....................
....................
.................... if (n<0)
.................... r = -(float64)-n;
.................... else
.................... r = (float64)n;
....................
.................... res += r*LN2;
.................... }
....................
.................... else
.................... res = 0.0;
....................
.................... return(res);
.................... }
.................... #endif
....................
....................
.................... #define LN10 2.3025850929940456
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float log10(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the the log base 10 of x
.................... // Date : N/A
.................... //
.................... float32 log10(float32 x)
.................... {
.................... float32 r;
....................
.................... r = log(x);
.................... r = r/LN10;
.................... return(r);
.................... }
....................
.................... //Overloaded functions for log10() for PCD
.................... // Overloaded function log10() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 log10(float48 x)
.................... {
.................... float48 r;
....................
.................... r = log(x);
.................... r = r/LN10;
.................... return(r);
.................... }
....................
.................... // Overloaded function log10() for data type - Float64
.................... float64 log10(float64 x)
.................... {
.................... float64 r;
....................
.................... r = log(x);
.................... r = r/LN10;
.................... return(r);
.................... }
.................... #endif
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float modf(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description :breaks the argument value int integral and fractional parts,
.................... // ach of which have the same sign as the argument. It stores the integral part
.................... // as a float in the object pointed to by the iptr
.................... // Returns : returns the signed fractional part of value.
.................... // Date : N/A
.................... //
....................
.................... float32 modf(float32 value,float32 *iptr)
.................... {
.................... *iptr=(value < 0.0)? ceil(value): floor(value);
.................... return(value - *iptr);
.................... }
.................... //Overloaded functions for modf() for PCD
.................... // Overloaded function modf() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 modf(float48 value,float48 *iptr)
.................... {
.................... *iptr=(value < 0.0)? ceil(value): floor(value);
.................... return(value - *iptr);
.................... }
.................... // Overloaded function modf() for data type - Float64
.................... float64 modf(float64 value,float64 *iptr)
.................... {
.................... *iptr=(value < 0.0)? ceil(value): floor(value);
.................... return(value - *iptr);
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float pwr(float x,float y)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the value (x^y)
.................... // Date : N/A
.................... // Note : 0 is returned when the function will generate an imaginary number
.................... //
.................... float32 pwr(float32 x,float32 y)
.................... {
.................... if(0 > x && fmod(y, 1) == 0) {
.................... if(fmod(y, 2) == 0) {
.................... return (exp(log(-x) * y));
.................... } else {
.................... return (-exp(log(-x) * y));
.................... }
.................... } else if(0 > x && fmod(y, 1) != 0) {
.................... return 0;
.................... } else {
.................... if(x != 0 || 0 >= y) {
.................... return (exp(log(x) * y));
.................... }
.................... }
.................... }
.................... //Overloaded functions for pwr() for PCD
.................... // Overloaded function pwr() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 pwr(float48 x,float48 y)
.................... {
.................... if(0 > x && fmod(y, 1) == 0) {
.................... if(fmod(y, 2) == 0) {
.................... return (exp(log(-x) * y));
.................... } else {
.................... return (-exp(log(-x) * y));
.................... }
.................... } else if(0 > x && fmod(y, 1) != 0) {
.................... return 0;
.................... } else {
.................... if(x != 0 || 0 >= y) {
.................... return (exp(log(x) * y));
.................... }
.................... }
.................... }
.................... // Overloaded function pwr() for data type - Float64
.................... float64 pwr(float64 x,float64 y)
.................... {
.................... if(0 > x && fmod(y, 1) == 0) {
.................... if(fmod(y, 2) == 0) {
.................... return (exp(log(-x) * y));
.................... } else {
.................... return (-exp(log(-x) * y));
.................... }
.................... } else if(0 > x && fmod(y, 1) != 0) {
.................... return 0;
.................... } else {
.................... if(x != 0 || 0 >= y) {
.................... return (exp(log(x) * y));
.................... }
.................... }
.................... }
.................... #endif
....................
.................... //////////////////// Power functions ////////////////////
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float pow(float x,float y)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the value (x^y)
.................... // Date : N/A
.................... // Note : 0 is returned when the function will generate an imaginary number
.................... //
.................... float32 pow(float32 x,float32 y)
.................... {
.................... if(0 > x && fmod(y, 1) == 0) {
.................... if(fmod(y, 2) == 0) {
.................... return (exp(log(-x) * y));
.................... } else {
.................... return (-exp(log(-x) * y));
.................... }
.................... } else if(0 > x && fmod(y, 1) != 0) {
.................... return 0;
.................... } else {
.................... if(x != 0 || 0 >= y) {
.................... return (exp(log(x) * y));
.................... }
.................... }
.................... }
.................... //Overloaded functions for pow() for PCD
.................... // Overloaded function for pow() data type - Float48
.................... #if defined(__PCD__)
.................... float48 pow(float48 x,float48 y)
.................... {
.................... if(0 > x && fmod(y, 1) == 0) {
.................... if(fmod(y, 2) == 0) {
.................... return (exp(log(-x) * y));
.................... } else {
.................... return (-exp(log(-x) * y));
.................... }
.................... } else if(0 > x && fmod(y, 1) != 0) {
.................... return 0;
.................... } else {
.................... if(x != 0 || 0 >= y) {
.................... return (exp(log(x) * y));
.................... }
.................... }
.................... }
....................
.................... // Overloaded function pow() for data type - Float64
.................... float64 pow(float64 x,float64 y)
.................... {
.................... if(0 > x && fmod(y, 1) == 0) {
.................... if(fmod(y, 2) == 0) {
.................... return (exp(log(-x) * y));
.................... } else {
.................... return (-exp(log(-x) * y));
.................... }
.................... } else if(0 > x && fmod(y, 1) != 0) {
.................... return 0;
.................... } else {
.................... if(x != 0 || 0 >= y) {
.................... return (exp(log(x) * y));
.................... }
.................... }
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float sqrt(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the square root of x
.................... // Date : N/A
.................... //
.................... float32 sqrt(float32 x)
.................... {
.................... float32 y, res;
.................... #if defined(__PCD__)
.................... unsigned int16 data1,data2;
.................... #endif
.................... BYTE *p;
....................
.................... #ifdef _ERRNO
.................... if(x < 0)
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
....................
.................... if( x<=0.0)
.................... return(0.0);
....................
.................... y=x;
....................
.................... #if !defined(__PCD__)
.................... p=&y;
.................... (*p)=(BYTE)((((unsigned int16)(*p)) + 127) >> 1);
.................... #endif
....................
.................... #if defined(__PCD__)
.................... p = (((unsigned int8 *)(&y))+3);
.................... data1 = *(((unsigned int8 *)(&y))+3);
.................... data2 = *(((unsigned int8 *)(&y))+2);
.................... rotate_left(&data1,1);
.................... if(bit_test(data2,7))
.................... bit_set(data1,0);
.................... data1 = ((data1+127) >>1);
.................... bit_clear(data2,7);
.................... if(bit_test(data1,0))
.................... bit_set(data2,7);
.................... data1 = data1 >>1;
.................... *(((unsigned int8 *)(&y))+3) = data1;
.................... *(((unsigned int8 *)(&y))+2) = data2;
....................
.................... #endif
....................
.................... do {
.................... res=y;
.................... y+=(x/y);
....................
.................... #if !defined(__PCD__)
.................... (*p)--;
.................... #endif
....................
.................... #if defined(__PCD__)
.................... data1 = *(((unsigned int8 *)(&y))+3);
.................... data2 = *(((unsigned int8 *)(&y))+2);
.................... rotate_left(&data1,1);
.................... if(bit_test(data2,7))
.................... bit_set(data1,0);
.................... data1--;
.................... bit_clear(data2,7);
.................... if(bit_test(data1,0))
.................... bit_set(data2,7);
.................... data1 = data1 >>1;
.................... *(((unsigned int8 *)(&y))+3) = data1;
.................... *(((unsigned int8 *)(&y))+2) = data2;
....................
.................... #endif
.................... } while(res != y);
....................
.................... return(res);
.................... }
.................... //Overloaded functions for sqrt() for PCD
.................... // Overloaded function sqrt() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 sqrt(float48 x)
.................... {
.................... float48 y, res;
.................... unsigned int16 data1,data2;
.................... BYTE *p;
....................
.................... #ifdef _ERRNO
.................... if(x < 0)
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
....................
.................... if( x<=0.0)
.................... return(0.0);
....................
.................... y=x;
....................
.................... #if !defined(__PCD__)
.................... p=&y;
.................... (*p)=(BYTE)((((unsigned int16)(*p)) + 127) >> 1);
.................... #endif
....................
.................... #if defined(__PCD__)
.................... p = (((unsigned int8 *)(&y))+5);
.................... data1 = *(((unsigned int8 *)(&y))+5);
.................... data2 = *(((unsigned int8 *)(&y))+4);
.................... rotate_left(&data1,1);
.................... if(bit_test(data2,7))
.................... bit_set(data1,0);
.................... data1 = ((data1+127) >>1);
.................... bit_clear(data2,7);
.................... if(bit_test(data1,0))
.................... bit_set(data2,7);
.................... data1 = data1 >>1;
.................... *(((unsigned int8 *)(&y))+5) = data1;
.................... *(((unsigned int8 *)(&y))+4) = data2;
....................
.................... #endif
....................
.................... do {
.................... res=y;
.................... y+=(x/y);
....................
.................... #if !defined(__PCD__)
.................... (*p)--;
.................... #endif
....................
.................... data1 = *(((unsigned int8 *)(&y))+5);
.................... data2 = *(((unsigned int8 *)(&y))+4);
.................... rotate_left(&data1,1);
.................... if(bit_test(data2,7))
.................... bit_set(data1,0);
.................... data1--;
.................... bit_clear(data2,7);
.................... if(bit_test(data1,0))
.................... bit_set(data2,7);
.................... data1 = data1 >>1;
.................... *(((unsigned int8 *)(&y))+5) = data1;
.................... *(((unsigned int8 *)(&y))+4) = data2;
....................
.................... } while(res != y);
....................
.................... return(res);
.................... }
....................
.................... // Overloaded function sqrt() for data type - Float64
.................... float64 sqrt(float64 x)
.................... {
.................... float64 y, res;
.................... unsigned int16 *p;
.................... unsigned int16 temp1,temp2;
....................
.................... #ifdef _ERRNO
.................... if(x < 0)
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
....................
.................... if( x<=0.0)
.................... return(0.0);
....................
.................... y=x;
.................... p= (((unsigned int16 *)(&y))+3);
.................... temp1 = *p;
.................... temp2 = *p;
.................... bit_clear(temp1,15);
.................... temp1 = (temp1>>4)+1023;
.................... temp1 = temp1 >> 1;
.................... temp1 = (temp1<<4) & 0xFFF0;
.................... if(bit_test(temp2,15))
.................... bit_set(temp1,15);
.................... temp2 = temp2 & 0x000F;
.................... temp1 ^= temp2;
....................
.................... (*p) = temp1;
....................
.................... do {
.................... res=y;
.................... y+=(x/y);
.................... temp1 = *p;
.................... temp2 = *p;
.................... bit_clear(temp1,15);
.................... temp1 = (temp1>>4);
.................... temp1--;
.................... temp1 = (temp1<<4) & 0xFFF0;
.................... if(bit_test(temp2,15))
.................... bit_set(temp1,15);
.................... temp2 = temp2 & 0x000F;
.................... temp1 ^= temp2;
.................... (*p) = temp1;
....................
.................... } while(res != y);
....................
.................... return(res);
.................... }
.................... #endif
....................
.................... ////////////////////////////// Trig Functions //////////////////////////////
.................... #ifdef PI_DIV_BY_TWO
.................... #undef PI_DIV_BY_TWO
.................... #endif
.................... #define PI_DIV_BY_TWO 1.5707963267948966
.................... #ifdef TWOBYPI
.................... #undef TWOBYPI
.................... #define TWOBYPI 0.6366197723675813
.................... #endif
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float cos(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the cosine value of the angle x, which is in radian
.................... // Date : 9/20/2001
.................... //
.................... float32 cos(float32 x)
.................... {
.................... float32 y, t, t2 = 1.0;
.................... unsigned int8 quad, i;
.................... float32 frac;
.................... float32 p[6] = { //by the series definition for cosine
.................... -0.5, // sum ( ( (-1)^n * x^2n )/(2n)! )
.................... 0.04166666666667,
.................... -0.00138888888889,
.................... 0.00002480158730,
.................... -0.00000027557319,
.................... 0.00000000208767,
.................... //-0.00000000001147,
.................... // 0.00000000000005
.................... };
....................
.................... if (x < 0) x = -x; // absolute value of input
....................
.................... quad = (unsigned int8)(x / PI_DIV_BY_TWO); // quadrant
.................... frac = (x / PI_DIV_BY_TWO) - quad; // fractional part of input
.................... quad = quad % 4; // quadrant (0 to 3)
....................
.................... if (quad == 0 || quad == 2)
.................... t = frac * PI_DIV_BY_TWO;
.................... else if (quad == 1)
.................... t = (1-frac) * PI_DIV_BY_TWO;
.................... else // should be 3
.................... t = (frac-1) * PI_DIV_BY_TWO;
....................
.................... y = 1.0;
.................... t = t * t;
.................... for (i = 0; i <= 5; i++)
.................... {
.................... t2 = t2 * t;
.................... y = y + p[i] * t2;
.................... }
....................
.................... if (quad == 2 || quad == 1)
.................... y = -y; // correct sign
....................
.................... return (y);
.................... }
....................
....................
.................... //Overloaded functions for cos() for PCD
.................... // Overloaded function cos() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 cos(float48 x)
.................... {
.................... float48 y, t, t2 = 1.0;
.................... unsigned int8 quad, i;
.................... float48 frac;
.................... float48 p[6] = { //by the series definition for cosine
.................... -0.5, // sum ( ( (-1)^n * x^2n )/(2n)! )
.................... 0.04166666666667,
.................... -0.00138888888889,
.................... 0.00002480158730,
.................... -0.00000027557319,
.................... 0.00000000208767,
.................... //-0.00000000001147,
.................... // 0.00000000000005
.................... };
....................
.................... if (x < 0) x = -x; // absolute value of input
....................
.................... quad = (unsigned int8)(x / PI_DIV_BY_TWO); // quadrant
.................... frac = (x / PI_DIV_BY_TWO) - quad; // fractional part of input
.................... quad = quad % 4; // quadrant (0 to 3)
....................
.................... if (quad == 0 || quad == 2)
.................... t = frac * PI_DIV_BY_TWO;
.................... else if (quad == 1)
.................... t = (1-frac) * PI_DIV_BY_TWO;
.................... else // should be 3
.................... t = (frac-1) * PI_DIV_BY_TWO;
....................
.................... y = 0.999999999781;
.................... t = t * t;
.................... for (i = 0; i <= 5; i++)
.................... {
.................... t2 = t2 * t;
.................... y = y + p[i] * t2;
.................... }
....................
.................... if (quad == 2 || quad == 1)
.................... y = -y; // correct sign
....................
.................... return (y);
.................... }
....................
.................... // Overloaded function cos() for data type - Float48
.................... float64 cos(float64 x)
.................... {
.................... float64 y, t, t2 = 1.0;
.................... unsigned int8 quad, i;
.................... float64 frac;
.................... float64 p[6] = { //by the series definition for cosine
.................... -0.5, // sum ( ( (-1)^n * x^2n )/(2n)! )
.................... 0.04166666666667,
.................... -0.00138888888889,
.................... 0.00002480158730,
.................... -0.00000027557319,
.................... 0.00000000208767,
.................... //-0.00000000001147,
.................... // 0.00000000000005
.................... };
....................
.................... if (x < 0) x = -x; // absolute value of input
....................
.................... quad = (unsigned int8)(x / PI_DIV_BY_TWO); // quadrant
.................... frac = (x / PI_DIV_BY_TWO) - quad; // fractional part of input
.................... quad = quad % 4; // quadrant (0 to 3)
....................
.................... if (quad == 0 || quad == 2)
.................... t = frac * PI_DIV_BY_TWO;
.................... else if (quad == 1)
.................... t = (1-frac) * PI_DIV_BY_TWO;
.................... else // should be 3
.................... t = (frac-1) * PI_DIV_BY_TWO;
....................
.................... y = 0.999999999781;
.................... t = t * t;
.................... for (i = 0; i <= 5; i++)
.................... {
.................... t2 = t2 * t;
.................... y = y + p[i] * t2;
.................... }
....................
.................... if (quad == 2 || quad == 1)
.................... y = -y; // correct sign
....................
.................... return (y);
.................... }
....................
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float sin(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the sine value of the angle x, which is in radian
.................... // Date : 9/20/2001
.................... //
.................... float32 sin(float32 x)
.................... {
.................... return cos(x - PI_DIV_BY_TWO);
.................... }
....................
.................... //Overloaded functions for sin() for PCD
.................... // Overloaded function sin() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 sin(float48 x)
.................... {
.................... return cos(x - PI_DIV_BY_TWO);
.................... }
....................
.................... // Overloaded function sin() for data type - Float48
.................... float64 sin(float64 x)
.................... {
.................... return cos(x - PI_DIV_BY_TWO);
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float tan(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the tangent value of the angle x, which is in radian
.................... // Date : 9/20/2001
.................... //
.................... float32 tan(float32 x)
.................... {
.................... float32 c, s;
....................
.................... c = cos(x);
.................... if (c == 0.0)
.................... return (1.0e+36);
....................
.................... s = sin(x);
.................... return(s/c);
.................... }
.................... //Overloaded functions for tan() for PCD
.................... // Overloaded function tan() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 tan(float48 x)
.................... {
.................... float48 c, s;
....................
.................... c = cos(x);
.................... if (c == 0.0)
.................... return (1.0e+36);
....................
.................... s = sin(x);
.................... return(s/c);
.................... }
....................
.................... // Overloaded function tan() for data type - Float48
.................... float64 tan(float64 x)
.................... {
.................... float64 c, s;
....................
.................... c = cos(x);
.................... if (c == 0.0)
.................... return (1.0e+36);
....................
.................... s = sin(x);
.................... return(s/c);
.................... }
.................... #endif
....................
.................... float32 const pas[3] = {0.49559947, -4.6145309, 5.6036290};
.................... float32 const qas[3] = {1.0000000, -5.5484666, 5.6036290};
....................
.................... float32 ASIN_COS(float32 x, unsigned int8 n)
.................... {
.................... float32 y, res, r, y2;
.................... int1 s;
.................... #ifdef _ERRNO
.................... if(x <-1 || x > 1)
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
.................... s = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... y = -y;
.................... }
....................
.................... if (y > 0.5)
.................... {
.................... y = sqrt((1.0 - y)/2.0);
.................... n += 2;
.................... }
....................
.................... y2=y*y;
....................
.................... res = pas[0]*y2 + pas[1];
.................... res = res*y2 + pas[2];
....................
.................... r = qas[0]*y2 + qas[1];
.................... r = r*y2 + qas[2];
....................
.................... res = y*res/r;
....................
.................... if (n & 2) // |x| > 0.5
.................... res = PI_DIV_BY_TWO - 2.0*res;
.................... if (s)
.................... res = -res;
.................... if (n & 1) // take arccos
.................... res = PI_DIV_BY_TWO - res;
....................
.................... return(res);
.................... }
....................
.................... //Overloaded functions for ASIN_COS() for PCD
.................... // Overloaded function ASIN_COS() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 ASIN_COS(float48 x, unsigned int8 n)
.................... {
.................... float48 y, res, r, y2;
.................... int1 s;
.................... #ifdef _ERRNO
.................... if(x <-1 || x > 1)
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
.................... s = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... y = -y;
.................... }
....................
.................... if (y > 0.5)
.................... {
.................... y = sqrt((1.0 - y)/2.0);
.................... n += 2;
.................... }
....................
.................... y2=y*y;
....................
.................... res = pas[0]*y2 + pas[1];
.................... res = res*y2 + pas[2];
....................
.................... r = qas[0]*y2 + qas[1];
.................... r = r*y2 + qas[2];
....................
.................... res = y*res/r;
....................
.................... if (n & 2) // |x| > 0.5
.................... res = PI_DIV_BY_TWO - 2.0*res;
.................... if (s)
.................... res = -res;
.................... if (n & 1) // take arccos
.................... res = PI_DIV_BY_TWO - res;
....................
.................... return(res);
.................... }
....................
.................... // Overloaded function ASIN_COS() for data type - Float64
.................... float64 ASIN_COS(float64 x, unsigned int8 n)
.................... {
.................... float64 y, res, r, y2;
.................... int1 s;
.................... #ifdef _ERRNO
.................... if(x <-1 || x > 1)
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
.................... s = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... y = -y;
.................... }
....................
.................... if (y > 0.5)
.................... {
.................... y = sqrt((1.0 - y)/2.0);
.................... n += 2;
.................... }
....................
.................... y2=y*y;
....................
.................... res = pas[0]*y2 + pas[1];
.................... res = res*y2 + pas[2];
....................
.................... r = qas[0]*y2 + qas[1];
.................... r = r*y2 + qas[2];
....................
.................... res = y*res/r;
....................
.................... if (n & 2) // |x| > 0.5
.................... res = PI_DIV_BY_TWO - 2.0*res;
.................... if (s)
.................... res = -res;
.................... if (n & 1) // take arccos
.................... res = PI_DIV_BY_TWO - res;
....................
.................... return(res);
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float asin(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the arcsine value of the value x.
.................... // Date : N/A
.................... //
.................... float32 asin(float32 x)
.................... {
.................... float32 r;
....................
.................... r = ASIN_COS(x, 0);
.................... return(r);
.................... }
.................... //Overloaded functions for asin() for PCD
.................... // Overloaded function asin() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 asin(float48 x)
.................... {
.................... float48 r;
....................
.................... r = ASIN_COS(x, 0);
.................... return(r);
.................... }
....................
.................... // Overloaded function asin() for data type - Float64
.................... float64 asin(float64 x)
.................... {
.................... float64 r;
....................
.................... r = ASIN_COS(x, 0);
.................... return(r);
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float acos(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the arccosine value of the value x.
.................... // Date : N/A
.................... //
.................... float32 acos(float32 x)
.................... {
.................... float32 r;
....................
.................... r = ASIN_COS(x, 1);
.................... return(r);
.................... }
.................... //Overloaded functions for acos() for PCD
.................... // Overloaded function acos() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 acos(float48 x)
.................... {
.................... float48 r;
....................
.................... r = ASIN_COS(x, 1);
.................... return(r);
.................... }
....................
.................... // Overloaded function acos() for data type - Float64
.................... float64 acos(float64 x)
.................... {
.................... float64 r;
....................
.................... r = ASIN_COS(x, 1);
.................... return(r);
.................... }
.................... #endif
....................
.................... float32 const pat[4] = {0.17630401, 5.6710795, 22.376096, 19.818457};
.................... float32 const qat[4] = {1.0000000, 11.368190, 28.982246, 19.818457};
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float atan(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : returns the arctangent value of the value x.
.................... // Date : N/A
.................... //
.................... float32 atan(float32 x)
.................... {
.................... float32 y, res, r;
.................... int1 s, flag;
....................
.................... s = 0;
.................... flag = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... y = -y;
.................... }
....................
.................... if (y > 1.0)
.................... {
.................... y = 1.0/y;
.................... flag = 1;
.................... }
....................
.................... res = pat[0]*y*y + pat[1];
.................... res = res*y*y + pat[2];
.................... res = res*y*y + pat[3];
....................
.................... r = qat[0]*y*y + qat[1];
.................... r = r*y*y + qat[2];
.................... r = r*y*y + qat[3];
....................
.................... res = y*res/r;
....................
....................
.................... if (flag) // for |x| > 1
.................... res = PI_DIV_BY_TWO - res;
.................... if (s)
.................... res = -res;
....................
.................... return(res);
.................... }
.................... //Overloaded functions for atan() for PCD
.................... // Overloaded function atan() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 atan(float48 x)
.................... {
.................... float48 y, res, r;
.................... int1 s, flag;
....................
.................... s = 0;
.................... flag = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... y = -y;
.................... }
....................
.................... if (y > 1.0)
.................... {
.................... y = 1.0/y;
.................... flag = 1;
.................... }
....................
.................... res = pat[0]*y*y + pat[1];
.................... res = res*y*y + pat[2];
.................... res = res*y*y + pat[3];
....................
.................... r = qat[0]*y*y + qat[1];
.................... r = r*y*y + qat[2];
.................... r = r*y*y + qat[3];
....................
.................... res = y*res/r;
....................
....................
.................... if (flag) // for |x| > 1
.................... res = PI_DIV_BY_TWO - res;
.................... if (s)
.................... res = -res;
....................
.................... return(res);
.................... }
....................
.................... // Overloaded function atan() for data type - Float64
.................... float64 atan(float64 x)
.................... {
.................... float64 y, res, r;
.................... int1 s, flag;
....................
.................... s = 0;
.................... flag = 0;
.................... y = x;
....................
.................... if (x < 0)
.................... {
.................... s = 1;
.................... y = -y;
.................... }
....................
.................... if (y > 1.0)
.................... {
.................... y = 1.0/y;
.................... flag = 1;
.................... }
....................
.................... res = pat[0]*y*y + pat[1];
.................... res = res*y*y + pat[2];
.................... res = res*y*y + pat[3];
....................
.................... r = qat[0]*y*y + qat[1];
.................... r = r*y*y + qat[2];
.................... r = r*y*y + qat[3];
....................
.................... res = y*res/r;
....................
....................
.................... if (flag) // for |x| > 1
.................... res = PI_DIV_BY_TWO - res;
.................... if (s)
.................... res = -res;
....................
.................... return(res);
.................... }
.................... #endif
....................
.................... /////////////////////////////////////////////////////////////////////////////
.................... // float atan2(float y, float x)
.................... /////////////////////////////////////////////////////////////////////////////
.................... // Description :computes the principal value of arc tangent of y/x, using the
.................... // signs of both the arguments to determine the quadrant of the return value
.................... // Returns : returns the arc tangent of y/x.
.................... // Date : N/A
.................... //
....................
.................... float32 atan2(float32 y,float32 x)
.................... {
.................... float32 z;
.................... int1 sign;
.................... unsigned int8 quad;
.................... sign=0;
.................... quad=0; //quadrant
.................... quad=((y<=0.0)?((x<=0.0)?3:4):((x<0.0)?2:1));
.................... if(y<0.0)
.................... {
.................... sign=1;
.................... y=-y;
.................... }
.................... if(x<0.0)
.................... {
.................... x=-x;
.................... }
.................... if (x==0.0)
.................... {
.................... if(y==0.0)
.................... {
.................... #ifdef _ERRNO
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
.................... }
.................... else
.................... {
.................... if(sign)
.................... {
.................... return (-(PI_DIV_BY_TWO));
.................... }
.................... else
.................... {
.................... return (PI_DIV_BY_TWO);
.................... }
.................... }
.................... }
.................... else
.................... {
.................... z=y/x;
.................... switch(quad)
.................... {
.................... case 1:
.................... {
.................... return atan(z);
.................... break;
.................... }
.................... case 2:
.................... {
.................... // return (atan(z)+PI_DIV_BY_TWO); //2L3122
.................... return (PI-atan(z));
.................... break;
.................... }
.................... case 3:
.................... {
.................... return (atan(z)-PI);
.................... break;
.................... }
.................... case 4:
.................... {
.................... return (-atan(z));
.................... break;
.................... }
.................... }
.................... }
.................... }
....................
.................... //Overloaded functions for atan2() for PCD
.................... // Overloaded function atan2() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 atan2(float48 y,float48 x)
.................... {
.................... float48 z;
.................... int1 sign;
.................... unsigned int8 quad;
.................... sign=0;
.................... quad=0; //quadrant
.................... quad=((y<=0.0)?((x<=0.0)?3:4):((x<0.0)?2:1));
.................... if(y<0.0)
.................... {
.................... sign=1;
.................... y=-y;
.................... }
.................... if(x<0.0)
.................... {
.................... x=-x;
.................... }
.................... if (x==0.0)
.................... {
.................... if(y==0.0)
.................... {
.................... #ifdef _ERRNO
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
.................... }
.................... else
.................... {
.................... if(sign)
.................... {
.................... return (-(PI_DIV_BY_TWO));
.................... }
.................... else
.................... {
.................... return (PI_DIV_BY_TWO);
.................... }
.................... }
.................... }
.................... else
.................... {
.................... z=y/x;
.................... switch(quad)
.................... {
.................... case 1:
.................... {
.................... return atan(z);
.................... break;
.................... }
.................... case 2:
.................... {
.................... // return (atan(z)+PI_DIV_BY_TWO); //2L3122
.................... return (PI-atan(z));
.................... break;
.................... }
.................... case 3:
.................... {
.................... return (atan(z)-PI);
.................... break;
.................... }
.................... case 4:
.................... {
.................... return (-atan(z));
.................... break;
.................... }
.................... }
.................... }
.................... }
....................
.................... // Overloaded function atan2() for data type - Float64
.................... float64 atan2(float64 y,float64 x)
.................... {
.................... float64 z;
.................... int1 sign;
.................... unsigned int8 quad;
.................... sign=0;
.................... quad=0; //quadrant
.................... quad=((y<=0.0)?((x<=0.0)?3:4):((x<0.0)?2:1));
.................... if(y<0.0)
.................... {
.................... sign=1;
.................... y=-y;
.................... }
.................... if(x<0.0)
.................... {
.................... x=-x;
.................... }
.................... if (x==0.0)
.................... {
.................... if(y==0.0)
.................... {
.................... #ifdef _ERRNO
.................... {
.................... errno=EDOM;
.................... }
.................... #endif
.................... }
.................... else
.................... {
.................... if(sign)
.................... {
.................... return (-(PI_DIV_BY_TWO));
.................... }
.................... else
.................... {
.................... return (PI_DIV_BY_TWO);
.................... }
.................... }
.................... }
.................... else
.................... {
.................... z=y/x;
.................... switch(quad)
.................... {
.................... case 1:
.................... {
.................... return atan(z);
.................... break;
.................... }
.................... case 2:
.................... {
.................... // return (atan(z)+PI_DIV_BY_TWO); //2L3122
.................... return (PI-atan(z));
.................... break;
.................... }
.................... case 3:
.................... {
.................... return (atan(z)-PI);
.................... break;
.................... }
.................... case 4:
.................... {
.................... return (-atan(z));
.................... break;
.................... }
.................... }
.................... }
.................... }
.................... #endif
....................
.................... //////////////////// Hyperbolic functions ////////////////////
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float cosh(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : Computes the hyperbolic cosine value of x
.................... // Returns : returns the hyperbolic cosine value of x
.................... // Date : N/A
.................... //
....................
.................... float32 cosh(float32 x)
.................... {
.................... return ((exp(x)+exp(-x))/2);
.................... }
.................... //Overloaded functions for cosh() for PCD
.................... // Overloaded function cosh() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 cosh(float48 x)
.................... {
.................... return ((exp(x)+exp(-x))/2);
.................... }
....................
.................... // Overloaded function cosh() for data type - Float64
.................... float64 cosh(float64 x)
.................... {
.................... return ((exp(x)+exp(-x))/2);
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float sinh(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : Computes the hyperbolic sine value of x
.................... // Returns : returns the hyperbolic sine value of x
.................... // Date : N/A
.................... //
....................
.................... float32 sinh(float32 x)
.................... {
....................
.................... return ((exp(x) - exp(-x))/2);
.................... }
.................... //Overloaded functions for sinh() for PCD
.................... // Overloaded function sinh() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 sinh(float48 x)
.................... {
....................
.................... return ((exp(x) - exp(-x))/2);
.................... }
....................
.................... // Overloaded function sinh() for data type - Float48
.................... float64 sinh(float64 x)
.................... {
....................
.................... return ((exp(x) - exp(-x))/2);
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float tanh(float x)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : Computes the hyperbolic tangent value of x
.................... // Returns : returns the hyperbolic tangent value of x
.................... // Date : N/A
.................... //
....................
.................... float32 tanh(float32 x)
.................... {
.................... return(sinh(x)/cosh(x));
.................... }
.................... //Overloaded functions for tanh() for PCD
.................... // Overloaded function tanh() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 tanh(float48 x)
.................... {
.................... return(sinh(x)/cosh(x));
.................... }
....................
.................... // Overloaded function tanh() for data type - Float64
.................... float64 tanh(float64 x)
.................... {
.................... return(sinh(x)/cosh(x));
.................... }
.................... #endif
....................
.................... ////////////////////////////////////////////////////////////////////////////
.................... // float frexp(float x, signed int *exp)
.................... ////////////////////////////////////////////////////////////////////////////
.................... // Description : breaks a floating point number into a normalized fraction and an integral
.................... // power of 2. It stores the integer in the signed int object pointed to by exp.
.................... // Returns : returns the value x, such that x is a double with magnitude in the interval
.................... // [1/2,1) or zero, and value equals x times 2 raised to the power *exp.If value is zero,
.................... // both parts of the result are zero.
.................... // Date : N/A
.................... //
....................
.................... #define LOG2 .30102999566398119521
.................... float32 frexp(float32 x, signed int8 *exp)
.................... {
.................... float32 res;
.................... int1 sign = 0;
.................... if(x == 0.0)
.................... {
.................... *exp=0;
.................... return (0.0);
.................... }
.................... if(x < 0.0)
.................... {
.................... x=-x;
.................... sign=1;
.................... }
.................... if (x > 1.0)
.................... {
.................... *exp=(ceil(log10(x)/LOG2));
.................... res=x/(pow(2, *exp));
.................... if (res == 1)
.................... {
.................... *exp=*exp+1;
.................... res=.5;
.................... }
.................... }
.................... else
.................... {
.................... if(x < 0.5)
.................... {
.................... *exp=-1;
.................... res=x*2;
.................... }
.................... else
.................... {
.................... *exp=0;
.................... res=x;
.................... }
.................... }
.................... if(sign)
.................... {
.................... res=-res;
.................... }
.................... return res;
.................... }
....................
.................... //Overloaded functions for frexp() for PCD
.................... // Overloaded function frexp() for data type - Float48
.................... #if defined(__PCD__)
.................... float48 frexp(float48 x, signed int8 *exp)
.................... {
.................... float48 res;
.................... int1 sign = 0;
.................... if(x == 0.0)
.................... {
.................... *exp=0;
.................... return (0.0);
.................... }
.................... if(x < 0.0)
.................... {
.................... x=-x;
.................... sign=1;
.................... }
.................... if (x > 1.0)
.................... {
.................... *exp=(ceil(log10(x)/LOG2));
.................... res=x/(pow(2, *exp));
.................... if (res == 1)
.................... {
.................... *exp=*exp+1;
.................... res=.5;
.................... }
.................... }
.................... else
.................... {
.................... if(x < 0.5)
.................... {
.................... *exp=-1;
.................... res=x*2;
.................... }
.................... else
.................... {
.................... *exp=0;
.................... res=x;
.................... }
.................... }
.................... if(sign)
.................... {
.................... res=-res;
.................... }
.................... return res;
.................... }
....................
.................... // Overloaded function frexp() for data type - Float64
.................... float64 frexp(float64 x, signed int8 *exp)
.................... {
.................... float64 res;
.................... int1 sign = 0;
.................... if(x == 0.0)
.................... {
.................... *exp=0;
.................... return (0.0);
.................... }
.................... if(x < 0.0)
.................... {
.................... x=-x;
.................... sign=1;
.................... }
.................... if (x > 1.0)
.................... {
.................... *exp=(ceil(log10(x)/LOG2));
.................... res=x/(pow(2, *exp));
.................... if (res == 1)
.................... {
.................... *exp=*exp+1;
.................... res=.5;
.................... }
.................... }
.................... else
.................... {
.................... if(x < 0.5)
.................... {
.................... *exp=-1;
.................... res=x*2;
.................... }
.................... else
.................... {
.................... *exp=0;
.................... res=x;
.................... }
.................... }
.................... if(sign)
.................... {
.................... res=-res;
.................... }
.................... return res;
.................... }
.................... #endif
....................
.................... //////////////////////////////////////////////////////////////////////////////
.................... // float ldexp(float x, signed int *exp)
.................... //////////////////////////////////////////////////////////////////////////////
.................... // Description : multiplies a floating point number by an integral power of 2.
.................... // Returns : returns the value of x times 2 raised to the power exp.
.................... // Date : N/A
.................... //
....................
.................... float32 ldexp(float32 value, signed int8 exp)
.................... {
.................... return (value * pow(2,exp));
.................... }
.................... //Overloaded functions for ldexp() for PCD
.................... // Overloaded function ldexp() for data type - Float48
....................
.................... #if defined(__PCD__)
.................... float48 ldexp(float48 value, signed int8 exp)
.................... {
.................... return (value * pow(2,exp));
.................... }
.................... // Overloaded function ldexp() for data type - Float64
.................... float64 ldexp(float64 value, signed int8 exp)
.................... {
.................... return (value * pow(2,exp));
.................... }
.................... #endif
....................
.................... #endif
....................
....................
.................... void main()
.................... {
*
0250: CLRF 04
0251: BCF 03.7
0252: MOVLW 1F
0253: ANDWF 03,F
0254: MOVLW 71
0255: BSF 03.5
0256: MOVWF 0F
0257: MOVF 0F,W
0258: BCF 03.5
0259: BCF 20.7
025A: MOVF 20,W
025B: BSF 03.5
025C: MOVWF 07
025D: BCF 03.5
025E: BSF 07.7
025F: BSF 03.5
0260: BSF 03.6
0261: MOVF 09,W
0262: ANDLW C0
0263: MOVWF 09
0264: BCF 03.6
0265: BCF 1F.4
0266: BCF 1F.5
0267: MOVLW 00
0268: BSF 03.6
0269: MOVWF 08
026A: BCF 03.5
026B: CLRF 07
026C: CLRF 08
026D: CLRF 09
024F: CLRF 04
0250: BCF 03.7
0251: MOVLW 1F
0252: ANDWF 03,F
0253: MOVLW 71
0254: BSF 03.5
0255: MOVWF 0F
0256: MOVF 0F,W
0257: BCF 03.5
0258: BCF 20.7
0259: MOVF 20,W
025A: BSF 03.5
025B: MOVWF 07
025C: BCF 03.5
025D: BSF 07.7
025E: BSF 03.5
025F: BSF 03.6
0260: MOVF 09,W
0261: ANDLW C0
0262: MOVWF 09
0263: BCF 03.6
0264: BCF 1F.4
0265: BCF 1F.5
0266: MOVLW 00
0267: BSF 03.6
0268: MOVWF 08
0269: BCF 03.5
026A: CLRF 07
026B: CLRF 08
026C: CLRF 09
*
0277: CLRF 29
0278: CLRF 28
.................... int1 last;
0276: CLRF 34
0277: CLRF 33
.................... float last,b,anemo_speed;
.................... unsigned int16 anemo_round=0;
.................... unsigned int16 i;
....................
565,102 → 2737,102
....................
.................... //signed int16 X,Y,Z;
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
0279: BSF 03.5
027A: BSF 03.6
027B: MOVF 09,W
027C: ANDLW C0
027D: MOVWF 09
027E: BCF 03.6
027F: BCF 1F.4
0280: BCF 1F.5
0281: MOVLW 00
0282: BSF 03.6
0283: MOVWF 08
0278: BSF 03.5
0279: BSF 03.6
027A: MOVF 09,W
027B: ANDLW C0
027C: MOVWF 09
027D: BCF 03.6
027E: BCF 1F.4
027F: BCF 1F.5
0280: MOVLW 00
0281: BSF 03.6
0282: MOVWF 08
.................... setup_adc(ADC_CLOCK_DIV_2);
0284: BCF 03.5
0285: BCF 03.6
0286: BCF 1F.6
0287: BCF 1F.7
0288: BSF 03.5
0289: BCF 1F.7
028A: BCF 03.5
028B: BSF 1F.0
0283: BCF 03.5
0284: BCF 03.6
0285: BCF 1F.6
0286: BCF 1F.7
0287: BSF 03.5
0288: BCF 1F.7
0289: BCF 03.5
028A: BSF 1F.0
.................... setup_spi(SPI_SS_DISABLED);
028C: BCF 14.5
028D: BCF 20.5
028E: MOVF 20,W
028F: BSF 03.5
0290: MOVWF 07
0291: BCF 03.5
0292: BSF 20.4
0293: MOVF 20,W
0294: BSF 03.5
0295: MOVWF 07
0296: BCF 03.5
0297: BCF 20.3
0298: MOVF 20,W
0299: BSF 03.5
029A: MOVWF 07
029B: MOVLW 01
029C: BCF 03.5
029D: MOVWF 14
029E: MOVLW 00
029F: BSF 03.5
02A0: MOVWF 14
028B: BCF 14.5
028C: BCF 20.5
028D: MOVF 20,W
028E: BSF 03.5
028F: MOVWF 07
0290: BCF 03.5
0291: BSF 20.4
0292: MOVF 20,W
0293: BSF 03.5
0294: MOVWF 07
0295: BCF 03.5
0296: BCF 20.3
0297: MOVF 20,W
0298: BSF 03.5
0299: MOVWF 07
029A: MOVLW 01
029B: BCF 03.5
029C: MOVWF 14
029D: MOVLW 00
029E: BSF 03.5
029F: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
02A1: MOVF 01,W
02A2: ANDLW C7
02A3: IORLW 08
02A4: MOVWF 01
02A0: MOVF 01,W
02A1: ANDLW C7
02A2: IORLW 08
02A3: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
02A5: BCF 03.5
02A6: CLRF 10
02A4: BCF 03.5
02A5: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
02A7: MOVLW 00
02A8: MOVWF 78
02A9: MOVWF 12
02AA: MOVLW 00
02AB: BSF 03.5
02AC: MOVWF 12
02A6: MOVLW 00
02A7: MOVWF 78
02A8: MOVWF 12
02A9: MOVLW 00
02AA: BSF 03.5
02AB: MOVWF 12
.................... setup_ccp1(CCP_OFF);
02AD: BCF 03.5
02AE: BSF 20.2
02AF: MOVF 20,W
02B0: BSF 03.5
02B1: MOVWF 07
02B2: BCF 03.5
02B3: CLRF 17
02B4: BSF 03.5
02B5: CLRF 1B
02B6: CLRF 1C
02B7: MOVLW 01
02B8: MOVWF 1D
02AC: BCF 03.5
02AD: BSF 20.2
02AE: MOVF 20,W
02AF: BSF 03.5
02B0: MOVWF 07
02B1: BCF 03.5
02B2: CLRF 17
02B3: BSF 03.5
02B4: CLRF 1B
02B5: CLRF 1C
02B6: MOVLW 01
02B7: MOVWF 1D
.................... setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
02B9: BCF 03.5
02BA: BSF 03.6
02BB: CLRF 07
02BC: CLRF 08
02BD: CLRF 09
02B8: BCF 03.5
02B9: BSF 03.6
02BA: CLRF 07
02BB: CLRF 08
02BC: CLRF 09
....................
.................... // Init the HMC5883L. Set Mode register for
.................... // continuous measurements.
.................... hmc5883l_write_reg(HMC5883L_CFG_A_REG, 0x18); // no average, maximal update range
02BE: BCF 03.6
02BF: CLRF 2C
02C0: MOVLW 18
02C1: MOVWF 2D
02C2: CALL 069
02BD: BCF 03.6
02BE: CLRF 37
02BF: MOVLW 18
02C0: MOVWF 38
02C1: CALL 069
.................... hmc5883l_write_reg(HMC5883L_CFG_B_REG, 0xE0); // maximal range
02C3: MOVLW 01
02C4: MOVWF 2C
02C5: MOVLW E0
02C6: MOVWF 2D
02C7: CALL 069
02C2: MOVLW 01
02C3: MOVWF 37
02C4: MOVLW E0
02C5: MOVWF 38
02C6: CALL 069
.................... hmc5883l_write_reg(HMC5883L_MODE_REG, 0x00);
02C8: MOVLW 02
02C9: MOVWF 2C
02CA: CLRF 2D
02CB: CALL 069
02C7: MOVLW 02
02C8: MOVWF 37
02C9: CLRF 38
02CA: CALL 069
....................
.................... // Continuously read and display the x,y,z results.
.................... // Wait at least 67 ms between reads, re the HMC5883L data sheet.
667,29 → 2839,29
....................
....................
.................... printf("Magnetometr: \r\n",);
02CC: MOVLW 04
02CD: BSF 03.6
02CE: MOVWF 0D
02CF: MOVLW 00
02D0: MOVWF 0F
02D1: BCF 03.6
02D2: CALL 0C6
02CB: MOVLW 04
02CC: BSF 03.6
02CD: MOVWF 0D
02CE: MOVLW 00
02CF: MOVWF 0F
02D0: BCF 03.6
02D1: CALL 0C5
.................... printf("(c)mlab JACHO 2013: \r\n",);
02D3: MOVLW 0D
02D4: BSF 03.6
02D5: MOVWF 0D
02D6: MOVLW 00
02D7: MOVWF 0F
02D8: BCF 03.6
02D9: CALL 0C6
02D2: MOVLW 0D
02D3: BSF 03.6
02D4: MOVWF 0D
02D5: MOVLW 00
02D6: MOVWF 0F
02D7: BCF 03.6
02D8: CALL 0C5
.................... printf("X, Y, Z \r\n",);
02DA: MOVLW 19
02DB: BSF 03.6
02DC: MOVWF 0D
02DD: MOVLW 00
02DE: MOVWF 0F
02DF: BCF 03.6
02E0: CALL 0C6
02D9: MOVLW 19
02DA: BSF 03.6
02DB: MOVWF 0D
02DC: MOVLW 00
02DD: MOVWF 0F
02DE: BCF 03.6
02DF: CALL 0C5
....................
.................... /* while(true)
.................... {
705,111 → 2877,67
.................... while(TRUE)
.................... {
....................
.................... for( i=0;i<=1000;i++)
02E1: CLRF 2B
02E2: CLRF 2A
02E3: MOVF 2B,W
02E4: SUBLW 03
02E5: BTFSS 03.0
02E6: GOTO 303
02E7: BTFSS 03.2
02E8: GOTO 2ED
02E9: MOVF 2A,W
02EA: SUBLW E8
02EB: BTFSS 03.0
02EC: GOTO 303
.................... {
.................... // delay_ms();
.................... hmc5883l_read_data();
02ED: GOTO 151
.................... // for(i=0;i<=10;i++)
.................... // {
.................... hmc5883l_read_data();
02E0: GOTO 150
....................
.................... // b = atan2((float)compass.y,(float)compass.x); // vypocet azimutu z kartezskych souradnic
.................... // b = (b/3.141596)*180; // prevod na stupne
.................... // b += 180;
....................
.................... if(compass.x < 0)
02EE: BTFSS 22.7
02EF: GOTO 2F6
.................... {
.................... if(last == 1) anemo_round++;
02F0: BTFSS 27.0
02F1: GOTO 2F5
02F2: INCF 28,F
02F3: BTFSC 03.2
02F4: INCF 29,F
.................... last=0;
02F5: BCF 27.0
.................... }
.................... if(compass.x > 0) last=1;
02F6: BTFSC 22.7
02F7: GOTO 2FF
02F8: MOVF 22,F
02F9: BTFSS 03.2
02FA: GOTO 2FE
02FB: MOVF 21,W
02FC: SUBLW 00
02FD: BTFSS 03.0
02FE: BSF 27.0
.................... }
02FF: INCF 2A,F
0300: BTFSC 03.2
0301: INCF 2B,F
0302: GOTO 2E3
.................... // anemo_speed += (b-last);
.................... // last=b;
.................... // delay_ms(10);
.................... // }
.................... // anemo_speed=anemo_speed/10;
....................
.................... printf("%6Ld %6Ld %6Ld %6Ld \n\r", compass.x, compass.y, compass.z, anemo_round);
0303: MOVLW 00
0304: MOVWF 04
0305: MOVF 22,W
0306: MOVWF 2D
0307: MOVF 21,W
0308: MOVWF 2C
0309: CALL 1D0
030A: MOVLW 20
030B: MOVWF 35
030C: CALL 0A2
030D: MOVLW 00
030E: MOVWF 04
030F: MOVF 24,W
0310: MOVWF 2D
0311: MOVF 23,W
0312: MOVWF 2C
0313: CALL 1D0
0314: MOVLW 20
0315: MOVWF 35
0316: CALL 0A2
0317: MOVLW 00
0318: MOVWF 04
0319: MOVF 26,W
031A: MOVWF 2D
031B: MOVF 25,W
031C: MOVWF 2C
031D: CALL 1D0
031E: MOVLW 20
031F: MOVWF 35
0320: CALL 0A2
0321: MOVLW 00
0322: MOVWF 04
0323: MOVF 29,W
0324: MOVWF 2D
0325: MOVF 28,W
0326: MOVWF 2C
0327: CALL 1D0
0328: MOVLW 20
0329: MOVWF 35
032A: CALL 0A2
032B: MOVLW 0A
032C: MOVWF 35
032D: CALL 0A2
032E: MOVLW 0D
032F: MOVWF 35
0330: CALL 0A2
.................... anemo_round=0;
0331: CLRF 29
0332: CLRF 28
.................... printf("%6Ld %6Ld %6Ld \n\r", compass.x, compass.y, compass.z);
02E1: MOVLW 00
02E2: MOVWF 04
02E3: MOVF 22,W
02E4: MOVWF 38
02E5: MOVF 21,W
02E6: MOVWF 37
02E7: CALL 1CF
02E8: MOVLW 20
02E9: MOVWF 40
02EA: CALL 0A2
02EB: MOVLW 00
02EC: MOVWF 04
02ED: MOVF 24,W
02EE: MOVWF 38
02EF: MOVF 23,W
02F0: MOVWF 37
02F1: CALL 1CF
02F2: MOVLW 20
02F3: MOVWF 40
02F4: CALL 0A2
02F5: MOVLW 00
02F6: MOVWF 04
02F7: MOVF 26,W
02F8: MOVWF 38
02F9: MOVF 25,W
02FA: MOVWF 37
02FB: CALL 1CF
02FC: MOVLW 20
02FD: MOVWF 40
02FE: CALL 0A2
02FF: MOVLW 0A
0300: MOVWF 40
0301: CALL 0A2
0302: MOVLW 0D
0303: MOVWF 40
0304: CALL 0A2
.................... // delay_ms(100);
.................... }
0333: GOTO 2E1
0305: GOTO 2E0
....................
.................... }
....................
....................
....................
0334: SLEEP
0306: SLEEP
 
Configuration Fuses:
Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
/Modules/Sensors/MAG01A/SW/PIC16F887/main.sta
1,55 → 1,56
 
ROM used: 821 (10%)
821 (10%) including unused fragments
ROM used: 775 (9%)
775 (9%) including unused fragments
 
1 Average locations per line
15 Average locations per statement
0 Average locations per line
3 Average locations per statement
 
RAM used: 18 (5%) at main() level
27 (7%) worst case
RAM used: 28 (8%) at main() level
38 (10%) worst case
 
Stack used: 2 worst case (out of 8 total available)
 
Lines Stmts % Files
----- ----- --- -----
70 28 50 main.c
72 18 6 main.c
22 0 0 main.h
423 0 0 C:\Program Files (x86)\PICC\devices\16F887.h
19 0 0 HMC5883L.h
86 28 50 HMC5883L.c
86 28 9 HMC5883L.c
2172 260 85 C:\Program Files (x86)\PICC\drivers\math.h
----- -----
620 56 Total
2794 306 Total
 
Page ROM % RAM Vol Diff Functions:
---- --- --- --- --- ---- ----------
0 69 8 3 357 1.4 @I2C_READ_1
0 74 9 1 113 1.3 @I2C_WRITE_1
0 36 4 1 152 2.2 @PUTCHAR_1_
0 69 9 3 357 1.4 @I2C_READ_1
0 74 10 1 113 1.3 @I2C_WRITE_1
0 35 5 1 152 2.2 @PUTCHAR_1_
0 57 7 2 102 1.8 hmc5883l_write_reg
0 127 15 6 627 3.5 hmc5883l_read_data
0 229 28 6 1048 7.4 MAIN
0 9 1 0 171 2.7 @const100
0 70 9 3 171 2.7 @PSTRINGC7_69
0 12 1 0 171 2.7 @const102
0 6 1 0 587 3.3 @const103
0 128 16 9 @PRINTF_LD_69
0 127 16 6 636 3.3 hmc5883l_read_data
0 184 24 16 693 3.9 MAIN
0 9 1 0 @const237
0 70 9 3 @PSTRINGC7_69
0 12 2 0 @const239
0 6 1 0 @const240
0 128 17 9 @PRINTF_LD_69
 
Program metrics:
Functions 10
Statements 56
Comments 119
Volume (V) 5424
Difficilty (D) 29.5
Effort to implement (E) 160169
Time to implement (T) 2 hours, 28 minutes
Est Delivered Bugs (B) 1
Cyclomatic Complexity 4
Maintainability (MI) 70
Functions 6
Statements 306
Comments 377
Volume (V) 2949
Difficilty (D) 13.9
Effort to implement (E) 40971
Time to implement (T) 38 minutes
Est Delivered Bugs (B) 0
Cyclomatic Complexity 1
Maintainability (MI) 61
 
Segment Used Free
----------- ---- ----
00000-00003 4 0
00004-007FF 817 1227
00004-007FF 771 1273
00800-00FFF 0 2048
01000-017FF 0 2048
01800-01FFF 0 2048
/Modules/Sensors/MAG01A/SW/PIC16F887/main.sym
8,34 → 8,35
01C CCP_2_HIGH
020 @TRIS_C
021-026 compass
027.0 MAIN.last
028-029 MAIN.anemo_round
02A-02B MAIN.i
02C-02D @PRINTF_LD_69.P1
02C hmc5883l_write_reg.reg
02C hmc5883l_read_data.x_lsb
02C MAIN.@SCRATCH1
02C @PSTRINGC7_69.@SCRATCH1
02D hmc5883l_write_reg.data
02D hmc5883l_read_data.x_msb
02D @PSTRINGC7_69.@SCRATCH2
02E hmc5883l_read_data.y_lsb
02E @PSTRINGC7_69.@SCRATCH3
02E @PRINTF_LD_69.@SCRATCH1
02F hmc5883l_read_data.y_msb
02F @PRINTF_LD_69.@SCRATCH2
030 hmc5883l_read_data.z_lsb
030 @PRINTF_LD_69.@SCRATCH3
031 hmc5883l_read_data.z_msb
031 @PRINTF_LD_69.@SCRATCH4
032 @I2C_WRITE_1.P1
032 @I2C_READ_1.P2
032 @PRINTF_LD_69.@SCRATCH5
033 @I2C_READ_1.@SCRATCH1
033 @PRINTF_LD_69.@SCRATCH6
034 @I2C_READ_1.@SCRATCH2
034 @PRINTF_LD_69.@SCRATCH7
035 @PUTCHAR_1_.P1
027-02A MAIN.last
02B-02E MAIN.b
02F-032 MAIN.anemo_speed
033-034 MAIN.anemo_round
035-036 MAIN.i
037-038 @PRINTF_LD_69.P1
037 hmc5883l_write_reg.reg
037 hmc5883l_read_data.x_lsb
037 @PSTRINGC7_69.@SCRATCH1
038 hmc5883l_read_data.x_msb
038 hmc5883l_write_reg.data
038 @PSTRINGC7_69.@SCRATCH2
039 hmc5883l_read_data.y_lsb
039 @PSTRINGC7_69.@SCRATCH3
039 @PRINTF_LD_69.@SCRATCH1
03A hmc5883l_read_data.y_msb
03A @PRINTF_LD_69.@SCRATCH2
03B hmc5883l_read_data.z_lsb
03B @PRINTF_LD_69.@SCRATCH3
03C hmc5883l_read_data.z_msb
03C @PRINTF_LD_69.@SCRATCH4
03D @I2C_WRITE_1.P1
03D @I2C_READ_1.P2
03D @PRINTF_LD_69.@SCRATCH5
03E @I2C_READ_1.@SCRATCH1
03E @PRINTF_LD_69.@SCRATCH6
03F @I2C_READ_1.@SCRATCH2
03F @PRINTF_LD_69.@SCRATCH7
040 @PUTCHAR_1_.P1
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
43,22 → 44,23
07A @SCRATCH
107.6 C1OUT
108.6 C2OUT
10D-10E @WRITE_PROGRAM_MEMORY8.P1
10D-10E @READ_PROGRAM_MEMORY8.P2
10D-10E @READ_PROGRAM_MEMORY8.P1
10D-10E @WRITE_PROGRAM_MEMORY8.P2
 
ROM Allocation:
010C @I2C_READ_1
010B @I2C_READ_1
001F @I2C_WRITE_1
00A2 @PUTCHAR_1_
0069 hmc5883l_write_reg
0151 hmc5883l_read_data
0250 MAIN
0004 @const100
00C6 @PSTRINGC7_69
000D @const102
0019 @const103
01D0 @PRINTF_LD_69
0250 @cinit
0150 hmc5883l_read_data
0800 atan2
024F MAIN
0004 @const237
00C5 @PSTRINGC7_69
000D @const239
0019 @const240
01CF @PRINTF_LD_69
024F @cinit
 
 
User Memory space:
74,6 → 76,7
C:\Program Files (x86)\PICC\devices\16F887.h
HMC5883L.h
HMC5883L.c
C:\Program Files (x86)\PICC\drivers\math.h
 
Units:
Z:\home\kaklik\svnMLAB\Modules\Sensors\MAG01A\SW\PIC16F887\main (main)
/Modules/Sensors/MAG01A/SW/PIC16F887/main.tre
1,5 → 1,5
ÀÄmain
ÀÄMAIN 0/229 Ram=6
ÀÄMAIN 0/184 Ram=16
ÃÄ??0??
ÃÄhmc5883l_write_reg 0/57 Ram=2
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
14,14 → 14,14
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÀÄ@I2C_WRITE_1 0/74 Ram=1
ÃÄ@PSTRINGC7_69 0/70 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/35 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/35 Ram=1
ÃÄ@PSTRINGC7_69 0/70 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/35 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/35 Ram=1
ÃÄ@PSTRINGC7_69 0/70 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/35 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/35 Ram=1
ÃÄhmc5883l_read_data 0/127 Ram=6
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
33,16 → 33,13
³ ÃÄ@I2C_READ_1 0/69 Ram=3
³ ÀÄ@I2C_READ_1 0/69 Ram=3
ÃÄ@PRINTF_LD_69 0/128 Ram=9
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/35 Ram=1
ÃÄ@PUTCHAR_1_ 0/35 Ram=1
ÃÄ@PRINTF_LD_69 0/128 Ram=9
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/35 Ram=1
ÃÄ@PUTCHAR_1_ 0/35 Ram=1
ÃÄ@PRINTF_LD_69 0/128 Ram=9
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PRINTF_LD_69 0/128 Ram=9
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÀÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/35 Ram=1
ÃÄ@PUTCHAR_1_ 0/35 Ram=1
ÃÄ@PUTCHAR_1_ 0/35 Ram=1
ÀÄ@PUTCHAR_1_ 0/35 Ram=1
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.c
8,6 → 8,7
void main()
{
unsigned int8 i=0, sht_config;
float temperature, humidity;
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
20,23 → 21,25
 
SHT25_soft_reset();
printf("SHT25 humidity and temperature sensor example \r\n",);
printf("Temperature Humidity[%%] \r\n");
delay_ms (500);
 
 
while(TRUE)
{
if (i<10) sht_config = SHT25_RH12_T14 | SHT25_HEATER_OFF; // loop alters on chip heater on and off to check correct function
else
{
if (i<100) sht_config = SHT25_RH12_T14 | SHT25_HEATER_OFF; // loop alters on chip heater on and off to check correct function
else
{
sht_config = SHT25_RH12_T14 | SHT25_HEATER_ON;
if (i > 20) i = 0;
}
printf("setup: %X %X \r\n",SHT25_setup(sht_config),sht_config);
delay_ms (500);
printf("Temp: %f \r\n",SHT25_get_temp());
delay_ms (500);
printf("Hum: %f \r\n",SHT25_get_hum());
delay_ms (1000);
i++;
if (i > 120) i = 0;
}
temperature = SHT25_get_temp();
humidity = SHT25_get_hum();
 
printf("%f %f %X %X \r\n",temperature, humidity, SHT25_setup(sht_config),sht_config);
i++;
delay_ms(1000);
}
}
 
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.cof
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.err
1,2 → 1,2
Memory usage: ROM=29% RAM=3% - 10%
Memory usage: ROM=28% RAM=5% - 12%
0 Errors, 0 Warnings.
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.esym
1,7 → 1,7
D G "__PCM__" 0 44 ""4.106""
D G "__DEVICE__" 0 44 "887"
D G "__DATE__" 0 44 ""14-IV-13""
D G "__TIME__" 0 44 ""13:00:06"" "SHT25 sensor demo firmware"
D G "__PCM__" 0 47 ""4.106""
D G "__DEVICE__" 0 47 "887"
D G "__DATE__" 0 47 ""15-V-13""
D G "__TIME__" 0 47 ""22:58:57"" "SHT25 sensor demo firmware"
d G "PIN_A0" 2 20 "40"
d G "PIN_A1" 2 21 "41"
d G "PIN_A2" 2 22 "42"
322,7 → 322,9
F G "MAIN" 0 8 "void()"
V L "i" 0 10 "int8"
V L "sht_config" 0 10 "int8"
C L "MAIN" 0 27 1 "FUNCTION"
V L "temperature" 0 11 "float"
V L "humidity" 0 11 "float"
C L "MAIN" 0 30 1 "FUNCTION"
F B "reset_cpu" 0 0
F B "abs" 1 0
F B "sleep_ulpwu" 1 0
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.h
18,5 → 18,5
#use delay(clock=8000000)
 
#use i2c(master, sda=PIN_C4, scl=PIN_C3)
#use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8) //rcv TXD xmit RXD
#use rs232(baud=9600,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD
 
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.hex
1,301 → 1,295
:1000000008308A0000280000532454193510E83ABB
:10001000ED34E434F43CA0306E32203AE536F03270
:10002000F230F43AF232A0396537F3377210653C9A
:10003000E136703665100D050000F332F43A701D9C
:10004000A0125810252CA0060A00D4326D383A10A0
:100050002533A0060A00C83A6D1DA01266100D05D2
:1000600000000830F80000008711A0112008831656
:10007000870000008312A80D0712031C45282016D4
:10008000200883168700492883122012200883162F
:10009000870000008312A0152008831687008312B2
:1000A000871D5028F80B332800008711A011200865
:1000B000831687000000831220162008831687000D
:1000C000000000008312A015200883168700831209
:1000D000871D6828F8010000071A78148711A011FD
:1000E0002008831687008312071220122008831627
:1000F000870083120800201620088316870000005E
:100100008312A015200883168700000083120712AF
:100110002012200883168700000083128711A01187
:1001200020088316870080308312A8003120FE301B
:10013000A8003120201220088316870000008312B7
:10014000A0152008831687008312871DA5280000AC
:10015000A9280000201620088316870000008312BB
:100160008A150A12662883168613831286130830AE
:10017000F800BA280000F817CB28F813B40C0318BD
:100180008617031C86137817CB287813F80BBE2824
:10019000C928000086173F308400840BCD2800005A
:1001A000F81BBD28781BC5280800831603178C1779
:1001B0000C140000000083120C087F390319192960
:1001C0000313A30003170D080313A40003170F085C
:1001D0000313A5002308B400B320240803178D00DF
:1001E0000313250803178F0083168C170C140000C7
:1001F000000083120C0D0E0D7F390319192903130A
:10020000A30003170D080313A40003170F0803131B
:10021000A5002308B400B320240803178D0003139E
:10022000250803178F008D0A03198F0A0313D52899
:10023000031703138A150A126F28283084008313CA
:100240000008031930290230F800F701F70B2629BE
:10025000F80B25299730F700F70B2C29800B232961
:1002600008000830A9007708AA0020162008831685
:10027000870000008312A0152008831687008312D0
:10028000871D4029071A0314071E0310F80D0000EC
:10029000A01120088316870083128711A90B352926
:1002A00020162008831687000000831207122A08F0
:1002B00003195F292012200883168700831200008B
:1002C000A0152008831687008312871D652900006A
:1002D0008711A011200883168700000083120712DF
:1002E0002012200883168700831208002016200899
:1002F0008316870000008312A0152008831687004C
:1003000000008312071220122008831687000000C5
:1003100083128711A0112008831687008030831272
:10032000A8003120E730A8003120201620088316CD
:10033000870000008312A0152008831687000000A4
:100340008312871DA1290712201220088316870017
:10035000000083128711A0112008831687008130C6
:100360008312A8003120F70131217808A400240865
:100370003A392304A40020162008831687000000C1
:100380008312A01520088316870000008312871DA2
:10039000C729071220122008831687000000831245
:1003A0008711A01120088316870080308312A800CF
:1003B0003120E630A80031202408A8003120201286
:1003C00020088316870000008312A01520088316DA
:1003D00087008312871DEA290000EE2900002016FD
:1003E00020088316870000000A308312A8001D2110
:1003F000201620088316870000008312A01520080D
:10040000831687000000831207122012200883162B
:100410008700000083128711A0112008831687002F
:1004200080308312A8003120E730A8003120201648
:1004300020088316870000008312A0152008831669
:10044000870000008312871D232A0712201220082C
:1004500083168700000083128711A01120088316DD
:10046000870081308312A8003120F70131217808FC
:10047000A4002408F8008A150A1289288316031795
:100480008C170C140000000003186D2A83120C084E
:100490007F390313A80003170D080313A9000317DE
:1004A0000F080313AA002808B400B3202908031773
:1004B0008D0003132A0803178F0083168C170C1462
:1004C0000000000083120313A70B672A6A2A831611
:1004D00003176D2A8C2A8316031783120C0D0E0D39
:1004E0007F390313A80003170D080313A90003178E
:1004F0000F080313AA002808B400B3202908031723
:100500008D0003132A0803178F008D0A03198F0A21
:1005100003100313A70B3E2A0800A51B9F2A0F30C8
:10052000F700240EF7050A30770203189A2A3030B4
:10053000F7079C2A2508F7077708B400B3200F3087
:10054000A4050A3024020318A72A3030A92AA513CB
:100550002508A4072408B400B32008008E30F70053
:100560002908F8002808F900FA01F808031DC22A32
:100570007908F800F9010830F702F808031DC22ACB
:10058000F701CA2A0310F81BC92AF90DF80DF70361
:10059000C22AF81308002C080319902BB800300861
:1005A0000319902BB802031CDA2A7F30B80703180E
:1005B000902BE02A8130B802031C902B0319902B5A
:1005C0003808F700F801F901FA01B7012D08B60063
:1005D000B6172E08B5002F08B4001930B80033083C
:1005E000B4020318032B0130B5020318032BB60223
:1005F0000318032BB7020318032BB70AB60AB50A70
:100600003308B407352B3208B50203181E2B01300E
:10061000B60203181E2BB70203181E2BB70AB60A20
:100620003208B5073308B407031C352BB50A031D80
:10063000352BB60A031D352BB70A352B3108803808
:10064000B6020318342B0130B7020318342BB70A53
:1006500031088038B6073208B507031C122BB60ADA
:10066000031D122BB70A122B7A14B80B382B432B0D
:100670000310B40DB50DB60DB70D0310FA0DF90D3D
:10068000F80DB90DEF2A391C4B2B0310F80CF90C9F
:10069000FA0CB90C4E2BF7030319902BB91B772BCF
:1006A0000310B40DB50DB60DB70D3308B402031821
:1006B000632B0130B5020318632BB6020318632BBA
:1006C000B702031C862B3208B50203186E2B0130CB
:1006D000B60203186E2BB702031C862B3108803834
:1006E000B6020318772B0130B702031C862BFA0AD7
:1006F000031D862BF90A031D862BF80A031D862B82
:10070000F70A0319902BF80CF90CFA0C2D08B80015
:100710003108B806B81F8E2BF817942BF813942BBA
:10072000F701F801F901FA01080034080319052C52
:10073000BC0038080319052CBC070318A62B7F3012
:10074000BC02031C052C0319052CAA2B8130BC0705
:100750000318052C3C08F700F801F901FA013508E7
:10076000C000C0173608BF003708BE001830BC00F4
:10077000BD013E1CD32B3B08FA07031CC52BF90A0D
:10078000031DC52BF80A0319BD173A08F907031C06
:10079000CC2BF80A0319BD173908B600B61736086E
:1007A000F8070318BD17BD0DF80CF90CFA0CC00CB6
:1007B000BF0CBE0C0310BC0BB82B0130F70703189D
:1007C000052CF81BEA2BC00DFA0DF90DF80DF703F7
:1007D0000319052CC01FFB2BFA0A031DFB2BF90A7A
:1007E000031DFB2BF80A031DFB2BF80CF90CFA0C6C
:1007F000F70A0319052C3508BD003908BD06BD1FD1
:10080000032CF817092CF813092CF701F801F9014A
:10081000FA01080080308318AD06B201B30129083F
:10082000B1002D08B10628080319FA2CB000F70012
:100830002C080319032DB00203199F2C031C5D2CF7
:100840002D08B600B6172E08B5002F08B400B30166
:100850000310B60CB50CB40CB30CB00B272CB11FA5
:10086000342C3214172D3210301032162B308400F5
:1008700083132C2D3212B11B472C301C522CB60C7A
:10088000B50CB40CB30CF70A0319122D522CB61B7D
:10089000552C0310B30DB40DB50DB60DF7030319A8
:1008A000122D472C3217BF2C32132908B100B11F6B
:1008B0005B2CB6170B2DB6130B2D2C08B000F700D0
:1008C0002808B0022908B600B6172A08B5002B0878
:1008D000B400B3010310B60CB50CB40CB30CB00BE0
:1008E000692CB11F762CB214172DB2103010B2162D
:1008F0002F30840083132C2DB212B11B892C301C95
:10090000942CB60CB50CB40CB30CF70A0319122DC9
:10091000942CB61B972C0310B30DB40DB50DB60D6A
:10092000F7030319122D892CB217BF2CB2132D080F
:10093000B100B11F9D2CB6170B2DB6130B2D2D0832
:10094000B600B6172E08B5002F08B400B11FAC2CA6
:10095000B6133215172D3211B30130102B3084002D
:1009600083132C2DB11BD52C2908B100301CBF2CB2
:10097000B60CB50CB40CB30CF70A0319122DB31F47
:10098000D02CB40A031DD02CB50A031DD02CB60AF6
:10099000031DD02CB60CB50CB40CF70A0319122D9C
:1009A000321B542CB21B962CF42C8030B606B61F8A
:1009B000DD2C172D2D08B100EA2C2908B100B6084E
:1009C000031DEA2CB508031DEA2CB408031DEA2C0C
:1009D000F7010B2DB61BF42C0310B30DB40DB50DA0
:1009E000B60DF70BEA2C122DB11FF82CB6170B2DF4
:1009F000B6130B2D2C08F7002D08B6002E08B500F5
:100A00002F08B4000B2D2808F7002908B6002A0883
:100A1000B5002B08B4003608F8003508F900340892
:100A2000FA004A2DF701F801F901FA014A2DB30144
:100A3000B409B509B609B309B30A031D252DB40AD3
:100A4000031D252DB50A0319B60A3218332CB21826
:100A5000752C3219AB2CDA2C0008B407031C362D88
:100A6000B50A031D362DB60A031930148403000895
:100A7000B507031C3E2DB60A031930148403000881
:100A8000801F803AB60703183014321A3A2CB21A73
:100A90007C2CB22C0800201620088316870000004A
:100AA0008312A01520088316870000008312871D7B
:100AB000572D07122012200883168700000083128A
:100AC0008711A01120088316870080308312A800A8
:100AD0003120E330A800312020122008831687003F
:100AE00000008312A0152008831687008312871D3B
:100AF000772D00007B2D000020162008831687002C
:100B0000000064308312A8001D21201620088316DF
:100B1000870000008312A0152008831687000000BC
:100B20008312071220122008831687000000831208
:100B30008711A01120088316870081308312A80036
:100B400031200130F70031217808A3000130F7008F
:100B500031217808A400F70131217808A50020127E
:100B600020088316870000008312A0152008831632
:100B700087008312871DBA2D0000BE2D00002016AD
:100B800020088316870000008312A40CA40C3F30B9
:100B9000A405A9012308A800A900A801240EF700B4
:100BA000F030F70577082807A6002908A7000318E2
:100BB000A70A2708A9002608A800AE227708A800DF
:100BC0007808A9007908AA007A08AB00AF00790874
:100BD000AE007808AD007708AC00B301FF30B2007A
:100BE0007F30B1008E30B000CB225230B700B83029
:100BF000B6002F30B5008630B4007A08BB00790803
:100C0000BA007808B9007708B800952383106630D9
:100C1000AB00AA00BB30A9008430A8007A08AF005E
:100C20007908AE007808AD007708AC000A248A1570
:100C30000A12C528F701F801F901FA01BC01BD014A
:100C4000BE01BF013B083A04390438040319582E89
:100C50002030C0000310B40DB50DB60DB70DBC0D9E
:100C6000BD0DBE0DBF0D3B083F02031D412E3A08CE
:100C70003E02031D412E39083D02031D412E380856
:100C80003C02031C522E3808BC023908031C390FE1
:100C9000BD023A08031C3A0FBE023B08031C3B0F7F
:100CA000BF020314F70DF80DF90DFA0DC00B2A2E33
:100CB0003C308400831308000408AC002B08AE000D
:100CC00003197B2E2A08B7002908B6002808B500AA
:100CD0002708B400BB01BA012030B9008230B80047
:100CE00095237A08AA007908A9007808A80077084F
:100CF000A700AE0B622E2A08B7002908B600280804
:100D0000B5002708B4003408B63CB400FA01350831
:100D1000B800B5170310B50CB60CB70CFA0CF90CEB
:100D2000F80CF70CB40B8A2EB81FA12EF709F8099E
:100D3000F909FA09F70A0319F80A0319F90A031954
:100D4000FA0A7A08AA007908A9007808A8007708A2
:100D5000A700AA1FB82EAC03AC16A709A809A909B9
:100D6000AA09A70A0319A80A0319A90A0319AA0AB2
:100D70003B30B3009A30B200CA30B100B0010A3043
:100D8000AE002B080319AC0A2A08B7002908B600E0
:100D90002808B5002708B4003308BB003208BA00A1
:100DA0003108B9003008B8001A260008A700840AE4
:100DB0000008A800840A0008A900840A0008AA0004
:100DC000FD308407F708031DF82E2B0A2E020319A5
:100DD000F82E2C080319FA2E0F392E020319F22EC1
:100DE00003182A2FAC1B2A2F2C1BFA2E2030262F5B
:100DF0002030AC05AC1E082FAC122B08031DAC0331
:100E00007708AC002D30B400B3202C08F700AC01FB
:100E10002B082E02031D162F7708AC002E30B400CD
:100E2000B3202C08F7002030AC0500303030AC1E69
:100E3000262FAC122B08031DAC037708AC002D3015
:100E4000B400B3202C08F700AC013030F707770866
:100E5000B400B3203308B7003208B6003108B5003B
:100E60003008B400BB01BA01B9010A30B8001A2633
:100E70007A08B3007908B2007808B1007708B000AA
:100E8000AE0BC42E08002016200883168700000031
:100E90008312A01520088316870000008312071212
:100EA0002012200883168700000083128711A011EA
:100EB00020088316870080308312A8003120E53097
:100EC000A80031206430A8001D21201620088316B8
:100ED000870000008312A0152008831687000000F9
:100EE0008312871D712F0712201220088316870096
:100EF000000083128711A01120088316870081301B
:100F00008312A80031200130F70031217808A300B6
:100F10000130F70031217808A400F7013121780869
:100F2000A500201220088316870000008312A01558
:100F30002008831687008312871D9C2F0000A02F96
:100F40000000201620088316870000008312A40CDE
:100F5000A40C3F30A405A9012308A800A900A801FA
:100F6000240EF700F030F70577082807A6002908B7
:100F7000A7000318A70A2708A9002608A800AE2280
:100F80007708A8007808A9007908AA007A08AB00B9
:100F9000AF007908AE007808AD007708AC00B30167
:100FA000FF30B2007F30B1008E30B000CB22B701ED
:100FB000B6017A30B5008530B4007A08BB007908F4
:100FC000BA007808B9007708B80095238310AB0100
:100FD000AA01C030A9008130A8007A08AF007908C2
:100FE000AE007808AD007708AC000A248A150A1212
:020FF0000329D3
:10003000E136703665100D050000D4326D38653933
:10004000613A753965102024F5366932693AF92D1F
:10005000A5125D10A0060A000830F8000000871104
:10006000A01120088316870000008312B00D07122C
:10007000031C40282016200883168700442883127A
:10008000201220088316870000008312A015200884
:10009000831687008312871D4B28F80B2E2800003B
:1000A0008711A011200883168700000083122016F4
:1000B000200883168700000000008312A015200886
:1000C000831687008312871D6328F8010000071A32
:1000D00078148711A0112008831687008312071255
:1000E000201220088316870083120800201620089B
:1000F0008316870000008312A0152008831687004E
:1001000000008312071220122008831687000000C7
:1001100083128711A0112008831687008030831274
:10012000B0002C20FE30B0002C20201220088316B6
:10013000870000008312A015200883168700831211
:10014000871DA0280000A428000020162008831680
:100150008700000083128A150A126A28A01320085B
:1001600083168700831287130830F800B728000031
:10017000F817C828F813B90C03188717031C87133E
:100180007817C8287813F80BBB28C62800008717F3
:100190003F308400840BCA280000F81BBA28781B63
:1001A000C2280800831603178C170C1400000000E7
:1001B00083120C087F39031916290313AB000317A8
:1001C0000D080313AC0003170F080313AD002B0831
:1001D000B900AE202C0803178D0003132D08031758
:1001E0008F0083168C170C140000000083120C0D76
:1001F0000E0D7F39031916290313AB0003170D08E1
:100200000313AC0003170F080313AD002B08B9004C
:10021000AE202C0803178D0003132D0803178F0041
:100220008D0A03198F0A0313D228031703138A15A3
:100230000A127328831603178C170C140000000091
:100240000318492983120C087F390313AC000317E4
:100250000D080313AD0003170F080313AE002C089D
:10026000B900AE202D0803178D0003132E080317C5
:100270008F0083168C170C140000000083120313E8
:10028000AB0B43294629831603174929682983168E
:10029000031783120C0D0E0D7F390313AC000317E7
:1002A0000D080313AD0003170F080313AE002C084D
:1002B000B900AE202D0803178D0003132E08031775
:1002C0008F008D0A03198F0A03100313AB0B1A2931
:1002D0000800303084008313000803197C290230A1
:1002E000F800F701F70B7229F80B71299730F70026
:1002F000F70B7829800B6F2908000830B1007708C8
:10030000B200201620088316870000008312A01573
:100310002008831687008312871D8C29071A03146F
:10032000071E0310F80D0000A01120088316870097
:1003300083128711B10B81292016200883168700AC
:1003400000008312071232080319AB29201220087B
:100350008316870083120000A015200883168700EB
:100360008312871DB12900008711A0112008831670
:1003700087000000831207122012200883168700CE
:10038000831208008E30F7003108F8003008F900B9
:10039000FA01F808031DD6297908F800F901083098
:1003A000F702F808031DD629F701DE290310F81B10
:1003B000DD29F90DF80DF703D629F81308003408E4
:1003C0000319A42AC00038080319A42AC002031C78
:1003D000EE297F30C0070318A42AF4298130C00217
:1003E000031CA42A0319A42A4008F700F801F90104
:1003F000FA01BF013508BE00BE173608BD00370838
:10040000BC001930C0003B08BC020318172A013099
:10041000BD020318172ABE020318172ABF020318C9
:10042000172ABF0ABE0ABD0A3B08BC07492A3A0878
:10043000BD020318322A0130BE020318322ABF025D
:100440000318322ABF0ABE0A3A08BD073B08BC0798
:10045000031C492ABD0A031D492ABE0A031D492A55
:10046000BF0A492A39088038BE020318482A0130D9
:10047000BF020318482ABF0A39088038BE073A0865
:10048000BD07031C262ABE0A031D262ABF0A262AE8
:100490007A14C00B4C2A572A0310BC0DBD0DBE0D9B
:1004A000BF0D0310FA0DF90DF80DC10D032A411C03
:1004B0005F2A0310F80CF90CFA0CC10C622AF7033E
:1004C0000319A42AC11B8B2A0310BC0DBD0DBE0D40
:1004D000BF0D3B08BC020318772A0130BD02031888
:1004E000772ABE020318772ABF02031C9A2A3A0809
:1004F000BD020318822A0130BE020318822ABF02FD
:10050000031C9A2A39088038BE0203188B2A01304E
:10051000BF02031C9A2AFA0A031D9A2AF90A031D2C
:100520009A2AF80A031D9A2AF70A0319A42AF80C32
:10053000F90CFA0C3508C0003908C006C01FA22A01
:10054000F817A82AF813A82AF701F801F901FA0107
:10055000080039080319192BC1003D080319192B8C
:10056000C1070318BA2A7F30C102031C192B0319D3
:10057000192BBE2A8130C1070318192B4108F70037
:10058000F801F901FA013A08C500C5173B08C40093
:100590003C08C3001830C100C201431CE72A4008D0
:1005A000FA07031CD92AF90A031DD92AF80A0319E4
:1005B000C2173F08F907031CE02AF80A0319C217FB
:1005C0003E08BB00BB173B08F8070318C217C20D53
:1005D000F80CF90CFA0CC50CC40CC30C0310C10BBD
:1005E000CC2A0130F7070318192BF81BFE2AC50D7A
:1005F000FA0DF90DF80DF7030319192BC51F0F2B71
:10060000FA0A031D0F2BF90A031D0F2BF80A031D0D
:100610000F2BF80CF90CFA0CF70A0319192B3A08EE
:10062000C2003E08C206C21F172BF8171D2BF81375
:100630001D2BF701F801F901FA0108008030831839
:10064000B506BA01BB013108B9003508B906300852
:1006500003190E2CB800F70034080319172CB80240
:100660000319B32B031C712B3508BE00BE173608C7
:10067000BD003708BC00BB010310BE0CBD0CBC0C98
:10068000BB0CB80B3B2BB91F482B3A142B2C3A1040
:1006900038103A16333084008313402C3A12B91BB9
:1006A0005B2B381C662BBE0CBD0CBC0CBB0CF70ABC
:1006B0000319262C662BBE1B692B0310BB0DBC0D2A
:1006C000BD0DBE0DF7030319262C5B2B3A17D32B58
:1006D0003A133108B900B91F6F2BBE171F2CBE1378
:1006E0001F2C3408B800F7003008B8023108BE00EB
:1006F000BE173208BD003308BC00BB010310BE0C9E
:10070000BD0CBC0CBB0CB80B7D2BB91F8A2BBA14CB
:100710002B2CBA103810BA16373084008313402CB3
:10072000BA12B91B9D2B381CA82BBE0CBD0CBC0CDF
:10073000BB0CF70A0319262CA82BBE1BAB2B0310EE
:10074000BB0DBC0DBD0DBE0DF7030319262C9D2B53
:10075000BA17D32BBA133508B900B91FB12BBE177E
:100760001F2CBE131F2C3508BE00BE173608BD0057
:100770003708BC00B91FC02BBE133A152B2C3A11F9
:10078000BB013810333084008313402CB91BE92B94
:100790003108B900381CD32BBE0CBD0CBC0CBB0CF3
:1007A000F70A0319262CBB1FE42BBC0A031DE42BFC
:1007B000BD0A031DE42BBE0A031DE42BBE0CBD0CB9
:1007C000BC0CF70A0319262C3A1B682BBA1BAA2B60
:1007D000082C8030BE06BE1FF12B2B2C3508B9002B
:1007E000FE2B3108B900BE08031DFE2BBD08031DFA
:1007F000FE2BBC08031DFE2BF7011F2CBE1B082C73
:100800000310BB0DBC0DBD0DBE0DF70BFE2B262C32
:10081000B91F0C2CBE171F2CBE131F2C3408F70059
:100820003508BE003608BD003708BC001F2C300854
:10083000F7003108BE003208BD003308BC003E0896
:10084000F8003D08F9003C08FA005E2CF701F801B9
:10085000F901FA015E2CBB01BC09BD09BE09BB0947
:10086000BB0A031D392CBC0A031D392CBD0A031910
:10087000BE0A3A18472BBA18892B3A19BF2BEE2B10
:100880000008BC07031C4A2CBD0A031D4A2CBE0AE3
:100890000319381484030008BD07031C522CBE0A38
:1008A0000319381484030008801F803ABE07031818
:1008B00038143A1A4E2BBA1A902BC62B0800201661
:1008C00020088316870000008312A01520088316D5
:1008D000870000008312871D6B2C0712201220084E
:1008E00083168700000083128711A0112008831649
:1008F000870080308312B0002C20E330B0002C2021
:10090000201220088316870000008312A0152008FB
:10091000831687008312871D8B2C00008F2C00000C
:100920002016200883168700000064308312B00070
:100930006921201620088316870000008312A01565
:100940002008831687000000831207122012200857
:1009500083168700000083128711A01120088316D8
:10096000870081308312B0002C200130F7007D21F8
:100970007808AB000130F7007D217808AC00F70162
:100980007D217808AD002012200883168700000022
:100990008312A0152008831687008312871DCE2C92
:1009A0000000D22C000020162008831687000000CB
:1009B0008312AC0CAC0C3F30AC05B1012B08B0007D
:1009C000B100B0012C0EF700F030F70577083007C2
:1009D000AE003108AF000318AF0A2F08B1002E088F
:1009E000B000C2217708B0007808B1007908B200E1
:1009F0007A08B300B7007908B6007808B500770820
:100A0000B400BB01FF30BA007F30B9008E30B800AF
:100A1000DF215230BC00B830BB002F30BA00863026
:100A2000B9007A08C0007908BF007808BE007708CE
:100A3000BD00A92283106630B300B200BB30B10004
:100A40008430B0007A08B7007908B6007808B5009D
:100A50007708B4001E238A150A12A8282016200839
:100A60008316870000008312A015200883168700D4
:100A7000000083120712201220088316870000004E
:100A800083128711A01120088316870080308312FB
:100A9000B0002C20E530B0002C206430B00069217B
:100AA000201620088316870000008312A015200856
:100AB0008316870000008312871D5C2D0712201209
:100AC000200883168700000083128711A0112008D8
:100AD0008316870081308312B0002C200130F7008C
:100AE0007D217808AB000130F7007D217808AC004B
:100AF000F7017D217808AD002012200883168700B9
:100B000000008312A0152008831687008312871D1A
:100B1000872D00008B2D00002016200883168700EB
:100B200000008312AC0CAC0C3F30AC05B1012B08BB
:100B3000B000B100B0012C0EF700F030F7057708D7
:100B40003007AE003108AF000318AF0A2F08B1001C
:100B50002E08B000C2217708B0007808B1007908EB
:100B6000B2007A08B300B7007908B6007808B5007B
:100B70007708B400BB01FF30BA007F30B9008E3077
:100B8000B800DF21BC01BB017A30BA008530B90062
:100B90007A08C0007908BF007808BE007708BD0059
:100BA000A9228310B301B201C030B1008130B0007E
:100BB0007A08B7007908B6007808B5007708B4005D
:100BC0001E238A150A12B3282016200883168700D0
:100BD00000008312A01520088316870000008312EE
:100BE0000712201220088316870000008312871145
:100BF000A01120088316870080308312B0002C20BB
:100C0000E730B0002C202016200883168700000053
:100C10008312A01520088316870000008312871D09
:100C20000F2E07122012200883168700000083125F
:100C30008711A01120088316870081308312B0002D
:100C40002C20F7017D217808AC002C083A392B04C0
:100C5000AC00201620088316870000008312A01520
:100C600020088316870000008312871D352E071287
:100C70002012200883168700000083128711A0111C
:100C800020088316870080308312B0002C20E630C5
:100C9000B0002C202C08B0002C2020122008831635
:100CA000870000008312A015200883168700831296
:100CB000871D582E00005C2E000020162008831689
:100CC000870000000A308312B00069212016200836
:100CD0008316870000008312A01520088316870062
:100CE00000008312071220122008831687000000DC
:100CF00083128711A0112008831687008030831289
:100D0000B0002C20E730B0002C20201620088316DD
:100D1000870000008312A0152008831687000000BA
:100D20008312871D912E0712201220088316870038
:100D3000000083128711A0112008831687008130DC
:100D40008312B0002C20F7017D217808AC002C081C
:100D5000F8008A150A12C028F701F801F901FA0112
:100D6000C101C201C301C40140083F043E043D0467
:100D70000319EA2E2030C5000310B90DBA0DBB0DC2
:100D8000BC0DC10DC20DC30DC40D40084402031DAE
:100D9000D32E3F084302031DD32E3E084202031DFB
:100DA000D32E3D084102031CE42E3D08C1023E083B
:100DB000031C3E0FC2023F08031C3F0FC302400842
:100DC000031C400FC4020314F70DF80DF90DFA0DC2
:100DD000C50BBC2E41308400831308000408B10009
:100DE0003008B30003190D2F2F08BC002E08BB00DC
:100DF0002D08BA002C08B900C001BF012030BE0088
:100E00008230BD00A9227A08AF007908AE007808C8
:100E1000AD007708AC00B30BF42E2F08BC002E08F1
:100E2000BB002D08BA002C08B9003908B63CB9003F
:100E3000FA013A08BD00BA170310BA0CBB0CBC0C7F
:100E4000FA0CF90CF80CF70CB90B1C2FBD1F332F43
:100E5000F709F809F909FA09F70A0319F80A031951
:100E6000F90A0319FA0A7A08AF007908AE0078087F
:100E7000AD007708AC00AF1F4A2FB103B116AC0923
:100E8000AD09AE09AF09AC0A0319AD0A0319AE0AE0
:100E90000319AF0A3B30B8009A30B700CA30B60029
:100EA000B5010A30B30030080319B10A2F08BC009D
:100EB0002E08BB002D08BA002C08B9003808C00065
:100EC0003708BF003608BE003508BD00AC26000854
:100ED000AC00840A0008AD00840A0008AE00840A51
:100EE0000008AF00FD308407F708031D8A2F300A81
:100EF000330203198A2F310803198C2F0F3933025B
:100F00000319842F0318BC2FB11BBC2F311B8C2F4E
:100F10002030B82F2030B105B11E9A2FB112300801
:100F2000031DB1037708B1002D30B900AE203108A0
:100F3000F700B10130083302031DA82F7708B10074
:100F40002E30B900AE203108F7002030B105003056
:100F50003030B11EB82FB1123008031DB10377082D
:100F6000B1002D30B900AE203108F700B1013030AA
:100F7000F7077708B900AE203808BC003708BB0077
:100F80003608BA003508B900C001BF01BE010A30F9
:100F9000BD00AC267A08B8007908B7007808B6001A
:100FA0007708B500B30B562F0800AD1BE72F0F30A5
:100FB000F7002C0EF7050A3077020318E22F3030C5
:100FC000F707E42F2D08F7077708B900AE200F3098
:100FD000AC050A302C020318EF2F3030F12FAD137F
:0C0FE0002D08AC072C08B900AE2008005A
:10100000840183131F308305713083168F000F080E
:10101000861383128617831603170908C0398900BF
:1010200003131F129F1200300317880083128701D9
:1010300088018901FF300313A000A1018316031763
:101040000908C039890003131F129F1200300317CB
:101050008800831203131F139F1383169F13831299
:101060001F149412A01220088316870083122016E2
:101070002008831687008312A0112008831687009A
:101080000130831294000030831694000108C739A0
:1010900008388100831290010030F800920000307F
:1010A000831692008312201520088316870083126E
:1010B000970183169B019C0101309D008312031749
:1010C0008701880189018A1103137B288A1504305E
:1010D00003178D0000308F008A110313D5288A155D
:1010E0000230A300FA30A8008A111D218A15A30B33
:1010F00072282108093C031C7F28A201852804309E
:10110000A2002108143C031CA1012208A3008A119B
:1011100076298A157808A3001D3003178D0000304A
:101120008F00031007300313A7008A113E228A158F
:101130002308A4003730A5008A118D228A1520309B
:10114000B4008A11B3208A152208A4003730A50004
:101150008A118D228A152030B4008A11B3208A1595
:101160000D30B4008A11B3208A150A30B4008A11F8
:10117000B3208A150230A300FA30A8008A111D217D
:101180008A15A30BBC288A114B2D8A157708A3005A
:101190007808A4007908A5007A08A600253003176E
:1011A0008D0000308F00031006300313A7008A1152
:1011B0003E228A15893084002608AA002508A90045
:1011C0002408A8002308A7000230AB008A115C267F
:1011D0008A152030B4008A11B3208A150D30B4006E
:1011E0008A11B3208A150A30B4008A11B3208A15F7
:1011F0000230A300FA30A8008A111D218A15A30B22
:10120000FA288A11432F8A157708A3007808A400CA
:101210007908A5007A08A6002B3003178D0000304E
:101220008F00031005300313A7008A113E228A1590
:10123000893084002608AA002508A9002408A800EF
:101240002308A7000230AB008A115C268A152030E3
:10125000B4008A11B3208A150D30B4008A11B3206E
:101260008A150A30B4008A11B3208A150430A3000D
:10127000FA30A8008A111D218A15A30B3829A10A6A
:041280007928630066
:101010008312A01320088316870083128717831674
:1010200003170908C039890003131F129F120030EB
:10103000031788008312870188018901FF30031399
:10104000A000A101831603170908C0398900031302
:101050001F129F12003003178800831203131F13FF
:101060009F1383169F1383121F149412A01220083B
:1010700083168700831220162008831687008312A8
:10108000A0112008831687000130831294000030DD
:10109000831694000108C739083881008312900133
:1010A0000030F80092000030831692008312201561
:1010B0002008831687008312970183169B019C01E9
:1010C00001309D00831203178701880189018A116D
:1010D000031376288A15043003178D0000308F0023
:1010E0008A110313D2288A151D3003178D00003092
:1010F0008F00031016300313AB008A111A218A15D2
:101100002530B9008A11AE208A15293003178D00C9
:1011100000308F00031005300313AB008A111A2131
:101120008A150230AB00FA30B0008A1169218A15A5
:10113000AB0B93282108633C031CA028A201A6281E
:101140000430A2002108783C031CA1018A115F2C05
:101150008A157A08A6007908A5007808A4007708FF
:10116000A3008A112E2D8A157A08AA007908A900F1
:101170007808A8007708A7002208AB008A11E42DA0
:101180008A157808AB00893084002608AF0025084E
:10119000AE002408AD002308AC000230B0008A1174
:1011A000EE268A152030B9008A11AE208A158930C2
:1011B00084002A08AF002908AE002808AD002708DF
:1011C000AC000230B0008A11EE268A152030B9003A
:1011D0008A11AE208A152B08AC003730AD008A1179
:1011E000D5278A152030B9008A11AE208A15220829
:1011F000AC003730AD008A11D5278A152030B900F0
:101200008A11AE208A150D30B9008A11AE208A15D8
:101210000A30B9008A11AE208A15A10A0430AB0049
:10122000FA30B0008A1169218A15AB0B10299A286F
:02123000630059
:04400E00F42CFF3F50
:00000001FF
;PIC16F887
;CRC=7EA8 CREATED="14-IV-13 13:00"
;CRC=38BC CREATED="15-V-13 22:58"
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.lst
1,11 → 1,11
CCS PCM C Compiler, Version 4.106, 47914 14-IV-13 13:00
CCS PCM C Compiler, Version 4.106, 47914 15-V-13 22:58
 
Filename: D:\MLAB\Modules\Sensors\SHT25V01A\SW\PIC16F887\main.lst
Filename: Z:\home\kaklik\svnMLAB\Modules\Sensors\SHT25V01A\SW\PIC16F887\main.lst
 
ROM used: 2363 words (29%)
ROM used: 2319 words (28%)
Largest free fragment is 2048
RAM used: 12 (3%) at main() level
38 (10%) worst case
RAM used: 17 (5%) at main() level
43 (12%) worst case
Stack: 2 locations
 
*
41,209 → 41,211
....................
.................... #use delay(clock=8000000)
*
011D: MOVLW 28
011E: MOVWF 04
011F: BCF 03.7
0120: MOVF 00,W
0121: BTFSC 03.2
0122: GOTO 130
0123: MOVLW 02
0124: MOVWF 78
0125: CLRF 77
0126: DECFSZ 77,F
0127: GOTO 126
0128: DECFSZ 78,F
0129: GOTO 125
012A: MOVLW 97
012B: MOVWF 77
012C: DECFSZ 77,F
012D: GOTO 12C
012E: DECFSZ 00,F
012F: GOTO 123
0130: RETURN
0169: MOVLW 30
016A: MOVWF 04
016B: BCF 03.7
016C: MOVF 00,W
016D: BTFSC 03.2
016E: GOTO 17C
016F: MOVLW 02
0170: MOVWF 78
0171: CLRF 77
0172: DECFSZ 77,F
0173: GOTO 172
0174: DECFSZ 78,F
0175: GOTO 171
0176: MOVLW 97
0177: MOVWF 77
0178: DECFSZ 77,F
0179: GOTO 178
017A: DECFSZ 00,F
017B: GOTO 16F
017C: RETURN
....................
.................... #use i2c(master, sda=PIN_C4, scl=PIN_C3)
*
0031: MOVLW 08
0032: MOVWF 78
0033: NOP
0034: BCF 07.3
0035: BCF 20.3
0036: MOVF 20,W
0037: BSF 03.5
0038: MOVWF 07
0039: NOP
003A: BCF 03.5
003B: RLF 28,F
003C: BCF 07.4
003D: BTFSS 03.0
003E: GOTO 045
003F: BSF 20.4
0040: MOVF 20,W
0041: BSF 03.5
0042: MOVWF 07
0043: GOTO 049
0044: BCF 03.5
0045: BCF 20.4
0046: MOVF 20,W
0047: BSF 03.5
0048: MOVWF 07
0049: NOP
002C: MOVLW 08
002D: MOVWF 78
002E: NOP
002F: BCF 07.3
0030: BCF 20.3
0031: MOVF 20,W
0032: BSF 03.5
0033: MOVWF 07
0034: NOP
0035: BCF 03.5
0036: RLF 30,F
0037: BCF 07.4
0038: BTFSS 03.0
0039: GOTO 040
003A: BSF 20.4
003B: MOVF 20,W
003C: BSF 03.5
003D: MOVWF 07
003E: GOTO 044
003F: BCF 03.5
0040: BCF 20.4
0041: MOVF 20,W
0042: BSF 03.5
0043: MOVWF 07
0044: NOP
0045: BCF 03.5
0046: BSF 20.3
0047: MOVF 20,W
0048: BSF 03.5
0049: MOVWF 07
004A: BCF 03.5
004B: BSF 20.3
004C: MOVF 20,W
004D: BSF 03.5
004E: MOVWF 07
004F: BCF 03.5
0050: BTFSS 07.3
0051: GOTO 050
0052: DECFSZ 78,F
0053: GOTO 033
0054: NOP
0055: BCF 07.3
0056: BCF 20.3
0057: MOVF 20,W
0058: BSF 03.5
0059: MOVWF 07
005A: NOP
005B: BCF 03.5
005C: BSF 20.4
005D: MOVF 20,W
005E: BSF 03.5
005F: MOVWF 07
0060: NOP
0061: NOP
004B: BTFSS 07.3
004C: GOTO 04B
004D: DECFSZ 78,F
004E: GOTO 02E
004F: NOP
0050: BCF 07.3
0051: BCF 20.3
0052: MOVF 20,W
0053: BSF 03.5
0054: MOVWF 07
0055: NOP
0056: BCF 03.5
0057: BSF 20.4
0058: MOVF 20,W
0059: BSF 03.5
005A: MOVWF 07
005B: NOP
005C: NOP
005D: BCF 03.5
005E: BSF 20.3
005F: MOVF 20,W
0060: BSF 03.5
0061: MOVWF 07
0062: BCF 03.5
0063: BSF 20.3
0064: MOVF 20,W
0065: BSF 03.5
0066: MOVWF 07
0067: BCF 03.5
0068: BTFSS 07.3
0069: GOTO 068
006A: CLRF 78
006B: NOP
006C: BTFSC 07.4
006D: BSF 78.0
006E: BCF 07.3
006F: BCF 20.3
0070: MOVF 20,W
0071: BSF 03.5
0072: MOVWF 07
0073: BCF 03.5
0074: BCF 07.4
0075: BCF 20.4
0076: MOVF 20,W
0077: BSF 03.5
0078: MOVWF 07
0079: BCF 03.5
007A: RETURN
0063: BTFSS 07.3
0064: GOTO 063
0065: CLRF 78
0066: NOP
0067: BTFSC 07.4
0068: BSF 78.0
0069: BCF 07.3
006A: BCF 20.3
006B: MOVF 20,W
006C: BSF 03.5
006D: MOVWF 07
006E: BCF 03.5
006F: BCF 07.4
0070: BCF 20.4
0071: MOVF 20,W
0072: BSF 03.5
0073: MOVWF 07
0074: BCF 03.5
0075: RETURN
*
0131: MOVLW 08
0132: MOVWF 29
0133: MOVF 77,W
0134: MOVWF 2A
0135: BSF 20.4
0136: MOVF 20,W
0137: BSF 03.5
0138: MOVWF 07
0139: NOP
013A: BCF 03.5
013B: BSF 20.3
013C: MOVF 20,W
013D: BSF 03.5
013E: MOVWF 07
013F: BCF 03.5
0140: BTFSS 07.3
0141: GOTO 140
0142: BTFSC 07.4
0143: BSF 03.0
0144: BTFSS 07.4
0145: BCF 03.0
0146: RLF 78,F
0147: NOP
0148: BCF 20.3
0149: MOVF 20,W
014A: BSF 03.5
014B: MOVWF 07
014C: BCF 03.5
014D: BCF 07.3
014E: DECFSZ 29,F
014F: GOTO 135
0150: BSF 20.4
0151: MOVF 20,W
0152: BSF 03.5
0153: MOVWF 07
0154: NOP
0155: BCF 03.5
0156: BCF 07.4
0157: MOVF 2A,W
0158: BTFSC 03.2
0159: GOTO 15F
015A: BCF 20.4
015B: MOVF 20,W
015C: BSF 03.5
015D: MOVWF 07
015E: BCF 03.5
015F: NOP
0160: BSF 20.3
0161: MOVF 20,W
0162: BSF 03.5
0163: MOVWF 07
0164: BCF 03.5
0165: BTFSS 07.3
0166: GOTO 165
0167: NOP
0168: BCF 07.3
0169: BCF 20.3
016A: MOVF 20,W
016B: BSF 03.5
016C: MOVWF 07
016D: NOP
016E: BCF 03.5
016F: BCF 07.4
0170: BCF 20.4
0171: MOVF 20,W
0172: BSF 03.5
0173: MOVWF 07
0174: BCF 03.5
0175: RETURN
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8) //rcv TXD xmit RXD
017D: MOVLW 08
017E: MOVWF 31
017F: MOVF 77,W
0180: MOVWF 32
0181: BSF 20.4
0182: MOVF 20,W
0183: BSF 03.5
0184: MOVWF 07
0185: NOP
0186: BCF 03.5
0187: BSF 20.3
0188: MOVF 20,W
0189: BSF 03.5
018A: MOVWF 07
018B: BCF 03.5
018C: BTFSS 07.3
018D: GOTO 18C
018E: BTFSC 07.4
018F: BSF 03.0
0190: BTFSS 07.4
0191: BCF 03.0
0192: RLF 78,F
0193: NOP
0194: BCF 20.3
0195: MOVF 20,W
0196: BSF 03.5
0197: MOVWF 07
0198: BCF 03.5
0199: BCF 07.3
019A: DECFSZ 31,F
019B: GOTO 181
019C: BSF 20.4
019D: MOVF 20,W
019E: BSF 03.5
019F: MOVWF 07
01A0: NOP
01A1: BCF 03.5
01A2: BCF 07.4
01A3: MOVF 32,W
01A4: BTFSC 03.2
01A5: GOTO 1AB
01A6: BCF 20.4
01A7: MOVF 20,W
01A8: BSF 03.5
01A9: MOVWF 07
01AA: BCF 03.5
01AB: NOP
01AC: BSF 20.3
01AD: MOVF 20,W
01AE: BSF 03.5
01AF: MOVWF 07
01B0: BCF 03.5
01B1: BTFSS 07.3
01B2: GOTO 1B1
01B3: NOP
01B4: BCF 07.3
01B5: BCF 20.3
01B6: MOVF 20,W
01B7: BSF 03.5
01B8: MOVWF 07
01B9: NOP
01BA: BCF 03.5
01BB: BCF 07.4
01BC: BCF 20.4
01BD: MOVF 20,W
01BE: BSF 03.5
01BF: MOVWF 07
01C0: BCF 03.5
01C1: RETURN
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD
*
00B3: BSF 03.5
00B4: BCF 06.7
00B5: BCF 03.5
00B6: BCF 06.7
00B7: MOVLW 08
00B8: MOVWF 78
00B9: GOTO 0BA
00BA: NOP
00BB: BSF 78.7
00BC: GOTO 0CB
00BD: BCF 78.7
00BE: RRF 34,F
00BF: BTFSC 03.0
00C0: BSF 06.7
00C1: BTFSS 03.0
00C2: BCF 06.7
00C3: BSF 78.6
00C4: GOTO 0CB
00C5: BCF 78.6
00C6: DECFSZ 78,F
00C7: GOTO 0BE
00C8: GOTO 0C9
00C9: NOP
00CA: BSF 06.7
00CB: MOVLW 3F
00CC: MOVWF 04
00CD: DECFSZ 04,F
00CE: GOTO 0CD
00CF: NOP
00D0: BTFSC 78.7
00D1: GOTO 0BD
00D2: BTFSC 78.6
00D3: GOTO 0C5
00D4: RETURN
00AE: BCF 20.7
00AF: MOVF 20,W
00B0: BSF 03.5
00B1: MOVWF 07
00B2: BCF 03.5
00B3: BCF 07.7
00B4: MOVLW 08
00B5: MOVWF 78
00B6: GOTO 0B7
00B7: NOP
00B8: BSF 78.7
00B9: GOTO 0C8
00BA: BCF 78.7
00BB: RRF 39,F
00BC: BTFSC 03.0
00BD: BSF 07.7
00BE: BTFSS 03.0
00BF: BCF 07.7
00C0: BSF 78.6
00C1: GOTO 0C8
00C2: BCF 78.6
00C3: DECFSZ 78,F
00C4: GOTO 0BB
00C5: GOTO 0C6
00C6: NOP
00C7: BSF 07.7
00C8: MOVLW 3F
00C9: MOVWF 04
00CA: DECFSZ 04,F
00CB: GOTO 0CA
00CC: NOP
00CD: BTFSC 78.7
00CE: GOTO 0BA
00CF: BTFSC 78.6
00D0: GOTO 0C2
00D1: RETURN
....................
....................
.................... #include "SHT25.h"
263,66 → 265,66
.................... {
.................... i2c_start(); // Start condition
*
007B: BSF 20.4
007C: MOVF 20,W
007D: BSF 03.5
007E: MOVWF 07
007F: NOP
0080: BCF 03.5
0081: BSF 20.3
0082: MOVF 20,W
0083: BSF 03.5
0084: MOVWF 07
0085: NOP
0086: BCF 03.5
0087: BCF 07.4
0088: BCF 20.4
0089: MOVF 20,W
008A: BSF 03.5
008B: MOVWF 07
008C: NOP
008D: BCF 03.5
008E: BCF 07.3
008F: BCF 20.3
0090: MOVF 20,W
0091: BSF 03.5
0092: MOVWF 07
0076: BSF 20.4
0077: MOVF 20,W
0078: BSF 03.5
0079: MOVWF 07
007A: NOP
007B: BCF 03.5
007C: BSF 20.3
007D: MOVF 20,W
007E: BSF 03.5
007F: MOVWF 07
0080: NOP
0081: BCF 03.5
0082: BCF 07.4
0083: BCF 20.4
0084: MOVF 20,W
0085: BSF 03.5
0086: MOVWF 07
0087: NOP
0088: BCF 03.5
0089: BCF 07.3
008A: BCF 20.3
008B: MOVF 20,W
008C: BSF 03.5
008D: MOVWF 07
.................... i2c_write(0x80); // Device address
0093: MOVLW 80
0094: BCF 03.5
0095: MOVWF 28
0096: CALL 031
008E: MOVLW 80
008F: BCF 03.5
0090: MOVWF 30
0091: CALL 02C
.................... i2c_write(0xFE); // Device command
0097: MOVLW FE
0098: MOVWF 28
0099: CALL 031
0092: MOVLW FE
0093: MOVWF 30
0094: CALL 02C
.................... i2c_stop(); // Stop condition
009A: BCF 20.4
009B: MOVF 20,W
009C: BSF 03.5
009D: MOVWF 07
009E: NOP
0095: BCF 20.4
0096: MOVF 20,W
0097: BSF 03.5
0098: MOVWF 07
0099: NOP
009A: BCF 03.5
009B: BSF 20.3
009C: MOVF 20,W
009D: BSF 03.5
009E: MOVWF 07
009F: BCF 03.5
00A0: BSF 20.3
00A1: MOVF 20,W
00A2: BSF 03.5
00A3: MOVWF 07
00A4: BCF 03.5
00A5: BTFSS 07.3
00A6: GOTO 0A5
00A7: NOP
00A8: GOTO 0A9
00A0: BTFSS 07.3
00A1: GOTO 0A0
00A2: NOP
00A3: GOTO 0A4
00A4: NOP
00A5: BSF 20.4
00A6: MOVF 20,W
00A7: BSF 03.5
00A8: MOVWF 07
00A9: NOP
00AA: BSF 20.4
00AB: MOVF 20,W
00AC: BSF 03.5
00AD: MOVWF 07
00AE: NOP
.................... }
00AF: BCF 03.5
00B0: BSF 0A.3
00B1: BCF 0A.4
00B2: GOTO 066 (RETURN)
00AA: BCF 03.5
00AB: BSF 0A.3
00AC: BCF 0A.4
00AD: GOTO 06A (RETURN)
....................
.................... unsigned int8 SHT25_setup(unsigned int8 setup_reg ) // writes to status register and returns its value
.................... {
330,233 → 332,233
....................
.................... i2c_start(); // Start condition
*
0176: BSF 20.4
0177: MOVF 20,W
0178: BSF 03.5
0179: MOVWF 07
017A: NOP
017B: BCF 03.5
017C: BSF 20.3
017D: MOVF 20,W
017E: BSF 03.5
017F: MOVWF 07
0180: NOP
0181: BCF 03.5
0182: BCF 07.4
0183: BCF 20.4
0184: MOVF 20,W
0185: BSF 03.5
0186: MOVWF 07
0187: NOP
0188: BCF 03.5
0189: BCF 07.3
018A: BCF 20.3
018B: MOVF 20,W
018C: BSF 03.5
018D: MOVWF 07
05E4: BSF 20.4
05E5: MOVF 20,W
05E6: BSF 03.5
05E7: MOVWF 07
05E8: NOP
05E9: BCF 03.5
05EA: BSF 20.3
05EB: MOVF 20,W
05EC: BSF 03.5
05ED: MOVWF 07
05EE: NOP
05EF: BCF 03.5
05F0: BCF 07.4
05F1: BCF 20.4
05F2: MOVF 20,W
05F3: BSF 03.5
05F4: MOVWF 07
05F5: NOP
05F6: BCF 03.5
05F7: BCF 07.3
05F8: BCF 20.3
05F9: MOVF 20,W
05FA: BSF 03.5
05FB: MOVWF 07
.................... i2c_write(SHT25_ADDR); // Device address
018E: MOVLW 80
018F: BCF 03.5
0190: MOVWF 28
0191: CALL 031
05FC: MOVLW 80
05FD: BCF 03.5
05FE: MOVWF 30
05FF: CALL 02C
.................... i2c_write(0xE7); // Device command
0192: MOVLW E7
0193: MOVWF 28
0194: CALL 031
0600: MOVLW E7
0601: MOVWF 30
0602: CALL 02C
....................
.................... i2c_start(); // Start condition
0195: BSF 20.4
0196: MOVF 20,W
0197: BSF 03.5
0198: MOVWF 07
0199: NOP
019A: BCF 03.5
019B: BSF 20.3
019C: MOVF 20,W
019D: BSF 03.5
019E: MOVWF 07
019F: NOP
01A0: BCF 03.5
01A1: BTFSS 07.3
01A2: GOTO 1A1
01A3: BCF 07.4
01A4: BCF 20.4
01A5: MOVF 20,W
01A6: BSF 03.5
01A7: MOVWF 07
01A8: NOP
01A9: BCF 03.5
01AA: BCF 07.3
01AB: BCF 20.3
01AC: MOVF 20,W
01AD: BSF 03.5
01AE: MOVWF 07
0603: BSF 20.4
0604: MOVF 20,W
0605: BSF 03.5
0606: MOVWF 07
0607: NOP
0608: BCF 03.5
0609: BSF 20.3
060A: MOVF 20,W
060B: BSF 03.5
060C: MOVWF 07
060D: NOP
060E: BCF 03.5
060F: BTFSS 07.3
0610: GOTO 60F
0611: BCF 07.4
0612: BCF 20.4
0613: MOVF 20,W
0614: BSF 03.5
0615: MOVWF 07
0616: NOP
0617: BCF 03.5
0618: BCF 07.3
0619: BCF 20.3
061A: MOVF 20,W
061B: BSF 03.5
061C: MOVWF 07
.................... i2c_write(SHT25_ADDR+1); // Device address
01AF: MOVLW 81
01B0: BCF 03.5
01B1: MOVWF 28
01B2: CALL 031
061D: MOVLW 81
061E: BCF 03.5
061F: MOVWF 30
0620: CALL 02C
.................... reg=i2c_read(0); // Read status actual status register
01B3: CLRF 77
01B4: CALL 131
01B5: MOVF 78,W
01B6: MOVWF 24
0621: CLRF 77
0622: CALL 17D
0623: MOVF 78,W
0624: MOVWF 2C
....................
.................... reg = (reg & 0x3A) | setup_reg;
01B7: MOVF 24,W
01B8: ANDLW 3A
01B9: IORWF 23,W
01BA: MOVWF 24
0625: MOVF 2C,W
0626: ANDLW 3A
0627: IORWF 2B,W
0628: MOVWF 2C
....................
.................... i2c_start(); // Start condition
01BB: BSF 20.4
01BC: MOVF 20,W
01BD: BSF 03.5
01BE: MOVWF 07
01BF: NOP
01C0: BCF 03.5
01C1: BSF 20.3
01C2: MOVF 20,W
01C3: BSF 03.5
01C4: MOVWF 07
01C5: NOP
01C6: BCF 03.5
01C7: BTFSS 07.3
01C8: GOTO 1C7
01C9: BCF 07.4
01CA: BCF 20.4
01CB: MOVF 20,W
01CC: BSF 03.5
01CD: MOVWF 07
01CE: NOP
01CF: BCF 03.5
01D0: BCF 07.3
01D1: BCF 20.3
01D2: MOVF 20,W
01D3: BSF 03.5
01D4: MOVWF 07
0629: BSF 20.4
062A: MOVF 20,W
062B: BSF 03.5
062C: MOVWF 07
062D: NOP
062E: BCF 03.5
062F: BSF 20.3
0630: MOVF 20,W
0631: BSF 03.5
0632: MOVWF 07
0633: NOP
0634: BCF 03.5
0635: BTFSS 07.3
0636: GOTO 635
0637: BCF 07.4
0638: BCF 20.4
0639: MOVF 20,W
063A: BSF 03.5
063B: MOVWF 07
063C: NOP
063D: BCF 03.5
063E: BCF 07.3
063F: BCF 20.3
0640: MOVF 20,W
0641: BSF 03.5
0642: MOVWF 07
.................... i2c_write(SHT25_ADDR); // Device address
01D5: MOVLW 80
01D6: BCF 03.5
01D7: MOVWF 28
01D8: CALL 031
0643: MOVLW 80
0644: BCF 03.5
0645: MOVWF 30
0646: CALL 02C
.................... i2c_write(0xE6); // Write to status register
01D9: MOVLW E6
01DA: MOVWF 28
01DB: CALL 031
0647: MOVLW E6
0648: MOVWF 30
0649: CALL 02C
.................... i2c_write(reg); // Device command
01DC: MOVF 24,W
01DD: MOVWF 28
01DE: CALL 031
064A: MOVF 2C,W
064B: MOVWF 30
064C: CALL 02C
.................... i2c_stop(); // Stop condition
01DF: BCF 20.4
01E0: MOVF 20,W
01E1: BSF 03.5
01E2: MOVWF 07
01E3: NOP
01E4: BCF 03.5
01E5: BSF 20.3
01E6: MOVF 20,W
01E7: BSF 03.5
01E8: MOVWF 07
01E9: BCF 03.5
01EA: BTFSS 07.3
01EB: GOTO 1EA
01EC: NOP
01ED: GOTO 1EE
01EE: NOP
01EF: BSF 20.4
01F0: MOVF 20,W
01F1: BSF 03.5
01F2: MOVWF 07
01F3: NOP
064D: BCF 20.4
064E: MOVF 20,W
064F: BSF 03.5
0650: MOVWF 07
0651: NOP
0652: BCF 03.5
0653: BSF 20.3
0654: MOVF 20,W
0655: BSF 03.5
0656: MOVWF 07
0657: BCF 03.5
0658: BTFSS 07.3
0659: GOTO 658
065A: NOP
065B: GOTO 65C
065C: NOP
065D: BSF 20.4
065E: MOVF 20,W
065F: BSF 03.5
0660: MOVWF 07
0661: NOP
....................
.................... delay_ms(10);
01F4: MOVLW 0A
01F5: BCF 03.5
01F6: MOVWF 28
01F7: CALL 11D
0662: MOVLW 0A
0663: BCF 03.5
0664: MOVWF 30
0665: CALL 169
....................
.................... i2c_start(); // Start condition
01F8: BSF 20.4
01F9: MOVF 20,W
01FA: BSF 03.5
01FB: MOVWF 07
01FC: NOP
01FD: BCF 03.5
01FE: BSF 20.3
01FF: MOVF 20,W
0200: BSF 03.5
0201: MOVWF 07
0202: NOP
0203: BCF 03.5
0204: BCF 07.4
0205: BCF 20.4
0206: MOVF 20,W
0207: BSF 03.5
0208: MOVWF 07
0209: NOP
020A: BCF 03.5
020B: BCF 07.3
020C: BCF 20.3
020D: MOVF 20,W
020E: BSF 03.5
020F: MOVWF 07
0666: BSF 20.4
0667: MOVF 20,W
0668: BSF 03.5
0669: MOVWF 07
066A: NOP
066B: BCF 03.5
066C: BSF 20.3
066D: MOVF 20,W
066E: BSF 03.5
066F: MOVWF 07
0670: NOP
0671: BCF 03.5
0672: BCF 07.4
0673: BCF 20.4
0674: MOVF 20,W
0675: BSF 03.5
0676: MOVWF 07
0677: NOP
0678: BCF 03.5
0679: BCF 07.3
067A: BCF 20.3
067B: MOVF 20,W
067C: BSF 03.5
067D: MOVWF 07
.................... i2c_write(SHT25_ADDR); // Device address
0210: MOVLW 80
0211: BCF 03.5
0212: MOVWF 28
0213: CALL 031
067E: MOVLW 80
067F: BCF 03.5
0680: MOVWF 30
0681: CALL 02C
.................... i2c_write(0xE7); // Device command
0214: MOVLW E7
0215: MOVWF 28
0216: CALL 031
0682: MOVLW E7
0683: MOVWF 30
0684: CALL 02C
....................
.................... i2c_start(); // Start condition
0217: BSF 20.4
0218: MOVF 20,W
0219: BSF 03.5
021A: MOVWF 07
021B: NOP
021C: BCF 03.5
021D: BSF 20.3
021E: MOVF 20,W
021F: BSF 03.5
0220: MOVWF 07
0221: NOP
0222: BCF 03.5
0223: BTFSS 07.3
0224: GOTO 223
0225: BCF 07.4
0226: BCF 20.4
0227: MOVF 20,W
0228: BSF 03.5
0229: MOVWF 07
022A: NOP
022B: BCF 03.5
022C: BCF 07.3
022D: BCF 20.3
022E: MOVF 20,W
022F: BSF 03.5
0230: MOVWF 07
0685: BSF 20.4
0686: MOVF 20,W
0687: BSF 03.5
0688: MOVWF 07
0689: NOP
068A: BCF 03.5
068B: BSF 20.3
068C: MOVF 20,W
068D: BSF 03.5
068E: MOVWF 07
068F: NOP
0690: BCF 03.5
0691: BTFSS 07.3
0692: GOTO 691
0693: BCF 07.4
0694: BCF 20.4
0695: MOVF 20,W
0696: BSF 03.5
0697: MOVWF 07
0698: NOP
0699: BCF 03.5
069A: BCF 07.3
069B: BCF 20.3
069C: MOVF 20,W
069D: BSF 03.5
069E: MOVWF 07
.................... i2c_write(SHT25_ADDR+1); // Device address
0231: MOVLW 81
0232: BCF 03.5
0233: MOVWF 28
0234: CALL 031
069F: MOVLW 81
06A0: BCF 03.5
06A1: MOVWF 30
06A2: CALL 02C
.................... reg=i2c_read(0); // Read status actual status register
0235: CLRF 77
0236: CALL 131
0237: MOVF 78,W
0238: MOVWF 24
06A3: CLRF 77
06A4: CALL 17D
06A5: MOVF 78,W
06A6: MOVWF 2C
....................
.................... return (reg);
0239: MOVF 24,W
023A: MOVWF 78
06A7: MOVF 2C,W
06A8: MOVWF 78
.................... }
023B: BSF 0A.3
023C: BCF 0A.4
023D: GOTO 089 (RETURN)
06A9: BSF 0A.3
06AA: BCF 0A.4
06AB: GOTO 0C0 (RETURN)
....................
....................
.................... float SHT25_get_temp()
566,231 → 568,231
....................
.................... i2c_start();
*
054B: BSF 20.4
054C: MOVF 20,W
054D: BSF 03.5
054E: MOVWF 07
054F: NOP
0550: BCF 03.5
0551: BSF 20.3
0552: MOVF 20,W
0553: BSF 03.5
0554: MOVWF 07
0555: NOP
0556: BCF 03.5
0557: BTFSS 07.3
0558: GOTO 557
0559: BCF 07.4
055A: BCF 20.4
055B: MOVF 20,W
055C: BSF 03.5
055D: MOVWF 07
055E: NOP
055F: BCF 03.5
0560: BCF 07.3
0561: BCF 20.3
0562: MOVF 20,W
0563: BSF 03.5
0564: MOVWF 07
045F: BSF 20.4
0460: MOVF 20,W
0461: BSF 03.5
0462: MOVWF 07
0463: NOP
0464: BCF 03.5
0465: BSF 20.3
0466: MOVF 20,W
0467: BSF 03.5
0468: MOVWF 07
0469: NOP
046A: BCF 03.5
046B: BTFSS 07.3
046C: GOTO 46B
046D: BCF 07.4
046E: BCF 20.4
046F: MOVF 20,W
0470: BSF 03.5
0471: MOVWF 07
0472: NOP
0473: BCF 03.5
0474: BCF 07.3
0475: BCF 20.3
0476: MOVF 20,W
0477: BSF 03.5
0478: MOVWF 07
.................... I2C_Write(SHT25_ADDR);
0565: MOVLW 80
0566: BCF 03.5
0567: MOVWF 28
0568: CALL 031
0479: MOVLW 80
047A: BCF 03.5
047B: MOVWF 30
047C: CALL 02C
.................... I2C_write(0xE3);
0569: MOVLW E3
056A: MOVWF 28
056B: CALL 031
047D: MOVLW E3
047E: MOVWF 30
047F: CALL 02C
.................... i2c_stop();
056C: BCF 20.4
056D: MOVF 20,W
056E: BSF 03.5
056F: MOVWF 07
0570: NOP
0571: BCF 03.5
0572: BSF 20.3
0573: MOVF 20,W
0574: BSF 03.5
0575: MOVWF 07
0576: BCF 03.5
0577: BTFSS 07.3
0578: GOTO 577
0579: NOP
057A: GOTO 57B
057B: NOP
057C: BSF 20.4
057D: MOVF 20,W
057E: BSF 03.5
057F: MOVWF 07
0580: NOP
0480: BCF 20.4
0481: MOVF 20,W
0482: BSF 03.5
0483: MOVWF 07
0484: NOP
0485: BCF 03.5
0486: BSF 20.3
0487: MOVF 20,W
0488: BSF 03.5
0489: MOVWF 07
048A: BCF 03.5
048B: BTFSS 07.3
048C: GOTO 48B
048D: NOP
048E: GOTO 48F
048F: NOP
0490: BSF 20.4
0491: MOVF 20,W
0492: BSF 03.5
0493: MOVWF 07
0494: NOP
....................
.................... delay_ms(100);
0581: MOVLW 64
0582: BCF 03.5
0583: MOVWF 28
0584: CALL 11D
0495: MOVLW 64
0496: BCF 03.5
0497: MOVWF 30
0498: CALL 169
....................
.................... i2c_start();
0585: BSF 20.4
0586: MOVF 20,W
0587: BSF 03.5
0588: MOVWF 07
0589: NOP
058A: BCF 03.5
058B: BSF 20.3
058C: MOVF 20,W
058D: BSF 03.5
058E: MOVWF 07
058F: NOP
0590: BCF 03.5
0591: BCF 07.4
0592: BCF 20.4
0593: MOVF 20,W
0594: BSF 03.5
0595: MOVWF 07
0596: NOP
0597: BCF 03.5
0598: BCF 07.3
0599: BCF 20.3
059A: MOVF 20,W
059B: BSF 03.5
059C: MOVWF 07
0499: BSF 20.4
049A: MOVF 20,W
049B: BSF 03.5
049C: MOVWF 07
049D: NOP
049E: BCF 03.5
049F: BSF 20.3
04A0: MOVF 20,W
04A1: BSF 03.5
04A2: MOVWF 07
04A3: NOP
04A4: BCF 03.5
04A5: BCF 07.4
04A6: BCF 20.4
04A7: MOVF 20,W
04A8: BSF 03.5
04A9: MOVWF 07
04AA: NOP
04AB: BCF 03.5
04AC: BCF 07.3
04AD: BCF 20.3
04AE: MOVF 20,W
04AF: BSF 03.5
04B0: MOVWF 07
.................... I2C_Write(SHT25_ADDR+1);
059D: MOVLW 81
059E: BCF 03.5
059F: MOVWF 28
05A0: CALL 031
04B1: MOVLW 81
04B2: BCF 03.5
04B3: MOVWF 30
04B4: CALL 02C
.................... MSB=i2c_read(1);
05A1: MOVLW 01
05A2: MOVWF 77
05A3: CALL 131
05A4: MOVF 78,W
05A5: MOVWF 23
04B5: MOVLW 01
04B6: MOVWF 77
04B7: CALL 17D
04B8: MOVF 78,W
04B9: MOVWF 2B
.................... LSB=i2c_read(1);
05A6: MOVLW 01
05A7: MOVWF 77
05A8: CALL 131
05A9: MOVF 78,W
05AA: MOVWF 24
04BA: MOVLW 01
04BB: MOVWF 77
04BC: CALL 17D
04BD: MOVF 78,W
04BE: MOVWF 2C
.................... Check=i2c_read(0);
05AB: CLRF 77
05AC: CALL 131
05AD: MOVF 78,W
05AE: MOVWF 25
04BF: CLRF 77
04C0: CALL 17D
04C1: MOVF 78,W
04C2: MOVWF 2D
.................... i2c_stop();
05AF: BCF 20.4
05B0: MOVF 20,W
05B1: BSF 03.5
05B2: MOVWF 07
05B3: NOP
05B4: BCF 03.5
05B5: BSF 20.3
05B6: MOVF 20,W
05B7: BSF 03.5
05B8: MOVWF 07
05B9: BCF 03.5
05BA: BTFSS 07.3
05BB: GOTO 5BA
05BC: NOP
05BD: GOTO 5BE
05BE: NOP
05BF: BSF 20.4
05C0: MOVF 20,W
05C1: BSF 03.5
05C2: MOVWF 07
05C3: NOP
04C3: BCF 20.4
04C4: MOVF 20,W
04C5: BSF 03.5
04C6: MOVWF 07
04C7: NOP
04C8: BCF 03.5
04C9: BSF 20.3
04CA: MOVF 20,W
04CB: BSF 03.5
04CC: MOVWF 07
04CD: BCF 03.5
04CE: BTFSS 07.3
04CF: GOTO 4CE
04D0: NOP
04D1: GOTO 4D2
04D2: NOP
04D3: BSF 20.4
04D4: MOVF 20,W
04D5: BSF 03.5
04D6: MOVWF 07
04D7: NOP
....................
.................... LSB = LSB >> 2; // trow out status bits
05C4: BCF 03.5
05C5: RRF 24,F
05C6: RRF 24,F
05C7: MOVLW 3F
05C8: ANDWF 24,F
04D8: BCF 03.5
04D9: RRF 2C,F
04DA: RRF 2C,F
04DB: MOVLW 3F
04DC: ANDWF 2C,F
....................
.................... data = (((unsigned int16) MSB << 8) + (LSB << 4));
05C9: CLRF 29
05CA: MOVF 23,W
05CB: MOVWF 28
05CC: MOVWF 29
05CD: CLRF 28
05CE: SWAPF 24,W
05CF: MOVWF 77
05D0: MOVLW F0
05D1: ANDWF 77,F
05D2: MOVF 77,W
05D3: ADDWF 28,W
05D4: MOVWF 26
05D5: MOVF 29,W
05D6: MOVWF 27
05D7: BTFSC 03.0
05D8: INCF 27,F
04DD: CLRF 31
04DE: MOVF 2B,W
04DF: MOVWF 30
04E0: MOVWF 31
04E1: CLRF 30
04E2: SWAPF 2C,W
04E3: MOVWF 77
04E4: MOVLW F0
04E5: ANDWF 77,F
04E6: MOVF 77,W
04E7: ADDWF 30,W
04E8: MOVWF 2E
04E9: MOVF 31,W
04EA: MOVWF 2F
04EB: BTFSC 03.0
04EC: INCF 2F,F
.................... return(-46.85 + 175.72*((float)data/0xFFFF));
05D9: MOVF 27,W
05DA: MOVWF 29
05DB: MOVF 26,W
05DC: MOVWF 28
05DD: CALL 2AE
05DE: MOVF 77,W
05DF: MOVWF 28
05E0: MOVF 78,W
05E1: MOVWF 29
05E2: MOVF 79,W
05E3: MOVWF 2A
05E4: MOVF 7A,W
05E5: MOVWF 2B
05E6: MOVWF 2F
05E7: MOVF 79,W
05E8: MOVWF 2E
05E9: MOVF 78,W
05EA: MOVWF 2D
05EB: MOVF 77,W
05EC: MOVWF 2C
05ED: CLRF 33
05EE: MOVLW FF
05EF: MOVWF 32
05F0: MOVLW 7F
05F1: MOVWF 31
05F2: MOVLW 8E
05F3: MOVWF 30
05F4: CALL 2CB
05F5: MOVLW 52
05F6: MOVWF 37
05F7: MOVLW B8
05F8: MOVWF 36
05F9: MOVLW 2F
05FA: MOVWF 35
05FB: MOVLW 86
05FC: MOVWF 34
05FD: MOVF 7A,W
05FE: MOVWF 3B
05FF: MOVF 79,W
0600: MOVWF 3A
0601: MOVF 78,W
0602: MOVWF 39
0603: MOVF 77,W
0604: MOVWF 38
0605: CALL 395
0606: BCF 03.1
0607: MOVLW 66
0608: MOVWF 2B
0609: MOVWF 2A
060A: MOVLW BB
060B: MOVWF 29
060C: MOVLW 84
060D: MOVWF 28
060E: MOVF 7A,W
060F: MOVWF 2F
0610: MOVF 79,W
0611: MOVWF 2E
0612: MOVF 78,W
0613: MOVWF 2D
0614: MOVF 77,W
0615: MOVWF 2C
0616: CALL 40A
04ED: MOVF 2F,W
04EE: MOVWF 31
04EF: MOVF 2E,W
04F0: MOVWF 30
04F1: CALL 1C2
04F2: MOVF 77,W
04F3: MOVWF 30
04F4: MOVF 78,W
04F5: MOVWF 31
04F6: MOVF 79,W
04F7: MOVWF 32
04F8: MOVF 7A,W
04F9: MOVWF 33
04FA: MOVWF 37
04FB: MOVF 79,W
04FC: MOVWF 36
04FD: MOVF 78,W
04FE: MOVWF 35
04FF: MOVF 77,W
0500: MOVWF 34
0501: CLRF 3B
0502: MOVLW FF
0503: MOVWF 3A
0504: MOVLW 7F
0505: MOVWF 39
0506: MOVLW 8E
0507: MOVWF 38
0508: CALL 1DF
0509: MOVLW 52
050A: MOVWF 3C
050B: MOVLW B8
050C: MOVWF 3B
050D: MOVLW 2F
050E: MOVWF 3A
050F: MOVLW 86
0510: MOVWF 39
0511: MOVF 7A,W
0512: MOVWF 40
0513: MOVF 79,W
0514: MOVWF 3F
0515: MOVF 78,W
0516: MOVWF 3E
0517: MOVF 77,W
0518: MOVWF 3D
0519: CALL 2A9
051A: BCF 03.1
051B: MOVLW 66
051C: MOVWF 33
051D: MOVWF 32
051E: MOVLW BB
051F: MOVWF 31
0520: MOVLW 84
0521: MOVWF 30
0522: MOVF 7A,W
0523: MOVWF 37
0524: MOVF 79,W
0525: MOVWF 36
0526: MOVF 78,W
0527: MOVWF 35
0528: MOVF 77,W
0529: MOVWF 34
052A: CALL 31E
.................... }
0617: BSF 0A.3
0618: BCF 0A.4
0619: GOTO 0C5 (RETURN)
052B: BSF 0A.3
052C: BCF 0A.4
052D: GOTO 0A8 (RETURN)
....................
.................... float SHT25_get_hum()
.................... {
798,206 → 800,205
.................... unsigned int16 data;
....................
.................... i2c_start(); //RH
*
0743: BSF 20.4
0744: MOVF 20,W
0745: BSF 03.5
0746: MOVWF 07
0747: NOP
0748: BCF 03.5
0749: BSF 20.3
074A: MOVF 20,W
074B: BSF 03.5
074C: MOVWF 07
074D: NOP
074E: BCF 03.5
074F: BCF 07.4
0750: BCF 20.4
0751: MOVF 20,W
0752: BSF 03.5
0753: MOVWF 07
0754: NOP
0755: BCF 03.5
0756: BCF 07.3
0757: BCF 20.3
0758: MOVF 20,W
0759: BSF 03.5
075A: MOVWF 07
052E: BSF 20.4
052F: MOVF 20,W
0530: BSF 03.5
0531: MOVWF 07
0532: NOP
0533: BCF 03.5
0534: BSF 20.3
0535: MOVF 20,W
0536: BSF 03.5
0537: MOVWF 07
0538: NOP
0539: BCF 03.5
053A: BCF 07.4
053B: BCF 20.4
053C: MOVF 20,W
053D: BSF 03.5
053E: MOVWF 07
053F: NOP
0540: BCF 03.5
0541: BCF 07.3
0542: BCF 20.3
0543: MOVF 20,W
0544: BSF 03.5
0545: MOVWF 07
.................... I2C_Write(SHT25_ADDR);
075B: MOVLW 80
075C: BCF 03.5
075D: MOVWF 28
075E: CALL 031
0546: MOVLW 80
0547: BCF 03.5
0548: MOVWF 30
0549: CALL 02C
.................... I2C_write(0xE5);
075F: MOVLW E5
0760: MOVWF 28
0761: CALL 031
054A: MOVLW E5
054B: MOVWF 30
054C: CALL 02C
....................
.................... delay_ms(100);
0762: MOVLW 64
0763: MOVWF 28
0764: CALL 11D
054D: MOVLW 64
054E: MOVWF 30
054F: CALL 169
....................
.................... i2c_start();
0765: BSF 20.4
0766: MOVF 20,W
0767: BSF 03.5
0768: MOVWF 07
0769: NOP
076A: BCF 03.5
076B: BSF 20.3
076C: MOVF 20,W
076D: BSF 03.5
076E: MOVWF 07
076F: NOP
0770: BCF 03.5
0771: BTFSS 07.3
0772: GOTO 771
0773: BCF 07.4
0774: BCF 20.4
0775: MOVF 20,W
0776: BSF 03.5
0777: MOVWF 07
0778: NOP
0779: BCF 03.5
077A: BCF 07.3
077B: BCF 20.3
077C: MOVF 20,W
077D: BSF 03.5
077E: MOVWF 07
0550: BSF 20.4
0551: MOVF 20,W
0552: BSF 03.5
0553: MOVWF 07
0554: NOP
0555: BCF 03.5
0556: BSF 20.3
0557: MOVF 20,W
0558: BSF 03.5
0559: MOVWF 07
055A: NOP
055B: BCF 03.5
055C: BTFSS 07.3
055D: GOTO 55C
055E: BCF 07.4
055F: BCF 20.4
0560: MOVF 20,W
0561: BSF 03.5
0562: MOVWF 07
0563: NOP
0564: BCF 03.5
0565: BCF 07.3
0566: BCF 20.3
0567: MOVF 20,W
0568: BSF 03.5
0569: MOVWF 07
.................... I2C_Write(SHT25_ADDR+1);
077F: MOVLW 81
0780: BCF 03.5
0781: MOVWF 28
0782: CALL 031
056A: MOVLW 81
056B: BCF 03.5
056C: MOVWF 30
056D: CALL 02C
.................... MSB=i2c_read(1);
0783: MOVLW 01
0784: MOVWF 77
0785: CALL 131
0786: MOVF 78,W
0787: MOVWF 23
056E: MOVLW 01
056F: MOVWF 77
0570: CALL 17D
0571: MOVF 78,W
0572: MOVWF 2B
.................... LSB=i2c_read(1);
0788: MOVLW 01
0789: MOVWF 77
078A: CALL 131
078B: MOVF 78,W
078C: MOVWF 24
0573: MOVLW 01
0574: MOVWF 77
0575: CALL 17D
0576: MOVF 78,W
0577: MOVWF 2C
.................... Check=i2c_read(0);
078D: CLRF 77
078E: CALL 131
078F: MOVF 78,W
0790: MOVWF 25
0578: CLRF 77
0579: CALL 17D
057A: MOVF 78,W
057B: MOVWF 2D
.................... i2c_stop();
0791: BCF 20.4
0792: MOVF 20,W
0793: BSF 03.5
0794: MOVWF 07
0795: NOP
0796: BCF 03.5
0797: BSF 20.3
0798: MOVF 20,W
0799: BSF 03.5
079A: MOVWF 07
079B: BCF 03.5
079C: BTFSS 07.3
079D: GOTO 79C
079E: NOP
079F: GOTO 7A0
07A0: NOP
07A1: BSF 20.4
07A2: MOVF 20,W
07A3: BSF 03.5
07A4: MOVWF 07
07A5: NOP
057C: BCF 20.4
057D: MOVF 20,W
057E: BSF 03.5
057F: MOVWF 07
0580: NOP
0581: BCF 03.5
0582: BSF 20.3
0583: MOVF 20,W
0584: BSF 03.5
0585: MOVWF 07
0586: BCF 03.5
0587: BTFSS 07.3
0588: GOTO 587
0589: NOP
058A: GOTO 58B
058B: NOP
058C: BSF 20.4
058D: MOVF 20,W
058E: BSF 03.5
058F: MOVWF 07
0590: NOP
....................
.................... LSB = LSB >> 2; // trow out status bits
07A6: BCF 03.5
07A7: RRF 24,F
07A8: RRF 24,F
07A9: MOVLW 3F
07AA: ANDWF 24,F
0591: BCF 03.5
0592: RRF 2C,F
0593: RRF 2C,F
0594: MOVLW 3F
0595: ANDWF 2C,F
....................
.................... data = (((unsigned int16) MSB << 8) + (LSB << 4) );
07AB: CLRF 29
07AC: MOVF 23,W
07AD: MOVWF 28
07AE: MOVWF 29
07AF: CLRF 28
07B0: SWAPF 24,W
07B1: MOVWF 77
07B2: MOVLW F0
07B3: ANDWF 77,F
07B4: MOVF 77,W
07B5: ADDWF 28,W
07B6: MOVWF 26
07B7: MOVF 29,W
07B8: MOVWF 27
07B9: BTFSC 03.0
07BA: INCF 27,F
0596: CLRF 31
0597: MOVF 2B,W
0598: MOVWF 30
0599: MOVWF 31
059A: CLRF 30
059B: SWAPF 2C,W
059C: MOVWF 77
059D: MOVLW F0
059E: ANDWF 77,F
059F: MOVF 77,W
05A0: ADDWF 30,W
05A1: MOVWF 2E
05A2: MOVF 31,W
05A3: MOVWF 2F
05A4: BTFSC 03.0
05A5: INCF 2F,F
.................... return( -6.0 + 125.0*((float)data/0xFFFF));
07BB: MOVF 27,W
07BC: MOVWF 29
07BD: MOVF 26,W
07BE: MOVWF 28
07BF: CALL 2AE
07C0: MOVF 77,W
07C1: MOVWF 28
07C2: MOVF 78,W
07C3: MOVWF 29
07C4: MOVF 79,W
07C5: MOVWF 2A
07C6: MOVF 7A,W
07C7: MOVWF 2B
07C8: MOVWF 2F
07C9: MOVF 79,W
07CA: MOVWF 2E
07CB: MOVF 78,W
07CC: MOVWF 2D
07CD: MOVF 77,W
07CE: MOVWF 2C
07CF: CLRF 33
07D0: MOVLW FF
07D1: MOVWF 32
07D2: MOVLW 7F
07D3: MOVWF 31
07D4: MOVLW 8E
07D5: MOVWF 30
07D6: CALL 2CB
07D7: CLRF 37
07D8: CLRF 36
07D9: MOVLW 7A
07DA: MOVWF 35
07DB: MOVLW 85
07DC: MOVWF 34
07DD: MOVF 7A,W
07DE: MOVWF 3B
07DF: MOVF 79,W
07E0: MOVWF 3A
07E1: MOVF 78,W
07E2: MOVWF 39
07E3: MOVF 77,W
07E4: MOVWF 38
07E5: CALL 395
07E6: BCF 03.1
07E7: CLRF 2B
07E8: CLRF 2A
07E9: MOVLW C0
07EA: MOVWF 29
07EB: MOVLW 81
07EC: MOVWF 28
07ED: MOVF 7A,W
07EE: MOVWF 2F
07EF: MOVF 79,W
07F0: MOVWF 2E
07F1: MOVF 78,W
07F2: MOVWF 2D
07F3: MOVF 77,W
07F4: MOVWF 2C
07F5: CALL 40A
05A6: MOVF 2F,W
05A7: MOVWF 31
05A8: MOVF 2E,W
05A9: MOVWF 30
05AA: CALL 1C2
05AB: MOVF 77,W
05AC: MOVWF 30
05AD: MOVF 78,W
05AE: MOVWF 31
05AF: MOVF 79,W
05B0: MOVWF 32
05B1: MOVF 7A,W
05B2: MOVWF 33
05B3: MOVWF 37
05B4: MOVF 79,W
05B5: MOVWF 36
05B6: MOVF 78,W
05B7: MOVWF 35
05B8: MOVF 77,W
05B9: MOVWF 34
05BA: CLRF 3B
05BB: MOVLW FF
05BC: MOVWF 3A
05BD: MOVLW 7F
05BE: MOVWF 39
05BF: MOVLW 8E
05C0: MOVWF 38
05C1: CALL 1DF
05C2: CLRF 3C
05C3: CLRF 3B
05C4: MOVLW 7A
05C5: MOVWF 3A
05C6: MOVLW 85
05C7: MOVWF 39
05C8: MOVF 7A,W
05C9: MOVWF 40
05CA: MOVF 79,W
05CB: MOVWF 3F
05CC: MOVF 78,W
05CD: MOVWF 3E
05CE: MOVF 77,W
05CF: MOVWF 3D
05D0: CALL 2A9
05D1: BCF 03.1
05D2: CLRF 33
05D3: CLRF 32
05D4: MOVLW C0
05D5: MOVWF 31
05D6: MOVLW 81
05D7: MOVWF 30
05D8: MOVF 7A,W
05D9: MOVWF 37
05DA: MOVF 79,W
05DB: MOVWF 36
05DC: MOVF 78,W
05DD: MOVWF 35
05DE: MOVF 77,W
05DF: MOVWF 34
05E0: CALL 31E
.................... }
07F6: BSF 0A.3
07F7: BCF 0A.4
07F8: GOTO 103 (RETURN)
05E1: BSF 0A.3
05E2: BCF 0A.4
05E3: GOTO 0B3 (RETURN)
....................
....................
....................
1006,8 → 1007,6
.................... void main()
.................... {
*
0030: DATA 00,00
*
0800: CLRF 04
0801: BCF 03.7
0802: MOVLW 1F
1016,351 → 1015,313
0805: BSF 03.5
0806: MOVWF 0F
0807: MOVF 0F,W
0808: BCF 06.7
0809: BCF 03.5
080A: BSF 06.7
0808: BCF 03.5
0809: BCF 20.7
080A: MOVF 20,W
080B: BSF 03.5
080C: BSF 03.6
080D: MOVF 09,W
080E: ANDLW C0
080F: MOVWF 09
0810: BCF 03.6
0811: BCF 1F.4
0812: BCF 1F.5
0813: MOVLW 00
0814: BSF 03.6
0815: MOVWF 08
0816: BCF 03.5
0817: CLRF 07
0818: CLRF 08
0819: CLRF 09
080C: MOVWF 07
080D: BCF 03.5
080E: BSF 07.7
080F: BSF 03.5
0810: BSF 03.6
0811: MOVF 09,W
0812: ANDLW C0
0813: MOVWF 09
0814: BCF 03.6
0815: BCF 1F.4
0816: BCF 1F.5
0817: MOVLW 00
0818: BSF 03.6
0819: MOVWF 08
081A: BCF 03.5
081B: CLRF 07
081C: CLRF 08
081D: CLRF 09
*
081D: CLRF 21
0821: CLRF 21
.................... unsigned int8 i=0, sht_config;
.................... float temperature, humidity;
....................
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
081E: BSF 03.5
081F: BSF 03.6
0820: MOVF 09,W
0821: ANDLW C0
0822: MOVWF 09
0823: BCF 03.6
0824: BCF 1F.4
0825: BCF 1F.5
0826: MOVLW 00
0827: BSF 03.6
0828: MOVWF 08
0822: BSF 03.5
0823: BSF 03.6
0824: MOVF 09,W
0825: ANDLW C0
0826: MOVWF 09
0827: BCF 03.6
0828: BCF 1F.4
0829: BCF 1F.5
082A: MOVLW 00
082B: BSF 03.6
082C: MOVWF 08
.................... setup_adc(ADC_CLOCK_DIV_2);
0829: BCF 03.5
082A: BCF 03.6
082B: BCF 1F.6
082C: BCF 1F.7
082D: BSF 03.5
082E: BCF 1F.7
082F: BCF 03.5
0830: BSF 1F.0
082D: BCF 03.5
082E: BCF 03.6
082F: BCF 1F.6
0830: BCF 1F.7
0831: BSF 03.5
0832: BCF 1F.7
0833: BCF 03.5
0834: BSF 1F.0
.................... setup_spi(SPI_SS_DISABLED);
0831: BCF 14.5
0832: BCF 20.5
0833: MOVF 20,W
0834: BSF 03.5
0835: MOVWF 07
0836: BCF 03.5
0837: BSF 20.4
0838: MOVF 20,W
0839: BSF 03.5
083A: MOVWF 07
083B: BCF 03.5
083C: BCF 20.3
083D: MOVF 20,W
083E: BSF 03.5
083F: MOVWF 07
0840: MOVLW 01
0841: BCF 03.5
0842: MOVWF 14
0843: MOVLW 00
0844: BSF 03.5
0845: MOVWF 14
0835: BCF 14.5
0836: BCF 20.5
0837: MOVF 20,W
0838: BSF 03.5
0839: MOVWF 07
083A: BCF 03.5
083B: BSF 20.4
083C: MOVF 20,W
083D: BSF 03.5
083E: MOVWF 07
083F: BCF 03.5
0840: BCF 20.3
0841: MOVF 20,W
0842: BSF 03.5
0843: MOVWF 07
0844: MOVLW 01
0845: BCF 03.5
0846: MOVWF 14
0847: MOVLW 00
0848: BSF 03.5
0849: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
0846: MOVF 01,W
0847: ANDLW C7
0848: IORLW 08
0849: MOVWF 01
084A: MOVF 01,W
084B: ANDLW C7
084C: IORLW 08
084D: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
084A: BCF 03.5
084B: CLRF 10
084E: BCF 03.5
084F: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
084C: MOVLW 00
084D: MOVWF 78
084E: MOVWF 12
084F: MOVLW 00
0850: BSF 03.5
0851: MOVWF 12
0850: MOVLW 00
0851: MOVWF 78
0852: MOVWF 12
0853: MOVLW 00
0854: BSF 03.5
0855: MOVWF 12
.................... setup_ccp1(CCP_OFF);
0852: BCF 03.5
0853: BSF 20.2
0854: MOVF 20,W
0855: BSF 03.5
0856: MOVWF 07
0857: BCF 03.5
0858: CLRF 17
0856: BCF 03.5
0857: BSF 20.2
0858: MOVF 20,W
0859: BSF 03.5
085A: CLRF 1B
085B: CLRF 1C
085C: MOVLW 01
085D: MOVWF 1D
085A: MOVWF 07
085B: BCF 03.5
085C: CLRF 17
085D: BSF 03.5
085E: CLRF 1B
085F: CLRF 1C
0860: MOVLW 01
0861: MOVWF 1D
.................... setup_comparator(NC_NC_NC_NC);
085E: BCF 03.5
085F: BSF 03.6
0860: CLRF 07
0861: CLRF 08
0862: CLRF 09
0862: BCF 03.5
0863: BSF 03.6
0864: CLRF 07
0865: CLRF 08
0866: CLRF 09
....................
.................... SHT25_soft_reset();
0863: BCF 0A.3
0864: BCF 03.6
0865: GOTO 07B
0866: BSF 0A.3
0867: BCF 0A.3
0868: BCF 03.6
0869: GOTO 076
086A: BSF 0A.3
.................... printf("SHT25 humidity and temperature sensor example \r\n",);
0867: MOVLW 04
0868: BSF 03.6
0869: MOVWF 0D
086A: MOVLW 00
086B: MOVWF 0F
086C: BCF 0A.3
086D: BCF 03.6
086E: GOTO 0D5
086F: BSF 0A.3
086B: MOVLW 04
086C: BSF 03.6
086D: MOVWF 0D
086E: MOVLW 00
086F: MOVWF 0F
0870: BCF 0A.3
0871: BCF 03.6
0872: GOTO 0D2
0873: BSF 0A.3
.................... printf("Temperature Humidity[%%] \r\n");
0874: MOVLW 1D
0875: BSF 03.6
0876: MOVWF 0D
0877: MOVLW 00
0878: MOVWF 0F
0879: BCF 03.0
087A: MOVLW 16
087B: BCF 03.6
087C: MOVWF 2B
087D: BCF 0A.3
087E: CALL 11A
087F: BSF 0A.3
0880: MOVLW 25
0881: MOVWF 39
0882: BCF 0A.3
0883: CALL 0AE
0884: BSF 0A.3
0885: MOVLW 29
0886: BSF 03.6
0887: MOVWF 0D
0888: MOVLW 00
0889: MOVWF 0F
088A: BCF 03.0
088B: MOVLW 05
088C: BCF 03.6
088D: MOVWF 2B
088E: BCF 0A.3
088F: CALL 11A
0890: BSF 0A.3
.................... delay_ms (500);
0870: MOVLW 02
0871: MOVWF 23
0872: MOVLW FA
0873: MOVWF 28
0874: BCF 0A.3
0875: CALL 11D
0876: BSF 0A.3
0877: DECFSZ 23,F
0878: GOTO 072
0891: MOVLW 02
0892: MOVWF 2B
0893: MOVLW FA
0894: MOVWF 30
0895: BCF 0A.3
0896: CALL 169
0897: BSF 0A.3
0898: DECFSZ 2B,F
0899: GOTO 093
....................
....................
.................... while(TRUE)
.................... {
.................... if (i<10) sht_config = SHT25_RH12_T14 | SHT25_HEATER_OFF; // loop alters on chip heater on and off to check correct function
0879: MOVF 21,W
087A: SUBLW 09
087B: BTFSS 03.0
087C: GOTO 07F
087D: CLRF 22
.................... else
087E: GOTO 085
.................... {
.................... if (i<100) sht_config = SHT25_RH12_T14 | SHT25_HEATER_OFF; // loop alters on chip heater on and off to check correct function
089A: MOVF 21,W
089B: SUBLW 63
089C: BTFSS 03.0
089D: GOTO 0A0
089E: CLRF 22
.................... else
089F: GOTO 0A6
.................... {
.................... sht_config = SHT25_RH12_T14 | SHT25_HEATER_ON;
087F: MOVLW 04
0880: MOVWF 22
.................... if (i > 20) i = 0;
0881: MOVF 21,W
0882: SUBLW 14
0883: BTFSS 03.0
0884: CLRF 21
.................... }
.................... printf("setup: %X %X \r\n",SHT25_setup(sht_config),sht_config);
0885: MOVF 22,W
0886: MOVWF 23
0887: BCF 0A.3
0888: GOTO 176
0889: BSF 0A.3
088A: MOVF 78,W
088B: MOVWF 23
088C: MOVLW 1D
088D: BSF 03.6
088E: MOVWF 0D
088F: MOVLW 00
0890: MOVWF 0F
0891: BCF 03.0
0892: MOVLW 07
0893: BCF 03.6
0894: MOVWF 27
0895: BCF 0A.3
0896: CALL 23E
0897: BSF 0A.3
0898: MOVF 23,W
0899: MOVWF 24
089A: MOVLW 37
089B: MOVWF 25
089C: BCF 0A.3
089D: CALL 28D
089E: BSF 0A.3
089F: MOVLW 20
08A0: MOVWF 34
08A1: BCF 0A.3
08A2: CALL 0B3
08A3: BSF 0A.3
08A4: MOVF 22,W
08A5: MOVWF 24
08A6: MOVLW 37
08A7: MOVWF 25
08A8: BCF 0A.3
08A9: CALL 28D
08AA: BSF 0A.3
08AB: MOVLW 20
08AC: MOVWF 34
08AD: BCF 0A.3
08AE: CALL 0B3
08AF: BSF 0A.3
08B0: MOVLW 0D
08B1: MOVWF 34
08B2: BCF 0A.3
08B3: CALL 0B3
08B4: BSF 0A.3
08B5: MOVLW 0A
08B6: MOVWF 34
08B7: BCF 0A.3
08B8: CALL 0B3
08B9: BSF 0A.3
.................... delay_ms (500);
08BA: MOVLW 02
08BB: MOVWF 23
08BC: MOVLW FA
08BD: MOVWF 28
08A0: MOVLW 04
08A1: MOVWF 22
.................... if (i > 120) i = 0;
08A2: MOVF 21,W
08A3: SUBLW 78
08A4: BTFSS 03.0
08A5: CLRF 21
.................... }
....................
.................... temperature = SHT25_get_temp();
08A6: BCF 0A.3
08A7: GOTO 45F
08A8: BSF 0A.3
08A9: MOVF 7A,W
08AA: MOVWF 26
08AB: MOVF 79,W
08AC: MOVWF 25
08AD: MOVF 78,W
08AE: MOVWF 24
08AF: MOVF 77,W
08B0: MOVWF 23
.................... humidity = SHT25_get_hum();
08B1: BCF 0A.3
08B2: GOTO 52E
08B3: BSF 0A.3
08B4: MOVF 7A,W
08B5: MOVWF 2A
08B6: MOVF 79,W
08B7: MOVWF 29
08B8: MOVF 78,W
08B9: MOVWF 28
08BA: MOVF 77,W
08BB: MOVWF 27
....................
.................... printf("%f %f %X %X \r\n",temperature, humidity, SHT25_setup(sht_config),sht_config);
08BC: MOVF 22,W
08BD: MOVWF 2B
08BE: BCF 0A.3
08BF: CALL 11D
08BF: GOTO 5E4
08C0: BSF 0A.3
08C1: DECFSZ 23,F
08C2: GOTO 0BC
.................... printf("Temp: %f \r\n",SHT25_get_temp());
08C3: BCF 0A.3
08C4: GOTO 54B
08C5: BSF 0A.3
08C6: MOVF 77,W
08C7: MOVWF 23
08C8: MOVF 78,W
08C9: MOVWF 24
08CA: MOVF 79,W
08CB: MOVWF 25
08CC: MOVF 7A,W
08CD: MOVWF 26
08CE: MOVLW 25
08CF: BSF 03.6
08D0: MOVWF 0D
08D1: MOVLW 00
08D2: MOVWF 0F
08D3: BCF 03.0
08D4: MOVLW 06
08D5: BCF 03.6
08D6: MOVWF 27
08D7: BCF 0A.3
08D8: CALL 23E
08D9: BSF 0A.3
08DA: MOVLW 89
08DB: MOVWF 04
08DC: MOVF 26,W
08DD: MOVWF 2A
08DE: MOVF 25,W
08DF: MOVWF 29
08E0: MOVF 24,W
08E1: MOVWF 28
08E2: MOVF 23,W
08E3: MOVWF 27
08E4: MOVLW 02
08E5: MOVWF 2B
08E6: BCF 0A.3
08E7: CALL 65C
08E8: BSF 0A.3
08E9: MOVLW 20
08EA: MOVWF 34
08EB: BCF 0A.3
08EC: CALL 0B3
08ED: BSF 0A.3
08EE: MOVLW 0D
08EF: MOVWF 34
08F0: BCF 0A.3
08F1: CALL 0B3
08F2: BSF 0A.3
08F3: MOVLW 0A
08F4: MOVWF 34
08F5: BCF 0A.3
08F6: CALL 0B3
08F7: BSF 0A.3
.................... delay_ms (500);
08F8: MOVLW 02
08F9: MOVWF 23
08FA: MOVLW FA
08FB: MOVWF 28
08FC: BCF 0A.3
08FD: CALL 11D
08FE: BSF 0A.3
08FF: DECFSZ 23,F
0900: GOTO 0FA
.................... printf("Hum: %f \r\n",SHT25_get_hum());
0901: BCF 0A.3
0902: GOTO 743
0903: BSF 0A.3
0904: MOVF 77,W
0905: MOVWF 23
0906: MOVF 78,W
0907: MOVWF 24
0908: MOVF 79,W
0909: MOVWF 25
090A: MOVF 7A,W
090B: MOVWF 26
090C: MOVLW 2B
090D: BSF 03.6
090E: MOVWF 0D
090F: MOVLW 00
0910: MOVWF 0F
0911: BCF 03.0
0912: MOVLW 05
0913: BCF 03.6
0914: MOVWF 27
0915: BCF 0A.3
0916: CALL 23E
0917: BSF 0A.3
0918: MOVLW 89
0919: MOVWF 04
091A: MOVF 26,W
091B: MOVWF 2A
091C: MOVF 25,W
091D: MOVWF 29
091E: MOVF 24,W
091F: MOVWF 28
0920: MOVF 23,W
0921: MOVWF 27
0922: MOVLW 02
0923: MOVWF 2B
0924: BCF 0A.3
0925: CALL 65C
0926: BSF 0A.3
0927: MOVLW 20
0928: MOVWF 34
0929: BCF 0A.3
092A: CALL 0B3
092B: BSF 0A.3
092C: MOVLW 0D
092D: MOVWF 34
092E: BCF 0A.3
092F: CALL 0B3
0930: BSF 0A.3
0931: MOVLW 0A
0932: MOVWF 34
0933: BCF 0A.3
0934: CALL 0B3
0935: BSF 0A.3
.................... delay_ms (1000);
0936: MOVLW 04
0937: MOVWF 23
0938: MOVLW FA
0939: MOVWF 28
093A: BCF 0A.3
093B: CALL 11D
093C: BSF 0A.3
093D: DECFSZ 23,F
093E: GOTO 138
.................... i++;
093F: INCF 21,F
08C1: MOVF 78,W
08C2: MOVWF 2B
08C3: MOVLW 89
08C4: MOVWF 04
08C5: MOVF 26,W
08C6: MOVWF 2F
08C7: MOVF 25,W
08C8: MOVWF 2E
08C9: MOVF 24,W
08CA: MOVWF 2D
08CB: MOVF 23,W
08CC: MOVWF 2C
08CD: MOVLW 02
08CE: MOVWF 30
08CF: BCF 0A.3
08D0: CALL 6EE
08D1: BSF 0A.3
08D2: MOVLW 20
08D3: MOVWF 39
08D4: BCF 0A.3
08D5: CALL 0AE
08D6: BSF 0A.3
08D7: MOVLW 89
08D8: MOVWF 04
08D9: MOVF 2A,W
08DA: MOVWF 2F
08DB: MOVF 29,W
08DC: MOVWF 2E
08DD: MOVF 28,W
08DE: MOVWF 2D
08DF: MOVF 27,W
08E0: MOVWF 2C
08E1: MOVLW 02
08E2: MOVWF 30
08E3: BCF 0A.3
08E4: CALL 6EE
08E5: BSF 0A.3
08E6: MOVLW 20
08E7: MOVWF 39
08E8: BCF 0A.3
08E9: CALL 0AE
08EA: BSF 0A.3
08EB: MOVF 2B,W
08EC: MOVWF 2C
08ED: MOVLW 37
08EE: MOVWF 2D
08EF: BCF 0A.3
08F0: CALL 7D5
08F1: BSF 0A.3
08F2: MOVLW 20
08F3: MOVWF 39
08F4: BCF 0A.3
08F5: CALL 0AE
08F6: BSF 0A.3
08F7: MOVF 22,W
08F8: MOVWF 2C
08F9: MOVLW 37
08FA: MOVWF 2D
08FB: BCF 0A.3
08FC: CALL 7D5
08FD: BSF 0A.3
08FE: MOVLW 20
08FF: MOVWF 39
0900: BCF 0A.3
0901: CALL 0AE
0902: BSF 0A.3
0903: MOVLW 0D
0904: MOVWF 39
0905: BCF 0A.3
0906: CALL 0AE
0907: BSF 0A.3
0908: MOVLW 0A
0909: MOVWF 39
090A: BCF 0A.3
090B: CALL 0AE
090C: BSF 0A.3
.................... i++;
090D: INCF 21,F
.................... delay_ms(1000);
090E: MOVLW 04
090F: MOVWF 2B
0910: MOVLW FA
0911: MOVWF 30
0912: BCF 0A.3
0913: CALL 169
0914: BSF 0A.3
0915: DECFSZ 2B,F
0916: GOTO 110
.................... }
0940: GOTO 079
0917: GOTO 09A
.................... }
....................
0941: SLEEP
0918: SLEEP
 
Configuration Fuses:
Word 1: 2CF4 INTRC_IO NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.pjt
18,13 → 18,13
[Opened Files]
1=main.c
2=main.h
3=C:\Program Files\PICC\devices\16F887.h
4=SHT25.c
5=SHT25.h
3=C:\Program Files (x86)\PICC\devices\16F887.h
4=SHT25.h
5=SHT25.c
6=
[Target Data]
OptionString=-p +FM
FileList=D:\MLAB\Modules\Sensors\SHT25V01A\SW\PIC16F887\main.c
FileList=Z:\home\kaklik\svnMLAB\Modules\Sensors\SHT25V01A\SW\PIC16F887\main.c
[Units]
Count=1
1=main (main)
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.sta
1,24 → 1,24
 
ROM used: 2363 (29%)
2370 (29%) including unused fragments
ROM used: 2319 (28%)
2329 (28%) including unused fragments
 
4 Average locations per line
31 Average locations per statement
 
RAM used: 12 (3%) at main() level
38 (10%) worst case
RAM used: 17 (5%) at main() level
43 (12%) worst case
 
Stack used: 2 worst case (out of 8 total available)
 
Lines Stmts % Files
----- ----- --- -----
43 26 34 main.c
46 25 33 main.c
23 0 0 main.h
423 0 0 C:\Program Files\PICC\devices\16F887.h
423 0 0 C:\Program Files (x86)\PICC\devices\16F887.h
14 0 0 SHT25.h
92 51 66 SHT25.c
92 51 67 SHT25.c
----- -----
595 77 Total
598 76 Total
 
Page ROM % RAM Vol Diff Functions:
---- --- --- --- --- ---- ----------
25,9 → 25,9
0 20 1 1 @delay_ms1
0 69 3 3 @I2C_READ_1
0 74 3 1 @I2C_WRITE_1
0 34 1 1 @PUTCHAR_1_
0 36 2 1 @PUTCHAR_1_
0 56 2 0 55 1.1 SHT25_soft_reset
0 200 8 3 550 4.0 SHT25_setup
0 200 9 3 550 4.0 SHT25_setup
0 207 9 9 572 6.0 SHT25_get_temp
0 29 1 2 @ITOF
0 202 9 14 @DIVFF
34,26 → 34,24
0 117 5 13 @MULFF
0 321 14 16 @ADDFF
0 182 8 9 552 6.0 SHT25_get_hum
1 322 14 6 831 5.7 MAIN
0 25 1 0 @const105
1 281 12 11 840 5.7 MAIN
0 25 1 0 @const107
0 72 3 3 @PSTRINGC7_69
0 8 0 0 @const107
0 15 1 0 @const109
0 79 3 4 @PSTRINGCN7_69
0 33 1 2 @PRINTF_X_69
0 6 0 0 @const113
Inline 5 @FTOSD
0 66 3 13 @DIV3232
0 231 10 13 @PRINTF_L32D_69FPFPF
0 6 0 0 @const122
0 33 1 2 @PRINTF_X_69
 
Program metrics:
Functions 5
Statements 77
Statements 76
Comments 124
Volume (V) 3540
Difficilty (D) 21.1
Effort to implement (E) 74648
Time to implement (T) 1 hours, 9 minutes
Volume (V) 3546
Difficilty (D) 21.3
Effort to implement (E) 75478
Time to implement (T) 1 hours, 10 minutes
Est Delivered Bugs (B) 1
Cyclomatic Complexity 2
Maintainability (MI) 142
61,8 → 59,8
Segment Used Free
----------- ---- ----
00000-00003 4 0
00004-007FF 2037 7
00800-00FFF 322 1726
00004-007FF 2034 10
00800-00FFF 281 1767
01000-017FF 0 2048
01800-01FFF 0 2048
 
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.sym
9,89 → 9,88
020 @TRIS_C
021 MAIN.i
022 MAIN.sht_config
023 SHT25_setup.setup_reg
023 SHT25_get_temp.MSB
023 SHT25_get_hum.MSB
023 MAIN.@SCRATCH1
023 @PSTRINGC7_69.@SCRATCH1
024 SHT25_get_hum.LSB
024 @PRINTF_X_69.P1
024 SHT25_setup.reg
024 SHT25_get_temp.LSB
024 MAIN.@SCRATCH2
024 @PSTRINGC7_69.@SCRATCH2
025 @PRINTF_X_69.P1
025 SHT25_get_temp.Check
025 SHT25_get_hum.Check
025 SHT25_setup.@SCRATCH1
025 MAIN.@SCRATCH3
025 @PSTRINGC7_69.@SCRATCH3
026-027 SHT25_get_hum.data
026-027 SHT25_get_temp.data
026 MAIN.@SCRATCH4
027-02A @PRINTF_L32D_69FPFPF.P1
027 @PSTRINGCN7_69.P2
028 @I2C_WRITE_1.P1
028-029 @ITOF.P2
028-02B @ADDFF.P3
028 @delay_ms1.P4
028 @I2C_READ_1.P5
028 SHT25_get_temp.@SCRATCH1
028 SHT25_get_hum.@SCRATCH1
028 @PSTRINGCN7_69.@SCRATCH1
029 @I2C_READ_1.@SCRATCH1
029 SHT25_get_temp.@SCRATCH2
029 SHT25_get_hum.@SCRATCH2
029 @PSTRINGCN7_69.@SCRATCH2
02A @I2C_READ_1.@SCRATCH2
02A SHT25_get_temp.@SCRATCH3
02A SHT25_get_hum.@SCRATCH3
02A @PSTRINGCN7_69.@SCRATCH3
02B @PRINTF_L32D_69FPFPF.P1
02B SHT25_get_temp.@SCRATCH4
02B SHT25_get_hum.@SCRATCH4
02C-02F @DIVFF.P1
02C-02F @ADDFF.P2
02C @PRINTF_L32D_69FPFPF.@SCRATCH1
02D @PRINTF_L32D_69FPFPF.@SCRATCH2
02E @PRINTF_L32D_69FPFPF.@SCRATCH3
02F @PRINTF_L32D_69FPFPF.@SCRATCH4
030-033 @DIVFF.P1
030 @ADDFF.@SCRATCH1
030 @PRINTF_L32D_69FPFPF.@SCRATCH5
031 @ADDFF.@SCRATCH2
031 @PRINTF_L32D_69FPFPF.@SCRATCH6
032 @ADDFF.@SCRATCH3
032 @PRINTF_L32D_69FPFPF.@SCRATCH7
033 @ADDFF.@SCRATCH4
033 @PRINTF_L32D_69FPFPF.@SCRATCH8
034-037 @FTOSD.P1
034-037 @DIV3232.P2
034-037 @MULFF.P3
034 @PUTCHAR_1_.P4
034 @DIVFF.@SCRATCH1
034 @ADDFF.@SCRATCH5
035 @DIVFF.@SCRATCH2
035 @ADDFF.@SCRATCH6
036 @DIVFF.@SCRATCH3
036 @ADDFF.@SCRATCH7
037 @DIVFF.@SCRATCH4
037 @ADDFF.@SCRATCH8
038-03B @MULFF.P1
038-03B @DIV3232.P2
038 @DIVFF.@SCRATCH5
038 @FTOSD.@SCRATCH1
039 @DIVFF.@SCRATCH6
03C @MULFF.@SCRATCH1
03C @DIV3232.@SCRATCH1
03D @MULFF.@SCRATCH2
03D @DIV3232.@SCRATCH2
03E @MULFF.@SCRATCH3
03E @DIV3232.@SCRATCH3
03F @MULFF.@SCRATCH4
03F @DIV3232.@SCRATCH4
040 @MULFF.@SCRATCH5
040 @DIV3232.@SCRATCH5
023-026 MAIN.temperature
027-02A MAIN.humidity
02B SHT25_setup.setup_reg
02B @PSTRINGCN7_69.P1
02B SHT25_get_temp.MSB
02B SHT25_get_hum.MSB
02B MAIN.@SCRATCH1
02B @PSTRINGC7_69.@SCRATCH1
02C SHT25_setup.reg
02C SHT25_get_hum.LSB
02C @PRINTF_X_69.P1
02C-02F @PRINTF_L32D_69FPFPF.P2
02C SHT25_get_temp.LSB
02C @PSTRINGC7_69.@SCRATCH2
02C @PSTRINGCN7_69.@SCRATCH1
02D SHT25_get_hum.Check
02D @PRINTF_X_69.P1
02D SHT25_get_temp.Check
02D SHT25_setup.@SCRATCH1
02D @PSTRINGC7_69.@SCRATCH3
02D @PSTRINGCN7_69.@SCRATCH2
02E-02F SHT25_get_hum.data
02E-02F SHT25_get_temp.data
02E @PSTRINGCN7_69.@SCRATCH3
030-031 @ITOF.P1
030 @I2C_READ_1.P2
030-033 @ADDFF.P3
030 @delay_ms1.P4
030 @I2C_WRITE_1.P5
030 @PRINTF_L32D_69FPFPF.P6
030 SHT25_get_temp.@SCRATCH1
030 SHT25_get_hum.@SCRATCH1
031 @I2C_READ_1.@SCRATCH1
031 SHT25_get_temp.@SCRATCH2
031 SHT25_get_hum.@SCRATCH2
031 @PRINTF_L32D_69FPFPF.@SCRATCH1
032 @I2C_READ_1.@SCRATCH2
032 SHT25_get_temp.@SCRATCH3
032 SHT25_get_hum.@SCRATCH3
032 @PRINTF_L32D_69FPFPF.@SCRATCH2
033 SHT25_get_temp.@SCRATCH4
033 SHT25_get_hum.@SCRATCH4
033 @PRINTF_L32D_69FPFPF.@SCRATCH3
034-037 @ADDFF.P1
034-037 @DIVFF.P2
034 @PRINTF_L32D_69FPFPF.@SCRATCH4
035 @PRINTF_L32D_69FPFPF.@SCRATCH5
036 @PRINTF_L32D_69FPFPF.@SCRATCH6
037 @PRINTF_L32D_69FPFPF.@SCRATCH7
038-03B @DIVFF.P1
038 @ADDFF.@SCRATCH1
038 @PRINTF_L32D_69FPFPF.@SCRATCH8
039 @PUTCHAR_1_.P1
039-03C @MULFF.P2
039-03C @DIV3232.P3
039-03C @FTOSD.P4
039 @ADDFF.@SCRATCH2
03A @ADDFF.@SCRATCH3
03B @ADDFF.@SCRATCH4
03C @DIVFF.@SCRATCH1
03C @ADDFF.@SCRATCH5
03D-040 @MULFF.P1
03D-040 @DIV3232.P2
03D @DIVFF.@SCRATCH2
03D @ADDFF.@SCRATCH6
03D @FTOSD.@SCRATCH1
03E @DIVFF.@SCRATCH3
03E @ADDFF.@SCRATCH7
03F @DIVFF.@SCRATCH4
03F @ADDFF.@SCRATCH8
040 @DIVFF.@SCRATCH5
041 @DIVFF.@SCRATCH6
041 @MULFF.@SCRATCH1
041 @DIV3232.@SCRATCH1
042 @MULFF.@SCRATCH2
042 @DIV3232.@SCRATCH2
043 @MULFF.@SCRATCH3
043 @DIV3232.@SCRATCH3
044 @MULFF.@SCRATCH4
044 @DIV3232.@SCRATCH4
045 @MULFF.@SCRATCH5
045 @DIV3232.@SCRATCH5
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
103,29 → 102,27
10D-10E @WRITE_PROGRAM_MEMORY8.P2
 
ROM Allocation:
011D @delay_ms1
0131 @I2C_READ_1
0031 @I2C_WRITE_1
00B3 @PUTCHAR_1_
007B SHT25_soft_reset
0176 SHT25_setup
054B SHT25_get_temp
02AE @ITOF
02CB @DIVFF
0395 @MULFF
040A @ADDFF
0743 SHT25_get_hum
0169 @delay_ms1
017D @I2C_READ_1
002C @I2C_WRITE_1
00AE @PUTCHAR_1_
0076 SHT25_soft_reset
05E4 SHT25_setup
045F SHT25_get_temp
01C2 @ITOF
01DF @DIVFF
02A9 @MULFF
031E @ADDFF
052E SHT25_get_hum
0800 MAIN
0004 @const105
00D5 @PSTRINGC7_69
001D @const107
023E @PSTRINGCN7_69
028D @PRINTF_X_69
0025 @const113
0683 @FTOSD
061A @DIV3232
065C @PRINTF_L32D_69FPFPF
002B @const122
0004 @const107
00D2 @PSTRINGC7_69
001D @const109
011A @PSTRINGCN7_69
0715 @FTOSD
06AC @DIV3232
06EE @PRINTF_L32D_69FPFPF
07D5 @PRINTF_X_69
0800 @cinit
 
 
134,17 → 131,17
User Memory space:
 
Project Directory:
D:\MLAB\Modules\Sensors\SHT25V01A\SW\PIC16F887\
Z:\home\kaklik\svnMLAB\Modules\Sensors\SHT25V01A\SW\PIC16F887\
 
Project Files:
main.c
main.h
C:\Program Files\PICC\devices\16F887.h
C:\Program Files (x86)\PICC\devices\16F887.h
SHT25.h
SHT25.c
 
Units:
D:\MLAB\Modules\Sensors\SHT25V01A\SW\PIC16F887\main (main)
Z:\home\kaklik\svnMLAB\Modules\Sensors\SHT25V01A\SW\PIC16F887\main (main)
 
Compiler Settings:
Processor: PIC16F887
/Modules/Sensors/SHT25V01A/SW/PIC16F887/main.tre
1,39 → 1,19
ÀÄmain
ÀÄMAIN 1/322 Ram=6
ÀÄMAIN 1/281 Ram=11
ÃÄ??0??
ÃÄSHT25_soft_reset 0/56 Ram=0
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÀÄ@I2C_WRITE_1 0/74 Ram=1
ÃÄ@PSTRINGC7_69 0/72 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@delay_ms1 0/20 Ram=1
ÃÄSHT25_setup 0/200 Ram=3
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_READ_1 0/69 Ram=3
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@delay_ms1 0/20 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÀÄ@I2C_READ_1 0/69 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PSTRINGCN7_69 0/79 Ram=4
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PRINTF_X_69 0/33 Ram=2
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PRINTF_X_69 0/33 Ram=2
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PSTRINGCN7_69 0/79 Ram=4
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@delay_ms1 0/20 Ram=1
ÃÄSHT25_get_temp 0/207 Ram=9
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
47,22 → 27,6
³ ÃÄ@DIVFF 0/202 Ram=14
³ ÃÄ@MULFF 0/117 Ram=13
³ ÀÄ@ADDFF 0/321 Ram=16
ÃÄ@PSTRINGCN7_69 0/79 Ram=4
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PRINTF_L32D_69FPFPF 0/231 Ram=13
³ ÃÄ@MULFF 0/117 Ram=13
³ ÃÄ@FTOSD (Inline) Ram=5
³ ÃÄ@DIV3232 0/66 Ram=13
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@DIV3232 0/66 Ram=13
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@delay_ms1 0/20 Ram=1
ÃÄSHT25_get_hum 0/182 Ram=9
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
75,19 → 39,47
³ ÃÄ@DIVFF 0/202 Ram=14
³ ÃÄ@MULFF 0/117 Ram=13
³ ÀÄ@ADDFF 0/321 Ram=16
ÃÄ@PSTRINGCN7_69 0/79 Ram=4
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄSHT25_setup 0/200 Ram=3
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_READ_1 0/69 Ram=3
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@delay_ms1 0/20 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÀÄ@I2C_READ_1 0/69 Ram=3
ÃÄ@PRINTF_L32D_69FPFPF 0/231 Ram=13
³ ÃÄ@MULFF 0/117 Ram=13
³ ÃÄ@FTOSD (Inline) Ram=5
³ ÃÄ@DIV3232 0/66 Ram=13
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@DIV3232 0/66 Ram=13
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PRINTF_L32D_69FPFPF 0/231 Ram=13
³ ÃÄ@MULFF 0/117 Ram=13
³ ÃÄ@FTOSD (Inline) Ram=5
³ ÃÄ@DIV3232 0/66 Ram=13
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@DIV3232 0/66 Ram=13
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PRINTF_X_69 0/33 Ram=2
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PRINTF_X_69 0/33 Ram=2
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PUTCHAR_1_ 0/36 Ram=1
ÀÄ@delay_ms1 0/20 Ram=1
/Modules/Sensors/SHT25V01A/test/heating_control/plot.gp
0,0 → 1,11
set terminal png
set xlabel "Time [h]"
set ylabel "Illuminance [lx]"
set key under
#set yrange [-1:1]
set logscale y
 
 
 
set output "LUX85_rozednivani.png"
plot "LUX85_rozednivani.TXT" using ($1/3600):2 with lines title "Visible", "" using ($1/3600):3 with lines title "Infrared"
/Modules/Sensors/SHT25V01A/test/heating_control/test_hum.log
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property