/Modules/Sensors/ALTIMET01A/SW/MPL3115/MPL3115.c
0,0 → 1,105
void mpl3115_setA (void) //nastavení pro výšku
{
 
i2c_start(); //STANDBY mode
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x26);
I2C_write(0xB8);
i2c_stop();
i2c_start(); //PT_DATA_CFG set
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x13);
I2C_write(0x07); //hodnota
i2c_stop();
i2c_start(); //ACTIVE mode
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x26);
I2C_write(0xB9);
i2c_stop();
}
void mpl3115_setP (void) //nastavení pro tlak
{
 
i2c_start(); //STANDBY mode
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x26);
I2C_write(0xB8);
i2c_stop();
i2c_start(); //PT_DATA_CFG set
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x13);
I2C_write(0x07); //hodnota
i2c_stop();
i2c_start(); //ACTIVE mode
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x26);
I2C_write(0x39);
i2c_stop();
}
 
 
byte mpl3115_read (byte reg)
{
byte i;
i2c_start();
I2C_Write(MPL3115_ADDR_W);
I2C_write(reg);
i2c_start();
I2C_Write(MPL3115_ADDR_R);
i=i2c_read(0);
i2c_stop();
return i;
}
 
 
float mpl3115_T (void) //teplota ve stupnich
{
int m;
float l, t;
m = mpl3115_read (0x04);
l = (float)(mpl3115_read(0x05)>>4)/16.0;
t = (float)(M + L);
return t;
}
 
float mpl3115_A (void) //vyska v m
{
 
int16 m, c;
float l, a;
m = mpl3115_read (0x01);
c = mpl3115_read (0x02);
l = (float)(mpl3115_read(0x03)>>4)/16.0;
a = (float)((m << 8)|c) + l;
return a;
}
 
 
float mpl3115_P (void) //tlak v Pa
{
unsigned int32 m;
unsigned int16 c;
unsigned int l;
float p, l1;
m = mpl3115_read (0x01);
c = mpl3115_read (0x02);
l = mpl3115_read(0x03);
 
l1= (float)(l>>4)/4.0;
p = (float)((m << 10)|(c<<2)|(l>>6)) + l1;
 
return p;
}
 
/Modules/Sensors/ALTIMET01A/SW/MPL3115/MPL3115.h
0,0 → 1,10
//microchip pic library for Freescale MPL3115 barometer sensor
 
/*void mpl3115_setA (void) //setup sensor for altitude measurement
void mpl3115_setP (void) //setup sensor for preasure measurement
float mpl3115_T (void) //temperature in Celsius degrees
float mpl3115_A (void) //altitude in metres
float mpl3115_P (void) //preassure in pascals
*/
 
#include "MPL3115.c"
/Modules/Sensors/ALTIMET01A/SW/MPL3115/PIC16F887/main.c
9,112 → 9,9
#define MPL3115_ADDR_R 0xC1 //addresa pro cteni
#define MPL3115_ADDR_W 0xC0
 
#include "../MPL3115.h"
 
void mpl3115_setA (void) //nastavení pro výšku
{
 
i2c_start(); //STANDBY mode
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x26);
I2C_write(0xB8);
i2c_stop();
i2c_start(); //PT_DATA_CFG set
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x13);
I2C_write(0x07); //hodnota
i2c_stop();
i2c_start(); //ACTIVE mode
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x26);
I2C_write(0xB9);
i2c_stop();
}
void mpl3115_setP (void) //nastavení pro tlak
{
 
i2c_start(); //STANDBY mode
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x26);
I2C_write(0xB8);
i2c_stop();
i2c_start(); //PT_DATA_CFG set
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x13);
I2C_write(0x07); //hodnota
i2c_stop();
i2c_start(); //ACTIVE mode
I2C_Write(MPL3115_ADDR_W);
I2C_write(0x26);
I2C_write(0x39);
i2c_stop();
}
 
 
byte mpl3115_read (byte reg)
{
byte i;
i2c_start();
I2C_Write(MPL3115_ADDR_W);
I2C_write(reg);
i2c_start();
I2C_Write(MPL3115_ADDR_R);
i=i2c_read(0);
i2c_stop();
return i;
}
 
 
float mpl3115_T (void) //teplota ve stupnich
{
int m;
float l, t;
m = mpl3115_read (0x04);
l = (float)(mpl3115_read(0x05)>>4)/16.0;
t = (float)(M + L);
return t;
}
 
float mpl3115_A (void) //vyska v m
{
 
int16 m, c;
float l, a;
m = mpl3115_read (0x01);
c = mpl3115_read (0x02);
l = (float)(mpl3115_read(0x03)>>4)/16.0;
a = (float)((m << 8)|c) + l;
return a;
}
 
 
float mpl3115_P (void) //tlak v Pa
{
unsigned int32 m;
unsigned int16 c;
unsigned int l;
float p, l1;
m = mpl3115_read (0x01);
c = mpl3115_read (0x02);
l = mpl3115_read(0x03);
 
l1= (float)(l>>4)/4.0;
p = (float)((m << 10)|(c<<2)|(l>>6)) + l1;
 
return p;
}
 
void main()
{
 
/Modules/Sensors/ALTIMET01A/SW/MPL3115/PIC16F887/main.hex
281,4 → 281,4
:04400E00F52CFF3F4F
:00000001FF
;PIC16F887
;CRC=79AB CREATED="06-VI-13 00:24"
;CRC=79AB CREATED="25-VIII-13 15:29"
/Modules/Sensors/ALTIMET01A/SW/MPL3115/PIC16F887/main.pjt
17,9 → 17,11
0=0000 %S 0 0 796 451 3 0
[Opened Files]
1=main.c
2=main.h
3=C:\Program Files (x86)\PICC\devices\16F887.h
4=
2=..\MPL3115.h
3=main.h
4=C:\Program Files (x86)\PICC\devices\16F887.h
5=..\MPL3115.c
6=
[Target Data]
OptionString=-p +FM
FileList=Z:\home\kaklik\svnMLAB\Modules\Sensors\ALTIMET01A\SW\MPL3115\PIC16F887\main.c
/Modules/Sensors/LTS01A/SW/LTS01.c
0,0 → 1,16
float LTS01_get_temp()
{
int8 MSB, LSB;
 
i2c_start();
I2C_Write(LTS01A_address);
I2C_write(0x00);
i2c_stop();
i2c_start();
I2C_Write(LTS01A_address+1);
MSB=i2c_read(1);
LSB=i2c_read(0);
i2c_stop();
return (MAKE16(MSB,LSB) * 0.00390625 );
}
/Modules/Sensors/LTS01A/SW/LTS01.h
0,0 → 1,6
//Adresa pro VDD, VDD, VDD W 0x9E R 0x9F
//Adresa pro GND GND GND W 0x90 R 0x91
 
#define LTS01A_address 0x90
 
#include "LTS01.c"
/Modules/Sensors/LTS01A/SW/PIC16F887/main.c
1,12 → 1,11
#include "D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.h"
#include "main.h"
 
#define S_SDA PIN_C3
#define S_SCL PIN_C4
#define S_SDA PIN_C4
#define S_SCL PIN_C3
#use i2c(master, sda=S_SDA, scl=S_SCL)
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD
#use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
 
//Adresa pro VDD, VDD, VDD W 0x9E R 0x9F
//Adresa pro GND GND GND W 0x90 R 0x91
#include "../LTS01.h"
 
void main()
{
20,33 → 19,13
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
 
printf("Simple Thermomether \r\n",);
printf("(c) MLAB 2013 JACHO \r\n",);
 
signed int8 MSB;
byte LSB;
float t;
printf("Simple Thermomether with LTS01A sensor \r\n",);
printf("(c) MLAB.cz 2013 JACHO \r\n",);
while(TRUE)
{
 
 
i2c_start();
I2C_Write(0x90);
I2C_write(0x00);
i2c_stop();
i2c_start();
I2C_Write(0x91);
MSB=i2c_read(1);
LSB=i2c_read(0);
i2c_stop();
t = (float)(LSB)/256.0;
t = (float)(MSB+t);
 
printf("Teplota: %f (C)\r\n", t);
delay_ms(500);
printf("T: %f\r\n", LTS01_get_temp());
delay_ms(500);
}
}
 
/Modules/Sensors/LTS01A/SW/PIC16F887/main.cof
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/Modules/Sensors/LTS01A/SW/PIC16F887/main.err
1,2 → 1,2
Memory usage: ROM=21% RAM=3% - 10%
Memory usage: ROM=13% RAM=3% - 10%
0 Errors, 0 Warnings.
/Modules/Sensors/LTS01A/SW/PIC16F887/main.esym
1,7 → 1,7
D G "__PCM__" 0 54 ""4.106""
D G "__DEVICE__" 0 54 "887"
D G "__DATE__" 0 54 ""19-7-13""
D G "__TIME__" 0 54 ""17:14:42"" "Standard Header file for the PIC16F887 device ////////////////"
D G "__PCM__" 0 33 ""4.106""
D G "__DEVICE__" 0 33 "887"
D G "__DATE__" 0 33 ""26-VIII-13""
D G "__TIME__" 0 33 ""18:26:57"" "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"
273,14 → 273,14
d G "INT_RB5" 2 418 "0x0200B08"
d G "INT_RB6" 2 419 "0x0400B08"
d G "INT_RB7" 2 420 "0x0800B08"
D G "S_SDA" 0 3 "PIN_C3"
D G "S_SCL" 0 4 "PIN_C4"
C L "main" 0 8 2 "FUNCTION"
F G "main" 0 11 "void()"
C L "main" 0 8 1 "FUNCTION"
V L "MSB" 0 26 "sint8"
V L "LSB" 0 27 "int8"
V L "t" 0 28 "float"
D G "S_SDA" 0 3 "PIN_C4"
D G "S_SCL" 0 4 "PIN_C3"
D G "LTS01A_address" 3 4 "0x90"
F G "LTS01_get_temp" 4 1 "float()"
V L "MSB" 4 3 "int8"
V L "LSB" 4 3 "int8"
F G "MAIN" 0 10 "void()"
C L "MAIN" 0 20 1 "FUNCTION"
F B "reset_cpu" 0 0
F B "abs" 1 0
F B "sleep_ulpwu" 1 0
413,3 → 413,5
F B "getch" 0 1
F B "gets" 1 3
F B "kbhit" 0 1
F B "set_uart_speed" 1 3
F B "setup_uart" 1 3
/Modules/Sensors/LTS01A/SW/PIC16F887/main.hex
1,220 → 1,133
:1000000005308A00742D0000D3346D38EC32202A7C
:10001000E832F236EF36653AE8327210A0060A008E
:10002000A83129104D2641212019B0183310CA20BB
:1000300043244F10A0060A00D43270366F3A611D77
:10004000A0126610A821A9060A0083168611831241
:1000500086110830F8002C280000F8173D28F81306
:10006000B40C03188615031C861178173D287813E5
:10007000F80B30283B28000086153F308400840BA5
:100080003F280000F81B2F28781B3728080083160C
:1000900003178C170C140000000083120C087F3922
:1000A00003198B280313A70003170D080313A800D7
:1000B00003170F080313A9002708B40025202808F8
:1000C00003178D000313290803178F0083168C175D
:1000D0000C140000000083120C0D0E0D7F39031963
:1000E0008B280313A70003170D080313A800031799
:1000F0000F080313A9002708B400252028080317B8
:100100008D000313290803178F008D0A03198F0A26
:10011000031347280317031308000830F8000000F2
:100120000712201220088316870000008312A70DF3
:100130008711031CA128A015200883168700A52875
:100140008312A01120088316870000008312201656
:100150002008831687008312071EAC28F80B8F280F
:100160000000071220122008831687000000831267
:10017000A0152008831687000000000083122016B7
:100180002008831687008312071EC428F801000088
:10019000871978140712201220088316870083120B
:1001A0008711A011200883168700831208000830E9
:1001B000A8007708A900A015200883168700000072
:1001C000831220162008831687008312071EE62854
:1001D00087190314871D0310F80D00002012200852
:1001E0008316870083120712A80BDB28A0152008AE
:1001F0008316870000008312871129080319052937
:10020000A011200883168700831200002016200802
:10021000831687008312071E0B2900000712201285
:10022000200883168700000083128711A011200880
:1002300083168700831208008E30F7002808F80024
:100240002708F900FA01F808031D30297908F80099
:10025000F9010830F702F808031D3029F7013829A1
:100260000310F81B3729F90DF80DF7033029F8139F
:100270008A110A12562E2B080319002AB7002F08DC
:100280000319002AB702031C4A297F30B707031855
:10029000002A50298130B702031C002A0319002AC2
:1002A0003708F700F801F901FA01B6012C08B5008A
:1002B000B5172D08B4002E08B3001930B700320866
:1002C000B302031873290130B40203187329B5026D
:1002D00003187329B60203187329B60AB50AB40ABB
:1002E0003208B307A5293108B40203188E2901305A
:1002F000B50203188E29B60203188E29B60AB50A6C
:100300003108B4073208B307031CA529B40A031D3A
:10031000A529B50A031DA529B60AA52930088038E4
:10032000B5020318A4290130B6020318A429B60A9D
:1003300030088038B5073108B407031C8229B50A94
:10034000031D8229B60A82297A14B70BA829B3297A
:100350000310B30DB40DB50DB60D0310FA0DF90D64
:10036000F80DB80D5F29381CBB290310F80CF90CE7
:10037000FA0CB80CBE29F7030319002AB81BE729A9
:100380000310B30DB40DB50DB60D3208B30203184A
:10039000D3290130B4020318D329B5020318D32995
:1003A000B602031CF6293108B4020318DE29013015
:1003B000B5020318DE29B602031CF629300880387E
:1003C000B5020318E7290130B602031CF629FA0A20
:1003D000031DF629F90A031DF629F80A031DF6295B
:1003E000F70A0319002AF80CF90CFA0C2C08B700CC
:1003F0003008B706B71FFE29F817042AF813042A95
:10040000F701F801F901FA018A110A126B2E8E30F8
:10041000F7002908F8002808F900FA01A91F152A91
:10042000F809F909F90A0319F80AF808031D222A3C
:100430007908F800F9010830F702F808031D222AAC
:10044000F7012B2A0310F81B292AF90DF80DF703E1
:10045000222AA91FF8138A110A12792E80308318D4
:10046000AD06B201B3012908B1002D08B106280874
:1004700003191E2BB000F7002C080319272BB0021C
:100480000319C32A031C812A2D08B600B6172E08AB
:10049000B5002F08B400B3010310B60CB50CB40CB2
:1004A000B30CB00B4B2AB11F582A32143B2B32101D
:1004B000301032162B3084008313502B3212B11BB4
:1004C0006B2A301C762AB60CB50CB40CB30CF70AA8
:1004D0000319362B762AB61B792A0310B30DB40DF7
:1004E000B50DB60DF7030319362B6B2A3217E32A25
:1004F00032132908B100B11F7F2AB6172F2BB6136C
:100500002F2B2C08B000F7002808B0022908B600ED
:10051000B6172A08B5002B08B400B3010310B60CB7
:10052000B50CB40CB30CB00B8D2AB11F9A2AB214BF
:100530003B2BB2103010B2162F3084008313502B97
:10054000B212B11BAD2A301CB82AB60CB50CB40CD3
:10055000B30CF70A0319362BB82AB61BBB2A0310B3
:10056000B30DB40DB50DB60DF7030319362BAD2A37
:10057000B217E32AB2132D08B100B11FC12AB61772
:100580002F2BB6132F2B2D08B600B6172E08B5004B
:100590002F08B400B11FD02AB61332153B2B3211ED
:1005A000B30130102B3084008313502BB11BF92A78
:1005B0002908B100301CE32AB60CB50CB40CB30CFE
:1005C000F70A0319362BB31FF42AB40A031DF42AC1
:1005D000B50A031DF42AB60A031DF42AB60CB50C9D
:1005E000B40CF70A0319362B321B782AB21BBA2A2D
:1005F000182B8030B606B61F012B3B2B2D08B100FF
:100600000E2B2908B100B608031D0E2BB508031DDB
:100610000E2BB408031D0E2BF7012F2BB61B182B26
:100620000310B30DB40DB50DB60DF70B0E2B362B15
:10063000B11F1C2BB6172F2BB6132F2B2C08F7002E
:100640002D08B6002E08B5002F08B4002F2B28085F
:10065000F7002908B6002A08B5002B08B4003608B0
:10066000F8003508F9003408FA006E2BF701F8019C
:10067000F901FA016E2BB301B409B509B609B30942
:10068000B30A031D492BB40A031D492BB50A0319EC
:10069000B60A3218572AB218992A3219CF2AFE2AD6
:1006A0000008B407031C5A2BB50A031D5A2BB60ABF
:1006B0000319301484030008B507031C622BB60A23
:1006C0000319301484030008801F803AB60703180A
:1006D0003014321A5E2AB21AA02AD62A8A110A12B5
:1006E0008B2E831603178C170C14000000000318C0
:1006F000A02B83120C087F390313A80003170D08E1
:100700000313A90003170F080313AA002808B40055
:100710002520290803178D0003132A0803178F00CB
:1007200083168C170C140000000083120313A70B10
:100730009A2B9D2B83160317A02BBF2B8316031711
:1007400083120C0D0E0D7F390313A80003170D083B
:100750000313A90003170F080313AA002808B40005
:100760002520290803178D0003132A0803178F007B
:100770008D0A03198F0A03100313A70B712B0800AE
:10078000F701F801F901FA01BC01BD01BE01BF0189
:100790003B083A04390438040319FE2B2030C0000A
:1007A0000310B40DB50DB60DB70DBC0DBD0DBE0DCE
:1007B000BF0D3B083F02031DE72B3A083E02031D15
:1007C000E72B39083D02031DE72B38083C02031CC8
:1007D000F82B3808BC023908031C390FBD023A084F
:1007E000031C3A0FBE023B08031C3B0FBF0203145D
:1007F000F70DF80DF90DFA0DC00BD02B3C3084002D
:10080000831308000408AC002B08AE000319942CD5
:100810002A08B7002908B6002808B5002708B40040
:10082000BB01BA012030B9008230B8003408031986
:10083000862CBC0038080319862CBC070318272C0B
:100840007F30BC02031C862C0319862C2B2C813094
:10085000BC070318862C3C08F700F801F901FA01DF
:100860003508C000C0173608BF003708BE00183072
:10087000BC00BD013E1C542C3B08FA07031C462C4F
:10088000F90A031D462CF80A0319BD173A08F9079F
:10089000031C4D2CF80A0319BD173908B600B6170A
:1008A0003608F8070318BD17BD0DF80CF90CFA0C43
:1008B000C00CBF0CBE0C0310BC0B392C0130F70769
:1008C0000318862CF81B6B2CC00DFA0DF90DF80DD2
:1008D000F7030319862CC01F7C2CFA0A031D7C2CFD
:1008E000F90A031D7C2CF80A031D7C2CF80CF90C6A
:1008F000FA0CF70A0319862C3508BD003908BD0625
:10090000BD1F842CF8178A2CF8138A2CF701F801E4
:10091000F901FA017A08AA007908A9007808A80064
:100920007708A700AE0B082C2A08B7002908B600E4
:100930002808B5002708B4003408B63CB400FA0112
:100940003508B800B5170310B50CB60CB70CFA0C87
:10095000F90CF80CF70CB40BA32CB81FBA2CF70940
:10096000F809F909FA09F70A0319F80A0319F90A43
:100970000319FA0A7A08AA007908A9007808A800D9
:100980007708A700AA1FD12CAC03AC16A709A809A9
:10099000A909AA09A70A0319A80A0319A90A031988
:1009A000AA0A3B30B3009A30B200CA30B100B0019D
:1009B0000A30AE002B080319AC0A2A08B700290830
:1009C000B6002808B5002708B4003308BB00320879
:1009D000BA003108B9003008B800C0230008A700E9
:1009E000840A0008A800840A0008A900840A0008F4
:1009F000AA00FD308407F708031D112D2B0A2E02D3
:100A00000319112D2C080319132D0F392E02031968
:100A10000B2D0318432DAC1B432D2C1B132D203005
:100A20003F2D2030AC05AC1E212DAC122B08031D30
:100A3000AC037708AC002D30B40025202C08F7005B
:100A4000AC012B082E02031D2F2D7708AC002E3091
:100A5000B40025202C08F7002030AC0500303030E1
:100A6000AC1E3F2DAC122B08031DAC037708AC0065
:100A70002D30B40025202C08F700AC013030F707EA
:100A80007708B40025203308B7003208B6003108D3
:100A9000B5003008B400BB01BA01B9010A30B80092
:100AA000C0237A08B3007908B2007808B10077084B
:100AB000B000AE0BDD2C8A110A12AA2E2830840059
:100AC000831300080319712D0230F800F701F70BAA
:100AD000672DF80B662D9730F700F70B6D2D800B07
:100AE000642D8A110A12B92E840183131F308305E5
:100AF000713083168F000F088611831286158316B6
:100B000003170908C039890003131F129F12003010
:100B1000031788008312870188018901FF300313BE
:100B2000A000831603170908C039890003131F1298
:100B30009F12003003178800831203131F139F13A3
:100B400083169F1383121F149412A0122008831679
:100B50008700831220162008831687008312A011B5
:100B6000200883168700013083129400003083161A
:100B700094000108C73908388100831290010030C1
:100B8000F80092000030831692008312201520088E
:100B9000831687008312970183169B019C01013005
:100BA0009D008312031787018801890104308D009D
:100BB00000308F0003134720103003178D000030E2
:100BC0008F0003134720A01520088316870000001C
:100BD00083122016200883168700000083128711D5
:100BE000A01120088316870000008312071220122C
:100BF00020088316870090308312A7008D20A7015C
:100C00008D20A01120088316870000008312201673
:100C10002008831687008312071E0C2E0000102E5A
:100C20000000A01520088316870000008312A0157D
:100C300020088316870000008312201620088316E0
:100C40008700000083128711A011200883168700F7
:100C500000008312071220122008831687009130AB
:100C60008312A7008D200130F700D7207808A1005B
:100C7000F701D7207808A200A0112008831687006A
:100C80000000831220162008831687008312071E97
:100C9000472E00004B2E0000A01520088316870069
:100CA00000008312A8012208A7001C297708A700CA
:100CB0007808A8007908A9007A08AA00AE00790887
:100CC000AD007808AC007708AB00B201B101B0010B
:100CD0008730AF003B297A08A6007908A50078087C
:100CE000A4007708A300A9012108A800A81BA90354
:100CF000072A83107A08AB007908AA007808A900AF
:100D00007708A8002608AF002508AE002408AD002B
:100D10002308AC002E2A7A08A6007908A5007808D6
:100D2000A4007708A3001C3003178D0000308F004B
:100D3000031009300313A7007123893084002608AB
:100D4000AA002508A9002408A8002308A70002304B
:100D5000AB00022C213003178D0000308F000314EC
:100D600006300313A70071230230A700FA30A80051
:0A0D70005E2DA70BB62EE32D6300E5
:1000000003308A005C2B0000D3346D38EC32202A98
:10001000E832F236EF36653AE8327210F73474346B
:100020002026D429B0184110F332EE396F39A006DA
:100030000A00A83129104D264121AE317A1032181C
:10004000B1192025C121C82720100D0500018316F4
:1000500003178C170C140000000083120C087F3962
:1000600003196D280313A10003170D080313A20041
:1000700003170F080313A30021080C1E3D28990045
:10008000220803178D000313230803178F0083161C
:100090008C170C140000000083120C0D0E0D7F391C
:1000A00003196D280313A10003170D080313A20001
:1000B00003170F080313A30021080C1E5D289900E5
:1000C000220803178D000313230803178F008D0ADE
:1000D00003198F0A03132728031703130800083096
:1000E000F80000008711A011200883168700000087
:1000F0008312A30D0712031C8328201620088316E1
:1001000087008728831220122008831687000000AA
:100110008312A0152008831687008312871D8E285E
:10012000F80B712800008711A011200883168700A2
:1001300000008312201620088316870000000000AC
:100140008312A0152008831687008312871DA62816
:10015000F8010000071A78148711A01120088316EF
:10016000870083120712201220088316870083124B
:1001700008000830A4007708A50020162008831680
:10018000870000008312A0152008831687008312C1
:10019000871DC828071A0314071E0310F80D000056
:1001A000A01120088316870083128711A40BBD2895
:1001B00020162008831687000000831207122508E6
:1001C0000319E728201220088316870083120000F5
:1001D000A0152008831687008312871DED280000D4
:1001E0008711A011200883168700000083120712D0
:1001F0002012200883168700831208003208031992
:100200006E29BA00360803196E29BA0703180F2998
:100210007F30BA02031C6E2903196E29132981301D
:10022000BA0703186E293A08F700F801F901FA0134
:100230003308BE00BE173408BD003508BC001830B6
:10024000BA00BB013C1C3C293908FA07031C2E29C3
:10025000F90A031D2E29F80A0319BB173808F907F4
:10026000031C3529F80A0319BB173708B400B41763
:100270003408F8070318BB17BB0DF80CF90CFA0C7F
:10028000BE0CBD0CBC0C0310BA0B21290130F707C2
:1002900003186E29F81B5329BE0DFA0DF90DF80D40
:1002A000F70303196E29BE1F6429FA0A031D642986
:1002B000F90A031D6429F80A031D6429F80CF90CD6
:1002C000FA0CF70A03196E293308BB003708BB067E
:1002D000BB1F6C29F8177229F8137229F701F8016E
:1002E000F901FA0108002016200883168700000093
:1002F0008312A015200883168700000083120712BE
:100300002012200883168700000083128711A01195
:1003100020088316870090308312A3006F20A3016A
:100320006F20201220088316870000008312A0157A
:100330002008831687008312871D9C290000A029AE
:100340000000201620088316870000008312201664
:1003500020088316870000008312A015200883164A
:1003600087000000831207122012200883168700DE
:10037000000083128711A011200883168700913096
:100380008312A3006F200130F700B9207808A10084
:10039000F701B9207808A2002012200883168700F0
:1003A00000008312A0152008831687008312871D82
:1003B000D7290000DB2900002016200883168700BB
:1003C000000083122108A4002208A3002408A6002C
:1003D0002308A5008E30F7002608F8002508F9004C
:1003E000FA01F808031DFE297908F800F901083020
:1003F000F702F808031DFE29F701062A0310F81B6F
:10040000052AF90DF80DF703FE29F8137A08B5004F
:100410007908B4007808B3007708B200B901B801D0
:10042000B7017730B600FE208A110A12D32BF701EC
:10043000F801F901FA01BA01BB01BC01BD0139089B
:100440003804370436040319552A2030BE0003103F
:10045000B20DB30DB40DB50DBA0DBB0DBC0DBD0D78
:1004600039083D02031D3E2A38083C02031D3E2A7E
:1004700037083B02031D3E2A36083A02031C4F2A66
:100480003608BA023708031C370FBB023808031CB2
:10049000380FBC023908031C390FBD020314F70DD5
:1004A000F80DF90DFA0DBE0B272A3A30840083139C
:1004B00008000408AA002908AC000319782A2808B3
:1004C000B5002708B4002608B3002508B200B9011A
:1004D000B8012030B7008230B600FE207A08A800AC
:1004E0007908A7007808A6007708A500AC0B5F2A5A
:1004F0002808B5002708B4002608B3002508B20074
:100500003208B63CB200FA013308B600B317031044
:10051000B30CB40CB50CFA0CF90CF80CF70CB20BCC
:10052000872AB61F9E2AF709F809F909FA09F70A76
:100530000319F80A0319F90A0319FA0A7A08A80034
:100540007908A7007808A6007708A500A81FB52A93
:10055000AA03AA16A509A609A709A809A50A0319A5
:10056000A60A0319A70A0319A80A3B30B1009A305A
:10057000B000CA30AF00AE010A30AC002908031940
:10058000AA0A2808B5002708B4002608B3002508E1
:10059000B2003108B9003008B8002F08B7002E08A3
:1005A000B60017220008A500840A0008A600840AE5
:1005B0000008A700840A0008A800FD308407F70897
:1005C000031DF52A290A2C020319F52A2A08031902
:1005D000F72A0F392C020319EF2A03182B2BAA1B19
:1005E0002B2B2A1BF72A2030262B2030AA05AA1EE7
:1005F000062BAA122908031DAA037708AA002D308A
:100600000C1E002B99002A08F700AA0129082C02C9
:10061000031D152B7708AA002E300C1E0D2B9900F8
:100620002A08F7002030AA0500303030AA1E262BF9
:10063000AA122908031DAA037708AA002D300C1E50
:100640001F2B99002A08F700AA013030F707770816
:100650000C1E282B99003108B5003008B4002F0873
:10066000B3002E08B200B901B801B7010A30B600D4
:1006700017227A08B1007908B0007808AF0077082F
:10068000AE00AC0BC12A8A110A12F42B223084006E
:10069000831300080319592B0230F800F701F70BF8
:1006A0004F2BF80B4E2B9730F700F70B552B800B89
:1006B0004C2B8A110A12012C840183131F308305ED
:1006C000713083168F000F08031787110C30031346
:1006D0009900A23098009030831298008316031777
:1006E0000908C039890003131F129F120030031735
:1006F00088008312870188018901FF300313A0005D
:10070000831603170908C039890003131F129F12AB
:10071000003003178800831203131F139F138316DF
:100720009F1383121F149412A012200883168700AF
:10073000831220162008831687008312A011200838
:1007400083168700013083129400003083169400D2
:100750000108C73908388100831290010030F80081
:100760009200003083169200831220152008831611
:1007700087008312970183169B019C0101309D0025
:100780008312031787018801890104308D0000302E
:100790008F0003132720193003178D0000308F00BE
:1007A0000313272073297708A1007808A20079088D
:1007B000A3007A08A40054300C1EDC2B99003A30B8
:1007C0000C1EE02B990020300C1EE42B9900893080
:1007D00084002408A8002308A7002208A6002108F6
:1007E000A5000230A900592A0D300C1EF52B9900E6
:1007F0000A300C1EF92B99000230A100FA30A20039
:0A080000462BA10BFE2BD22B630048
:04400E00F52CFF3F4F
:00000001FF
;PIC16F887
;CRC=B7AC CREATED="19-7-13 17:14"
;CRC=8F98 CREATED="26-VIII-13 18:26"
/Modules/Sensors/LTS01A/SW/PIC16F887/main.lst
1,19 → 1,19
CCS PCM C Compiler, Version 4.106, 47914 19-7-13 17:14
CCS PCM C Compiler, Version 4.106, 47914 26-VIII-13 18:26
 
Filename: D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.lst
Filename: Z:\home\kaklik\svnMLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.lst
 
ROM used: 1725 words (21%)
ROM used: 1029 words (13%)
Largest free fragment is 2048
RAM used: 10 (3%) at main() level
38 (10%) worst case
36 (10%) worst case
Stack: 2 locations
 
*
0000: MOVLW 05
0000: MOVLW 03
0001: MOVWF 0A
0002: GOTO 574
0002: GOTO 35C
0003: NOP
.................... #include "D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.h"
.................... #include "main.h"
.................... #include <16F887.h>
.................... //////// Standard Header file for the PIC16F887 device ////////////////
.................... #device PIC16F887
37,588 → 37,535
....................
.................... #use delay(clock=8000000)
*
055E: MOVLW 28
055F: MOVWF 04
0560: BCF 03.7
0561: MOVF 00,W
0562: BTFSC 03.2
0563: GOTO 571
0564: MOVLW 02
0565: MOVWF 78
0566: CLRF 77
0567: DECFSZ 77,F
0568: GOTO 567
0569: DECFSZ 78,F
056A: GOTO 566
056B: MOVLW 97
056C: MOVWF 77
056D: DECFSZ 77,F
056E: GOTO 56D
056F: DECFSZ 00,F
0570: GOTO 564
0571: BCF 0A.3
0572: BCF 0A.4
0573: GOTO 6B9 (RETURN)
0346: MOVLW 22
0347: MOVWF 04
0348: BCF 03.7
0349: MOVF 00,W
034A: BTFSC 03.2
034B: GOTO 359
034C: MOVLW 02
034D: MOVWF 78
034E: CLRF 77
034F: DECFSZ 77,F
0350: GOTO 34F
0351: DECFSZ 78,F
0352: GOTO 34E
0353: MOVLW 97
0354: MOVWF 77
0355: DECFSZ 77,F
0356: GOTO 355
0357: DECFSZ 00,F
0358: GOTO 34C
0359: BCF 0A.3
035A: BCF 0A.4
035B: GOTO 401 (RETURN)
....................
....................
....................
.................... #define S_SDA PIN_C3
.................... #define S_SCL PIN_C4
.................... #define S_SDA PIN_C4
.................... #define S_SCL PIN_C3
.................... #use i2c(master, sda=S_SDA, scl=S_SCL)
*
008D: MOVLW 08
008E: MOVWF 78
008F: NOP
0090: BCF 07.4
0091: BCF 20.4
0092: MOVF 20,W
0093: BSF 03.5
0094: MOVWF 07
0095: NOP
0096: BCF 03.5
0097: RLF 27,F
0098: BCF 07.3
0099: BTFSS 03.0
009A: GOTO 0A1
009B: BSF 20.3
009C: MOVF 20,W
009D: BSF 03.5
009E: MOVWF 07
009F: GOTO 0A5
006F: MOVLW 08
0070: MOVWF 78
0071: NOP
0072: BCF 07.3
0073: BCF 20.3
0074: MOVF 20,W
0075: BSF 03.5
0076: MOVWF 07
0077: NOP
0078: BCF 03.5
0079: RLF 23,F
007A: BCF 07.4
007B: BTFSS 03.0
007C: GOTO 083
007D: BSF 20.4
007E: MOVF 20,W
007F: BSF 03.5
0080: MOVWF 07
0081: GOTO 087
0082: BCF 03.5
0083: BCF 20.4
0084: MOVF 20,W
0085: BSF 03.5
0086: MOVWF 07
0087: NOP
0088: BCF 03.5
0089: BSF 20.3
008A: MOVF 20,W
008B: BSF 03.5
008C: MOVWF 07
008D: BCF 03.5
008E: BTFSS 07.3
008F: GOTO 08E
0090: DECFSZ 78,F
0091: GOTO 071
0092: NOP
0093: BCF 07.3
0094: BCF 20.3
0095: MOVF 20,W
0096: BSF 03.5
0097: MOVWF 07
0098: NOP
0099: BCF 03.5
009A: BSF 20.4
009B: MOVF 20,W
009C: BSF 03.5
009D: MOVWF 07
009E: NOP
009F: NOP
00A0: BCF 03.5
00A1: BCF 20.3
00A1: BSF 20.3
00A2: MOVF 20,W
00A3: BSF 03.5
00A4: MOVWF 07
00A5: NOP
00A6: BCF 03.5
00A7: BSF 20.4
00A8: MOVF 20,W
00A9: BSF 03.5
00AA: MOVWF 07
00AB: BCF 03.5
00AC: BTFSS 07.4
00AD: GOTO 0AC
00AE: DECFSZ 78,F
00AF: GOTO 08F
00B0: NOP
00B1: BCF 07.4
00B2: BCF 20.4
00B3: MOVF 20,W
00B4: BSF 03.5
00B5: MOVWF 07
00B6: NOP
00A5: BCF 03.5
00A6: BTFSS 07.3
00A7: GOTO 0A6
00A8: CLRF 78
00A9: NOP
00AA: BTFSC 07.4
00AB: BSF 78.0
00AC: BCF 07.3
00AD: BCF 20.3
00AE: MOVF 20,W
00AF: BSF 03.5
00B0: MOVWF 07
00B1: BCF 03.5
00B2: BCF 07.4
00B3: BCF 20.4
00B4: MOVF 20,W
00B5: BSF 03.5
00B6: MOVWF 07
00B7: BCF 03.5
00B8: BSF 20.3
00B9: MOVF 20,W
00BA: BSF 03.5
00BB: MOVWF 07
00BC: NOP
00BD: NOP
00BE: BCF 03.5
00BF: BSF 20.4
00C0: MOVF 20,W
00C1: BSF 03.5
00C2: MOVWF 07
00C3: BCF 03.5
00C4: BTFSS 07.4
00C5: GOTO 0C4
00C6: CLRF 78
00C7: NOP
00C8: BTFSC 07.3
00C9: BSF 78.0
00CA: BCF 07.4
00CB: BCF 20.4
00CC: MOVF 20,W
00CD: BSF 03.5
00CE: MOVWF 07
00CF: BCF 03.5
00D0: BCF 07.3
00D1: BCF 20.3
00D2: MOVF 20,W
00D3: BSF 03.5
00D4: MOVWF 07
00D5: BCF 03.5
00D6: RETURN
00D7: MOVLW 08
00D8: MOVWF 28
00D9: MOVF 77,W
00DA: MOVWF 29
00DB: BSF 20.3
00DC: MOVF 20,W
00DD: BSF 03.5
00DE: MOVWF 07
00DF: NOP
00E0: BCF 03.5
00E1: BSF 20.4
00E2: MOVF 20,W
00E3: BSF 03.5
00E4: MOVWF 07
00E5: BCF 03.5
00E6: BTFSS 07.4
00E7: GOTO 0E6
00E8: BTFSC 07.3
00E9: BSF 03.0
00EA: BTFSS 07.3
00EB: BCF 03.0
00EC: RLF 78,F
00ED: NOP
00EE: BCF 20.4
00EF: MOVF 20,W
00F0: BSF 03.5
00F1: MOVWF 07
00F2: BCF 03.5
00F3: BCF 07.4
00F4: DECFSZ 28,F
00F5: GOTO 0DB
00F6: BSF 20.3
00F7: MOVF 20,W
00F8: BSF 03.5
00F9: MOVWF 07
00FA: NOP
00FB: BCF 03.5
00FC: BCF 07.3
00FD: MOVF 29,W
00FE: BTFSC 03.2
00FF: GOTO 105
0100: BCF 20.3
0101: MOVF 20,W
0102: BSF 03.5
0103: MOVWF 07
0104: BCF 03.5
0105: NOP
0106: BSF 20.4
0107: MOVF 20,W
0108: BSF 03.5
0109: MOVWF 07
010A: BCF 03.5
010B: BTFSS 07.4
010C: GOTO 10B
010D: NOP
010E: BCF 07.4
010F: BCF 20.4
0110: MOVF 20,W
0111: BSF 03.5
0112: MOVWF 07
0113: NOP
0114: BCF 03.5
0115: BCF 07.3
0116: BCF 20.3
0117: MOVF 20,W
0118: BSF 03.5
0119: MOVWF 07
011A: BCF 03.5
011B: RETURN
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD
*
0025: BSF 03.5
0026: BCF 06.3
0027: BCF 03.5
0028: BCF 06.3
0029: MOVLW 08
002A: MOVWF 78
002B: GOTO 02C
002C: NOP
002D: BSF 78.7
002E: GOTO 03D
002F: BCF 78.7
0030: RRF 34,F
0031: BTFSC 03.0
0032: BSF 06.3
0033: BTFSS 03.0
0034: BCF 06.3
0035: BSF 78.6
0036: GOTO 03D
0037: BCF 78.6
0038: DECFSZ 78,F
0039: GOTO 030
003A: GOTO 03B
003B: NOP
003C: BSF 06.3
003D: MOVLW 3F
003E: MOVWF 04
003F: DECFSZ 04,F
0040: GOTO 03F
0041: NOP
0042: BTFSC 78.7
0043: GOTO 02F
0044: BTFSC 78.6
0045: GOTO 037
0046: RETURN
00B8: RETURN
00B9: MOVLW 08
00BA: MOVWF 24
00BB: MOVF 77,W
00BC: MOVWF 25
00BD: BSF 20.4
00BE: MOVF 20,W
00BF: BSF 03.5
00C0: MOVWF 07
00C1: NOP
00C2: BCF 03.5
00C3: BSF 20.3
00C4: MOVF 20,W
00C5: BSF 03.5
00C6: MOVWF 07
00C7: BCF 03.5
00C8: BTFSS 07.3
00C9: GOTO 0C8
00CA: BTFSC 07.4
00CB: BSF 03.0
00CC: BTFSS 07.4
00CD: BCF 03.0
00CE: RLF 78,F
00CF: NOP
00D0: BCF 20.3
00D1: MOVF 20,W
00D2: BSF 03.5
00D3: MOVWF 07
00D4: BCF 03.5
00D5: BCF 07.3
00D6: DECFSZ 24,F
00D7: GOTO 0BD
00D8: BSF 20.4
00D9: MOVF 20,W
00DA: BSF 03.5
00DB: MOVWF 07
00DC: NOP
00DD: BCF 03.5
00DE: BCF 07.4
00DF: MOVF 25,W
00E0: BTFSC 03.2
00E1: GOTO 0E7
00E2: BCF 20.4
00E3: MOVF 20,W
00E4: BSF 03.5
00E5: MOVWF 07
00E6: BCF 03.5
00E7: NOP
00E8: BSF 20.3
00E9: MOVF 20,W
00EA: BSF 03.5
00EB: MOVWF 07
00EC: BCF 03.5
00ED: BTFSS 07.3
00EE: GOTO 0ED
00EF: NOP
00F0: BCF 07.3
00F1: BCF 20.3
00F2: MOVF 20,W
00F3: BSF 03.5
00F4: MOVWF 07
00F5: NOP
00F6: BCF 03.5
00F7: BCF 07.4
00F8: BCF 20.4
00F9: MOVF 20,W
00FA: BSF 03.5
00FB: MOVWF 07
00FC: BCF 03.5
00FD: RETURN
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8)
....................
.................... #include "../LTS01.h"
.................... //Adresa pro VDD, VDD, VDD W 0x9E R 0x9F
.................... //Adresa pro GND GND GND W 0x90 R 0x91
....................
.................... #define LTS01A_address 0x90
....................
.................... #include "LTS01.c"
.................... float LTS01_get_temp()
.................... {
.................... int8 MSB, LSB;
....................
.................... i2c_start();
*
0173: BSF 20.4
0174: MOVF 20,W
0175: BSF 03.5
0176: MOVWF 07
0177: NOP
0178: BCF 03.5
0179: BSF 20.3
017A: MOVF 20,W
017B: BSF 03.5
017C: MOVWF 07
017D: NOP
017E: BCF 03.5
017F: BCF 07.4
0180: BCF 20.4
0181: MOVF 20,W
0182: BSF 03.5
0183: MOVWF 07
0184: NOP
0185: BCF 03.5
0186: BCF 07.3
0187: BCF 20.3
0188: MOVF 20,W
0189: BSF 03.5
018A: MOVWF 07
.................... I2C_Write(LTS01A_address);
018B: MOVLW 90
018C: BCF 03.5
018D: MOVWF 23
018E: CALL 06F
.................... I2C_write(0x00);
018F: CLRF 23
0190: CALL 06F
.................... i2c_stop();
0191: BCF 20.4
0192: MOVF 20,W
0193: BSF 03.5
0194: MOVWF 07
0195: NOP
0196: BCF 03.5
0197: BSF 20.3
0198: MOVF 20,W
0199: BSF 03.5
019A: MOVWF 07
019B: BCF 03.5
019C: BTFSS 07.3
019D: GOTO 19C
019E: NOP
019F: GOTO 1A0
01A0: NOP
01A1: BSF 20.4
01A2: MOVF 20,W
01A3: BSF 03.5
01A4: MOVWF 07
01A5: NOP
.................... i2c_start();
01A6: BCF 03.5
01A7: BSF 20.4
01A8: MOVF 20,W
01A9: BSF 03.5
01AA: MOVWF 07
01AB: NOP
01AC: BCF 03.5
01AD: BSF 20.3
01AE: MOVF 20,W
01AF: BSF 03.5
01B0: MOVWF 07
01B1: NOP
01B2: BCF 03.5
01B3: BCF 07.4
01B4: BCF 20.4
01B5: MOVF 20,W
01B6: BSF 03.5
01B7: MOVWF 07
01B8: NOP
01B9: BCF 03.5
01BA: BCF 07.3
01BB: BCF 20.3
01BC: MOVF 20,W
01BD: BSF 03.5
01BE: MOVWF 07
.................... I2C_Write(LTS01A_address+1);
01BF: MOVLW 91
01C0: BCF 03.5
01C1: MOVWF 23
01C2: CALL 06F
.................... MSB=i2c_read(1);
01C3: MOVLW 01
01C4: MOVWF 77
01C5: CALL 0B9
01C6: MOVF 78,W
01C7: MOVWF 21
.................... LSB=i2c_read(0);
01C8: CLRF 77
01C9: CALL 0B9
01CA: MOVF 78,W
01CB: MOVWF 22
.................... i2c_stop();
01CC: BCF 20.4
01CD: MOVF 20,W
01CE: BSF 03.5
01CF: MOVWF 07
01D0: NOP
01D1: BCF 03.5
01D2: BSF 20.3
01D3: MOVF 20,W
01D4: BSF 03.5
01D5: MOVWF 07
01D6: BCF 03.5
01D7: BTFSS 07.3
01D8: GOTO 1D7
01D9: NOP
01DA: GOTO 1DB
01DB: NOP
01DC: BSF 20.4
01DD: MOVF 20,W
01DE: BSF 03.5
01DF: MOVWF 07
01E0: NOP
....................
.................... return (MAKE16(MSB,LSB) * 0.00390625 );
01E1: BCF 03.5
01E2: MOVF 21,W
01E3: MOVWF 24
01E4: MOVF 22,W
01E5: MOVWF 23
01E6: MOVF 24,W
01E7: MOVWF 26
01E8: MOVF 23,W
01E9: MOVWF 25
*
0206: MOVF 7A,W
0207: MOVWF 35
0208: MOVF 79,W
0209: MOVWF 34
020A: MOVF 78,W
020B: MOVWF 33
020C: MOVF 77,W
020D: MOVWF 32
020E: CLRF 39
020F: CLRF 38
0210: CLRF 37
0211: MOVLW 77
0212: MOVWF 36
0213: CALL 0FE
.................... }
0214: BCF 0A.3
0215: BCF 0A.4
0216: GOTO 3D3 (RETURN)
....................
....................
....................
....................
.................... void main()
.................... {
*
0574: CLRF 04
0575: BCF 03.7
0576: MOVLW 1F
0577: ANDWF 03,F
0578: MOVLW 71
0579: BSF 03.5
057A: MOVWF 0F
057B: MOVF 0F,W
057C: BCF 06.3
057D: BCF 03.5
057E: BSF 06.3
057F: BSF 03.5
0580: BSF 03.6
0581: MOVF 09,W
0582: ANDLW C0
0583: MOVWF 09
0584: BCF 03.6
0585: BCF 1F.4
0586: BCF 1F.5
0587: MOVLW 00
0588: BSF 03.6
0589: MOVWF 08
058A: BCF 03.5
058B: CLRF 07
058C: CLRF 08
058D: CLRF 09
035C: CLRF 04
035D: BCF 03.7
035E: MOVLW 1F
035F: ANDWF 03,F
0360: MOVLW 71
0361: BSF 03.5
0362: MOVWF 0F
0363: MOVF 0F,W
0364: BSF 03.6
0365: BCF 07.3
0366: MOVLW 0C
0367: BCF 03.6
0368: MOVWF 19
0369: MOVLW A2
036A: MOVWF 18
036B: MOVLW 90
036C: BCF 03.5
036D: MOVWF 18
036E: BSF 03.5
036F: BSF 03.6
0370: MOVF 09,W
0371: ANDLW C0
0372: MOVWF 09
0373: BCF 03.6
0374: BCF 1F.4
0375: BCF 1F.5
0376: MOVLW 00
0377: BSF 03.6
0378: MOVWF 08
0379: BCF 03.5
037A: CLRF 07
037B: CLRF 08
037C: CLRF 09
....................
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
*
0591: BSF 03.5
0592: BSF 03.6
0593: MOVF 09,W
0594: ANDLW C0
0595: MOVWF 09
0596: BCF 03.6
0597: BCF 1F.4
0598: BCF 1F.5
0599: MOVLW 00
059A: BSF 03.6
059B: MOVWF 08
0380: BSF 03.5
0381: BSF 03.6
0382: MOVF 09,W
0383: ANDLW C0
0384: MOVWF 09
0385: BCF 03.6
0386: BCF 1F.4
0387: BCF 1F.5
0388: MOVLW 00
0389: BSF 03.6
038A: MOVWF 08
.................... setup_adc(ADC_CLOCK_DIV_2);
059C: BCF 03.5
059D: BCF 03.6
059E: BCF 1F.6
059F: BCF 1F.7
05A0: BSF 03.5
05A1: BCF 1F.7
05A2: BCF 03.5
05A3: BSF 1F.0
038B: BCF 03.5
038C: BCF 03.6
038D: BCF 1F.6
038E: BCF 1F.7
038F: BSF 03.5
0390: BCF 1F.7
0391: BCF 03.5
0392: BSF 1F.0
.................... setup_spi(SPI_SS_DISABLED);
05A4: BCF 14.5
05A5: BCF 20.5
05A6: MOVF 20,W
05A7: BSF 03.5
05A8: MOVWF 07
05A9: BCF 03.5
05AA: BSF 20.4
05AB: MOVF 20,W
05AC: BSF 03.5
05AD: MOVWF 07
05AE: BCF 03.5
05AF: BCF 20.3
05B0: MOVF 20,W
05B1: BSF 03.5
05B2: MOVWF 07
05B3: MOVLW 01
05B4: BCF 03.5
05B5: MOVWF 14
05B6: MOVLW 00
05B7: BSF 03.5
05B8: MOVWF 14
0393: BCF 14.5
0394: BCF 20.5
0395: MOVF 20,W
0396: BSF 03.5
0397: MOVWF 07
0398: BCF 03.5
0399: BSF 20.4
039A: MOVF 20,W
039B: BSF 03.5
039C: MOVWF 07
039D: BCF 03.5
039E: BCF 20.3
039F: MOVF 20,W
03A0: BSF 03.5
03A1: MOVWF 07
03A2: MOVLW 01
03A3: BCF 03.5
03A4: MOVWF 14
03A5: MOVLW 00
03A6: BSF 03.5
03A7: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
05B9: MOVF 01,W
05BA: ANDLW C7
05BB: IORLW 08
05BC: MOVWF 01
03A8: MOVF 01,W
03A9: ANDLW C7
03AA: IORLW 08
03AB: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
05BD: BCF 03.5
05BE: CLRF 10
03AC: BCF 03.5
03AD: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
05BF: MOVLW 00
05C0: MOVWF 78
05C1: MOVWF 12
05C2: MOVLW 00
05C3: BSF 03.5
05C4: MOVWF 12
03AE: MOVLW 00
03AF: MOVWF 78
03B0: MOVWF 12
03B1: MOVLW 00
03B2: BSF 03.5
03B3: MOVWF 12
.................... setup_ccp1(CCP_OFF);
05C5: BCF 03.5
05C6: BSF 20.2
05C7: MOVF 20,W
05C8: BSF 03.5
05C9: MOVWF 07
05CA: BCF 03.5
05CB: CLRF 17
05CC: BSF 03.5
05CD: CLRF 1B
05CE: CLRF 1C
05CF: MOVLW 01
05D0: MOVWF 1D
03B4: BCF 03.5
03B5: BSF 20.2
03B6: MOVF 20,W
03B7: BSF 03.5
03B8: MOVWF 07
03B9: BCF 03.5
03BA: CLRF 17
03BB: BSF 03.5
03BC: CLRF 1B
03BD: CLRF 1C
03BE: MOVLW 01
03BF: MOVWF 1D
.................... setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
05D1: BCF 03.5
05D2: BSF 03.6
05D3: CLRF 07
05D4: CLRF 08
05D5: CLRF 09
03C0: BCF 03.5
03C1: BSF 03.6
03C2: CLRF 07
03C3: CLRF 08
03C4: CLRF 09
....................
.................... printf("Simple Thermomether \r\n",);
05D6: MOVLW 04
05D7: MOVWF 0D
05D8: MOVLW 00
05D9: MOVWF 0F
05DA: BCF 03.6
05DB: CALL 047
.................... printf("(c) MLAB 2013 JACHO \r\n",);
05DC: MOVLW 10
05DD: BSF 03.6
05DE: MOVWF 0D
05DF: MOVLW 00
05E0: MOVWF 0F
05E1: BCF 03.6
05E2: CALL 047
....................
.................... signed int8 MSB;
.................... byte LSB;
.................... float t;
.................... printf("Simple Thermomether with LTS01A sensor \r\n",);
03C5: MOVLW 04
03C6: MOVWF 0D
03C7: MOVLW 00
03C8: MOVWF 0F
03C9: BCF 03.6
03CA: CALL 027
.................... printf("(c) MLAB.cz 2013 JACHO \r\n",);
03CB: MOVLW 19
03CC: BSF 03.6
03CD: MOVWF 0D
03CE: MOVLW 00
03CF: MOVWF 0F
03D0: BCF 03.6
03D1: CALL 027
....................
.................... while(TRUE)
.................... {
....................
....................
....................
.................... i2c_start();
05E3: BSF 20.3
05E4: MOVF 20,W
05E5: BSF 03.5
05E6: MOVWF 07
05E7: NOP
05E8: BCF 03.5
05E9: BSF 20.4
05EA: MOVF 20,W
05EB: BSF 03.5
05EC: MOVWF 07
05ED: NOP
05EE: BCF 03.5
05EF: BCF 07.3
05F0: BCF 20.3
05F1: MOVF 20,W
05F2: BSF 03.5
05F3: MOVWF 07
05F4: NOP
05F5: BCF 03.5
05F6: BCF 07.4
05F7: BCF 20.4
05F8: MOVF 20,W
05F9: BSF 03.5
05FA: MOVWF 07
.................... I2C_Write(0x90);
05FB: MOVLW 90
05FC: BCF 03.5
05FD: MOVWF 27
05FE: CALL 08D
.................... I2C_write(0x00);
05FF: CLRF 27
0600: CALL 08D
.................... i2c_stop();
0601: BCF 20.3
0602: MOVF 20,W
0603: BSF 03.5
0604: MOVWF 07
0605: NOP
0606: BCF 03.5
0607: BSF 20.4
0608: MOVF 20,W
0609: BSF 03.5
060A: MOVWF 07
060B: BCF 03.5
060C: BTFSS 07.4
060D: GOTO 60C
060E: NOP
060F: GOTO 610
0610: NOP
0611: BSF 20.3
0612: MOVF 20,W
0613: BSF 03.5
0614: MOVWF 07
0615: NOP
.................... i2c_start();
0616: BCF 03.5
0617: BSF 20.3
0618: MOVF 20,W
0619: BSF 03.5
061A: MOVWF 07
061B: NOP
061C: BCF 03.5
061D: BSF 20.4
061E: MOVF 20,W
061F: BSF 03.5
0620: MOVWF 07
0621: NOP
0622: BCF 03.5
0623: BCF 07.3
0624: BCF 20.3
0625: MOVF 20,W
0626: BSF 03.5
0627: MOVWF 07
0628: NOP
0629: BCF 03.5
062A: BCF 07.4
062B: BCF 20.4
062C: MOVF 20,W
062D: BSF 03.5
062E: MOVWF 07
.................... I2C_Write(0x91);
062F: MOVLW 91
0630: BCF 03.5
0631: MOVWF 27
0632: CALL 08D
.................... MSB=i2c_read(1);
0633: MOVLW 01
0634: MOVWF 77
0635: CALL 0D7
0636: MOVF 78,W
0637: MOVWF 21
.................... LSB=i2c_read(0);
0638: CLRF 77
0639: CALL 0D7
063A: MOVF 78,W
063B: MOVWF 22
.................... i2c_stop();
063C: BCF 20.3
063D: MOVF 20,W
063E: BSF 03.5
063F: MOVWF 07
0640: NOP
0641: BCF 03.5
0642: BSF 20.4
0643: MOVF 20,W
0644: BSF 03.5
0645: MOVWF 07
0646: BCF 03.5
0647: BTFSS 07.4
0648: GOTO 647
0649: NOP
064A: GOTO 64B
064B: NOP
064C: BSF 20.3
064D: MOVF 20,W
064E: BSF 03.5
064F: MOVWF 07
0650: NOP
....................
.................... t = (float)(LSB)/256.0;
0651: BCF 03.5
0652: CLRF 28
0653: MOVF 22,W
0654: MOVWF 27
0655: GOTO 11C
0656: MOVF 77,W
0657: MOVWF 27
0658: MOVF 78,W
0659: MOVWF 28
065A: MOVF 79,W
065B: MOVWF 29
065C: MOVF 7A,W
065D: MOVWF 2A
065E: MOVWF 2E
065F: MOVF 79,W
0660: MOVWF 2D
0661: MOVF 78,W
0662: MOVWF 2C
0663: MOVF 77,W
0664: MOVWF 2B
0665: CLRF 32
0666: CLRF 31
0667: CLRF 30
0668: MOVLW 87
0669: MOVWF 2F
066A: GOTO 13B
066B: MOVF 7A,W
066C: MOVWF 26
066D: MOVF 79,W
066E: MOVWF 25
066F: MOVF 78,W
0670: MOVWF 24
0671: MOVF 77,W
0672: MOVWF 23
.................... t = (float)(MSB+t);
0673: CLRF 29
0674: MOVF 21,W
0675: MOVWF 28
0676: BTFSC 28.7
0677: DECF 29,F
0678: GOTO 207
0679: BCF 03.1
067A: MOVF 7A,W
067B: MOVWF 2B
067C: MOVF 79,W
067D: MOVWF 2A
067E: MOVF 78,W
067F: MOVWF 29
0680: MOVF 77,W
0681: MOVWF 28
0682: MOVF 26,W
0683: MOVWF 2F
0684: MOVF 25,W
0685: MOVWF 2E
0686: MOVF 24,W
0687: MOVWF 2D
0688: MOVF 23,W
0689: MOVWF 2C
068A: GOTO 22E
068B: MOVF 7A,W
068C: MOVWF 26
068D: MOVF 79,W
068E: MOVWF 25
068F: MOVF 78,W
0690: MOVWF 24
0691: MOVF 77,W
0692: MOVWF 23
....................
.................... printf("Teplota: %f (C)\r\n", t);
0693: MOVLW 1C
0694: BSF 03.6
0695: MOVWF 0D
0696: MOVLW 00
0697: MOVWF 0F
0698: BCF 03.0
0699: MOVLW 09
069A: BCF 03.6
069B: MOVWF 27
069C: CALL 371
069D: MOVLW 89
069E: MOVWF 04
069F: MOVF 26,W
06A0: MOVWF 2A
06A1: MOVF 25,W
06A2: MOVWF 29
06A3: MOVF 24,W
06A4: MOVWF 28
06A5: MOVF 23,W
06A6: MOVWF 27
06A7: MOVLW 02
06A8: MOVWF 2B
06A9: GOTO 402
06AA: MOVLW 21
06AB: BSF 03.6
06AC: MOVWF 0D
06AD: MOVLW 00
06AE: MOVWF 0F
06AF: BSF 03.0
06B0: MOVLW 06
06B1: BCF 03.6
06B2: MOVWF 27
06B3: CALL 371
.................... delay_ms(500);
06B4: MOVLW 02
06B5: MOVWF 27
06B6: MOVLW FA
06B7: MOVWF 28
06B8: GOTO 55E
06B9: DECFSZ 27,F
06BA: GOTO 6B6
.................... printf("T: %f\r\n", LTS01_get_temp());
03D2: GOTO 173
03D3: MOVF 77,W
03D4: MOVWF 21
03D5: MOVF 78,W
03D6: MOVWF 22
03D7: MOVF 79,W
03D8: MOVWF 23
03D9: MOVF 7A,W
03DA: MOVWF 24
03DB: MOVLW 54
03DC: BTFSS 0C.4
03DD: GOTO 3DC
03DE: MOVWF 19
03DF: MOVLW 3A
03E0: BTFSS 0C.4
03E1: GOTO 3E0
03E2: MOVWF 19
03E3: MOVLW 20
03E4: BTFSS 0C.4
03E5: GOTO 3E4
03E6: MOVWF 19
03E7: MOVLW 89
03E8: MOVWF 04
03E9: MOVF 24,W
03EA: MOVWF 28
03EB: MOVF 23,W
03EC: MOVWF 27
03ED: MOVF 22,W
03EE: MOVWF 26
03EF: MOVF 21,W
03F0: MOVWF 25
03F1: MOVLW 02
03F2: MOVWF 29
03F3: GOTO 259
03F4: MOVLW 0D
03F5: BTFSS 0C.4
03F6: GOTO 3F5
03F7: MOVWF 19
03F8: MOVLW 0A
03F9: BTFSS 0C.4
03FA: GOTO 3F9
03FB: MOVWF 19
.................... delay_ms(500);
03FC: MOVLW 02
03FD: MOVWF 21
03FE: MOVLW FA
03FF: MOVWF 22
0400: GOTO 346
0401: DECFSZ 21,F
0402: GOTO 3FE
.................... }
06BB: GOTO 5E3
0403: GOTO 3D2
.................... }
....................
06BC: SLEEP
0404: SLEEP
 
Configuration Fuses:
Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
/Modules/Sensors/LTS01A/SW/PIC16F887/main.pjt
1,10 → 1,10
[PROJECT]
Target=D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.hex
Target=main.hex
Development_Mode=
Processor_Text=PIC16F887
ToolSuite=CCS
Processor=0x887F
[D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main]
[main]
Type=4
Path=
FileList=
12,13 → 12,17
OptionString=
AdditionalOptionString=
[mru-list]
1=D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.c
1=main.c
[Windows]
0=0000 %S 0 0 796 451 3 0
[Units]
Link=0
Count=1
1=D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main
[Opened Files]
1=main.c
2=
3=C:\Program Files (x86)\PICC\devices\16F887.h
4=
[Target Data]
OptionString=-p +FM
FileList=Z:\home\kaklik\svnMLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.c
[Units]
Count=1
1=main (main)
/Modules/Sensors/LTS01A/SW/PIC16F887/main.sta
1,60 → 1,57
 
ROM used: 1725 (21%)
1725 (21%) including unused fragments
ROM used: 1029 (13%)
1029 (13%) including unused fragments
 
3 Average locations per line
66 Average locations per statement
2 Average locations per line
43 Average locations per statement
 
RAM used: 10 (3%) at main() level
38 (10%) worst case
36 (10%) worst case
 
Stack used: 2 worst case (out of 8 total available)
 
Lines Stmts % Files
----- ----- --- -----
53 26 100 main.c
32 14 58 main.c
20 0 0 main.h
423 0 0 C:\Program Files (x86)\PICC\devices\16F887.h
8 0 0 ..\LTS01.h
17 10 42 ..\LTS01.c
----- -----
496 26 Total
500 24 Total
 
Page ROM % RAM Vol Diff Functions:
---- --- --- --- --- ---- ----------
0 22 1 1 @delay_ms1
0 69 4 3 @I2C_READ_1
0 74 4 1 @I2C_WRITE_1
0 34 2 1 @PUTCHAR_1_
0 329 19 4 799 4.4 main
0 12 1 0 @const78
0 70 4 3 @PSTRINGC7_69
0 12 1 0 @const80
0 31 2 2 @ITOF
0 204 12 14 @DIVFF
0 39 2 2 @SITOF
0 323 19 16 @ADDFF
0 9 1 0 @const94
0 79 5 4 @PSTRINGCN7_69
Inline 13 @MULFF
0 22 2 1 @delay_ms1
0 69 7 3 @I2C_READ_1
0 74 7 1 @I2C_WRITE_1
0 164 16 4 282 3.6 LTS01_get_temp
Inline 2 @ITOF
0 117 11 13 799 4.4 @MULFF
0 169 16 4 354 2.7 MAIN
0 21 2 0 @const83
0 72 7 3 @PSTRINGC7_9600_62_63
0 14 1 0 @const85
Inline 5 @FTOSD
0 66 4 13 @DIV3232
0 348 20 13 @PRINTF_L32D_69FPFPF
0 66 6 13 @DIV3232
0 237 23 13 @PRINTF_L32D_9600_62_63FPFPF
 
Program metrics:
Functions 1
Statements 26
Comments 86
Volume (V) 840
Difficilty (D) 3.5
Effort to implement (E) 2918
Time to implement (T) 3 minutes
Functions 3
Statements 24
Comments 88
Volume (V) 1834
Difficilty (D) 10.0
Effort to implement (E) 18371
Time to implement (T) 17 minutes
Est Delivered Bugs (B) 0
Cyclomatic Complexity 1
Maintainability (MI) 132
Maintainability (MI) 147
 
Segment Used Free
----------- ---- ----
00000-00003 4 0
00004-007FF 1721 323
00004-007FF 1025 1019
00800-00FFF 0 2048
01000-017FF 0 2048
01800-01FFF 0 2048
/Modules/Sensors/LTS01A/SW/PIC16F887/main.sym
1,78 → 1,55
004-005 @READ_PROGRAM_MEMORY8.P1
004 @WRITE_PROGRAM_MEMORY8.P2
004 @WRITE_PROGRAM_MEMORY8.P1
004-005 @READ_PROGRAM_MEMORY8.P2
015 CCP_1_LOW
015 CCP_1
016 CCP_1_HIGH
01B CCP_2
01B CCP_2_LOW
01B CCP_2
01C CCP_2_HIGH
020 @TRIS_C
021 main.MSB
022 main.LSB
023-026 main.t
027 @I2C_WRITE_1.P1
027 @PSTRINGCN7_69.P2
027-028 @ITOF.P3
027-02A @PRINTF_L32D_69FPFPF.P4
027 @I2C_READ_1.P5
027 main.@SCRATCH1
027 @PSTRINGC7_69.@SCRATCH1
028-02B @ADDFF.P1
028 @delay_ms1.P2
028-029 @SITOF.P3
028 @I2C_READ_1.@SCRATCH1
028 main.@SCRATCH2
028 @PSTRINGC7_69.@SCRATCH2
028 @PSTRINGCN7_69.@SCRATCH1
029 @I2C_READ_1.@SCRATCH2
029 main.@SCRATCH3
029 @PSTRINGC7_69.@SCRATCH3
029 @PSTRINGCN7_69.@SCRATCH2
02A main.@SCRATCH4
02A @PSTRINGCN7_69.@SCRATCH3
02B-02E @DIVFF.P1
02B @PRINTF_L32D_69FPFPF.P2
02C-02F @ADDFF.P1
02C @PRINTF_L32D_69FPFPF.@SCRATCH1
02D @PRINTF_L32D_69FPFPF.@SCRATCH2
02E @PRINTF_L32D_69FPFPF.@SCRATCH3
02F-032 @DIVFF.P1
02F @PRINTF_L32D_69FPFPF.@SCRATCH4
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 @DIVFF.@SCRATCH1
033 @ADDFF.@SCRATCH4
033 @PRINTF_L32D_69FPFPF.@SCRATCH8
034 @PUTCHAR_1_.P1
034-037 @MULFF.P2
034-037 @FTOSD.P3
034-037 @DIV3232.P4
034 @DIVFF.@SCRATCH2
034 @ADDFF.@SCRATCH5
035 @DIVFF.@SCRATCH3
035 @ADDFF.@SCRATCH6
036 @DIVFF.@SCRATCH4
036 @ADDFF.@SCRATCH7
037 @DIVFF.@SCRATCH5
037 @ADDFF.@SCRATCH8
038-03B @DIV3232.P1
038-03B @MULFF.P2
038 @DIVFF.@SCRATCH6
038 @FTOSD.@SCRATCH1
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
021 LTS01_get_temp.MSB
021 MAIN.@SCRATCH1
021 @PSTRINGC7_9600_62_63.@SCRATCH1
022 @delay_ms1.P1
022 LTS01_get_temp.LSB
022 MAIN.@SCRATCH2
022 @PSTRINGC7_9600_62_63.@SCRATCH2
023 @I2C_WRITE_1.P1
023 @I2C_READ_1.P2
023 LTS01_get_temp.@SCRATCH1
023 MAIN.@SCRATCH3
023 @PSTRINGC7_9600_62_63.@SCRATCH3
024 @I2C_READ_1.@SCRATCH1
024 LTS01_get_temp.@SCRATCH2
024 MAIN.@SCRATCH4
025-026 @ITOF.P1
025-028 @PRINTF_L32D_9600_62_63FPFPF.P2
025 @I2C_READ_1.@SCRATCH2
029 @PRINTF_L32D_9600_62_63FPFPF.P1
02A @PRINTF_L32D_9600_62_63FPFPF.@SCRATCH1
02B @PRINTF_L32D_9600_62_63FPFPF.@SCRATCH2
02C @PRINTF_L32D_9600_62_63FPFPF.@SCRATCH3
02D @PRINTF_L32D_9600_62_63FPFPF.@SCRATCH4
02E @PRINTF_L32D_9600_62_63FPFPF.@SCRATCH5
02F @PRINTF_L32D_9600_62_63FPFPF.@SCRATCH6
030 @PRINTF_L32D_9600_62_63FPFPF.@SCRATCH7
031 @PRINTF_L32D_9600_62_63FPFPF.@SCRATCH8
032-035 @MULFF.P1
032-035 @DIV3232.P2
032-035 @FTOSD.P3
036-039 @MULFF.P1
036-039 @DIV3232.P2
036 @FTOSD.@SCRATCH1
03A @MULFF.@SCRATCH1
03A @DIV3232.@SCRATCH1
03B @MULFF.@SCRATCH2
03B @DIV3232.@SCRATCH2
03C @MULFF.@SCRATCH3
03C @DIV3232.@SCRATCH3
03D @MULFF.@SCRATCH4
03D @DIV3232.@SCRATCH4
03E @MULFF.@SCRATCH5
03E @DIV3232.@SCRATCH5
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
84,25 → 61,20
10D-10E @WRITE_PROGRAM_MEMORY8.P2
 
ROM Allocation:
055E @delay_ms1
00D7 @I2C_READ_1
008D @I2C_WRITE_1
0025 @PUTCHAR_1_
0574 main
0004 @const78
0047 @PSTRINGC7_69
0010 @const80
011C @ITOF
013B @DIVFF
0207 @SITOF
022E @ADDFF
001C @const94
0371 @PSTRINGCN7_69
0416 @MULFF
049C @FTOSD
03C0 @DIV3232
0402 @PRINTF_L32D_69FPFPF
0574 @cinit
0346 @delay_ms1
00B9 @I2C_READ_1
006F @I2C_WRITE_1
0173 LTS01_get_temp
01EA @ITOF
00FE @MULFF
035C MAIN
0004 @const83
0027 @PSTRINGC7_9600_62_63
0019 @const85
0280 @FTOSD
0217 @DIV3232
0259 @PRINTF_L32D_9600_62_63FPFPF
035C @cinit
 
 
User Memory space:
110,15 → 82,17
User Memory space:
 
Project Directory:
D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\
Z:\home\kaklik\svnMLAB\Modules\Sensors\LTS01A\SW\PIC16F887\
 
Project Files:
main.c
main.h
C:\Program Files (x86)\PICC\devices\16F887.h
..\LTS01.h
..\LTS01.c
 
Units:
D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main (main)
Z:\home\kaklik\svnMLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main (main)
 
Compiler Settings:
Processor: PIC16F887
/Modules/Sensors/LTS01A/SW/PIC16F887/main.tre
1,34 → 1,19
ÀÄmain
ÀÄmain 0/329 Ram=4
ÀÄMAIN 0/169 Ram=4
ÃÄ??0??
ÃÄ@PSTRINGC7_69 0/70 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PSTRINGC7_69 0/70 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 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
ÃÄ@I2C_READ_1 0/69 Ram=3
ÃÄ@ITOF 0/31 Ram=2
ÃÄ@DIVFF 0/204 Ram=14
ÃÄ@SITOF 0/39 Ram=2
ÃÄ@ADDFF 0/323 Ram=16
ÃÄ@PSTRINGCN7_69 0/79 Ram=4
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 Ram=1
ÃÄ@PRINTF_L32D_69FPFPF 0/348 Ram=13
³ ÃÄ@MULFF (Inline) Ram=13
ÃÄ@PSTRINGC7_9600_62_63 0/72 Ram=3
ÃÄ@PSTRINGC7_9600_62_63 0/72 Ram=3
ÃÄLTS01_get_temp 0/164 Ram=4
³ ÃÄ@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_READ_1 0/69 Ram=3
³ ÃÄ@ITOF (Inline) Ram=2
³ ÀÄ@MULFF 0/117 Ram=13
ÃÄ@PRINTF_L32D_9600_62_63FPFPF 0/237 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
ÃÄ@PSTRINGCN7_69 0/79 Ram=4
³ ÃÄ@PUTCHAR_1_ 0/34 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/34 Ram=1
ÀÄ@delay_ms1 0/22 Ram=1
/Modules/Sensors/MAG01A/SW/PIC16F887/main.c
4,11 → 4,6
 
void main()
{
float last,b,anemo_speed;
unsigned int16 anemo_round=0;
unsigned int16 i;
 
//signed int16 X,Y,Z;
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_spi(SPI_SS_DISABLED);
16,10 → 11,10
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
setup_comparator(NC_NC_NC_NC);
 
printf("Magnetometr: \r\n",);
printf("(c)mlab JACHO 2013: \r\n",);
printf("(c)mlab.cz kaklik 2013: \r\n",);
printf("X, Y, Z \r\n",);
 
 
26,7 → 21,7
// Init the HMC5883L. Set Mode register for
// continuous measurements.
hmc5883l_write_reg(HMC5883L_CFG_A_REG, 0x18); // no average, maximal update range
hmc5883l_write_reg(HMC5883L_CFG_B_REG, 0xE0); // maximal range
hmc5883l_write_reg(HMC5883L_CFG_B_REG, 0x00); // minimal range
hmc5883l_write_reg(HMC5883L_MODE_REG, 0x00);
 
// Continuously read and display the x,y,z results.
/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,7 → 1,2
>>> 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=10% RAM=8% - 10%
0 Errors, 5 Warnings.
Memory usage: ROM=9% RAM=3% - 6%
0 Errors, 0 Warnings.
/Modules/Sensors/MAG01A/SW/PIC16F887/main.esym
1,7 → 1,7
D G "__PCM__" 0 0 ""4.106""
D G "__DEVICE__" 0 0 ""
D G "__DATE__" 0 0 ""17-V-13""
D G "__TIME__" 0 0 ""12:14:46"" "Standard Header file for the PIC16F887 device ////////////////"
D G "__PCM__" 0 44 ""4.106""
D G "__DEVICE__" 0 44 "887"
D G "__DATE__" 0 44 ""25-VIII-13""
D G "__TIME__" 0 44 ""18:55:43"" "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"
288,10 → 288,10
D G "MAG_ROZ560" 3 19 "0xC0"
D G "MAG_ROZ810" 3 20 "0xE0"
C L "hmc5883l_write_reg" 4 2 1 "FUNCTION"
F G "hmc5883l_write_reg" 4 4 "void()"
F G "hmc5883l_write_reg" 4 4 "void(int8 reg,int8 data)"
V L "reg" 4 4 "int8"
V L "data" 4 4 "int8"
F G "hmc5883l_read_reg" 4 14 "int8()"
F G "hmc5883l_read_reg" 4 14 "int8(int8 reg)"
V L "reg" 4 14 "int8"
V L "retval" 4 16 "int8"
T G "hmc5883l_result" 4 35 "{sint16 x,sint16 y,sint16 z}" "This global structure holds the values read"
310,7 → 310,7
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()"
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"
318,20 → 318,20
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()"
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()"
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()"
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()"
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"
342,7 → 342,7
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()"
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"
352,23 → 352,23
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()"
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()"
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()"
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()"
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()"
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"
375,7 → 375,7
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()"
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"
393,16 → 393,16
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()"
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()"
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()"
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"
413,17 → 413,17
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()"
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()"
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()"
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"
432,7 → 432,7
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()"
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"
441,36 → 441,30
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()"
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()"
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()"
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()"
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()"
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 19 1 "FUNCTION"
C L "MAIN" 0 19 2 "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 21 2 "FUNCTION"
C L "MAIN" 0 21 1 "FUNCTION"
C L "MAIN" 0 21 1 "FUNCTION"
C L "MAIN" 0 21 2 "FUNCTION"
F B "reset_cpu" 0 0
F B "abs" 1 0
F B "sleep_ulpwu" 1 0
603,3 → 597,5
F B "getch" 0 1
F B "gets" 1 3
F B "kbhit" 0 1
F B "set_uart_speed" 1 3
F B "setup_uart" 1 3
/Modules/Sensors/MAG01A/SW/PIC16F887/main.h
17,5 → 17,5
 
#use delay(clock=8000000)
#use i2c(Master,Slow,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=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) //rcv TXD xmit RXD
 
/Modules/Sensors/MAG01A/SW/PIC16F887/main.hex
1,104 → 1,100
:1000000002308A00662A0000CD306737653AEF3645
:1000000002308A003C2A0000CD306737653AEF366F
:10001000653A721D20100D050000A831A936EC309C
:100020006210CA2043244F103218B1193A10A006AA
:100030000A005816A02C2C105A100D050001A01310
:10004000200883168700831287130830F8002828B9
:100050000000F8173928F813C00C03188717031C81
:100060008713781739287813F80B2C2837280000C5
:1000700087173F308400840B3B280000F81B2B2897
:10008000781B33280800831603178C170C14000004
:10009000000083120C087F39031987280313B70067
:1000A00003170D080313B80003170F080313B90053
:1000B0003708C0001F20380803178D0003133908C4
:1000C00003178F0083168C170C1400000000831296
:1000D0000C0D0E0D7F39031987280313B700031782
:1000E0000D080313B80003170F080313B9003708EE
:1000F000C0001F20380803178D00031339080317A9
:100100008F008D0A03198F0A031343280317031363
:1001100008000830F80000008711A011200883169D
:10012000870000008312BD0D0712031C9D282016B6
:10013000200883168700A128831220122008831626
:10014000870000008312A015200883168700831201
:10015000871DA828F80B8B2800008711A011200804
:10016000831687000000831220162008831687005C
:10017000000000008312A015200883168700831258
:10018000871DC028F8010000071A78148711A011F4
:100190002008831687008312071220122008831676
:1001A00087008312080020162008831687000000AD
:1001B0008312A015200883168700000083120712FF
:1001C0002012200883168700000083128711A011D7
:1001D0002008831687003C308312BD008920370831
:1001E000BD0089203808BD00892020122008831610
:1001F000870000008312A015200883168700831251
:10020000871D0029000004290000201620088316FD
:1002100087000000831208000830BE007708BF0086
:10022000201620088316870000008312A0152008DE
:10023000831687008312871D1B29071A0314071EC4
:100240000310F80D0000A011200883168700831208
:100250008711BE0B10292016200883168700000086
:10026000831207123F0803193A2920122008831627
:10027000870083120000A0152008831687008312D0
:10028000871D402900008711A011200883168700D0
:1002900000008312071220122008831687008312A1
:1002A0000800201620088316870000008312A0157E
:1002B00020088316870000008312071220122008EE
:1002C00083168700000083128711A011200883166F
:1002D00087003C308312BD0089200330BD00892097
:1002E000201620088316870000008312A01520081E
:1002F0008316870000008312871D7C2907122012B5
:10030000200883168700000083128711A01120089F
:10031000831687003D308312BD0089200130F7002D
:100320000C217808B8000130F7000C217808B700DC
:100330000130F7000C217808BC000130F7000C21D7
:100340007808BB000130F7000C217808BA00F701EB
:100350000C217808B90020122008831687000000BD
:100360008312A0152008831687008312871DB629E3
:100370000000BA290000201620088316870000001C
:1003800083123808A2003708A1003A08A4003908EF
:10039000A3003C08A6003B08A5008A110A12F62A11
:1003A000BF010408BE003F10831B3F14B81FE029A3
:1003B000BE173E1EBE0AB709B809B70A0319B80A24
:1003C000380EF038BA00BA07E23EBB00323EBD003C
:1003D00038080F39BB07BB07BD07E93EBC00BC07A7
:1003E000BC07370E0F39BC07BD07BC0DBD0DBD09DD
:1003F000BD0D37080F39BD07BA0D0730B9000A30F7
:10040000BD07BC03031C002ABC07BB03031C042A52
:10041000BB07BA03031C082ABA07B903031C0C2A3A
:1004200039308400831307303E053E1384033E05B4
:10043000031D212A3E1A840A3E1A212A2030F70081
:100440003E2A84073D30040203193E170008F700D6
:10045000031D322A3E1B322A3E1A4C2ABE19322A6A
:1004600020303D2ABE1F3A2A2D30F70084033E1368
:10047000BE133E2ABE153E123030F707B8010408FD
:10048000B7003810831B38147708C0001F203708C6
:100490008400831338188317840A3E1F222A080019
:1004A00037308400831300080319632A0230F800F0
:1004B000F701F70B592AF80B582A9730F700F70B7A
:1004C0005F2A800B562A8A110A121D2B840183137E
:1004D0001F308305713083168F000F088312A0131D
:1004E00020088316870083128717831603170908CD
:1004F000C039890003131F129F12003003178800B0
:100500008312870188018901FF300313A000A10134
:10051000A201A301A401A501A601B401B3018316A0
:1005200003170908C039890003131F129F120030F6
:1005300003178800831203131F139F1383169F133F
:1005400083121F149412A0122008831687008312AE
:1005500020162008831687008312A0112008831616
:100560008700013083129400003083169400010844
:10057000C73908388100831290010030F8009200DA
:1005800000308316920083122015200883168700FE
:100590008312970183169B019C0101309D008312F9
:1005A000031787018801890104308D0000308F0016
:1005B000031343200D3003178D0000308F00031309
:1005C0004320193003178D0000308F0003134320A0
:1005D000B7011830B800D3200130B700E030B800C0
:1005E000D3200230B700B801D32051290030840055
:1005F0002208B8002108B700D0212030C0001F20F9
:10060000003084002408B8002308B700D02120302F
:10061000C0001F20003084002608B8002508B7005D
:10062000D0212030C0001F200A30C0001F200D3014
:0E063000C0001F206430B700502AF52A630076
:100020006217633DA035E135EC346B103218B1191D
:100030003A10A0060A005816A02C2C105A100D05D4
:100040000001831603178C170C14000000008312A4
:100050000C087F39031967280313A70003170D083D
:100060000313A80003170F080313A90027080C1E89
:1000700037289900280803178D0003132908031750
:100080008F0083168C170C140000000083120C0DD7
:100090000E0D7F39031967280313A70003170D08F6
:1000A0000313A80003170F080313A90027080C1E49
:1000B00057289900280803178D00031329080317F0
:1000C0008F008D0A03198F0A0313212803170313C6
:1000D00008000830F80000008711A01120088316DE
:1000E000870000008312AD0D0712031C7D28201627
:1000F0002008831687008128831220122008831687
:10010000870000008312A015200883168700831241
:10011000871D8828F80B6B2800008711A011200884
:10012000831687000000831220162008831687009C
:10013000000000008312A015200883168700831298
:10014000871DA028F8010000071A78148711A01154
:1001500020088316870083120712201220088316B6
:1001600087008312080020162008831687000000ED
:100170008312A0152008831687000000831207123F
:100180002012200883168700000083128711A01117
:100190002008831687003C308312AD0069202708B1
:1001A000AD0069202808AD006920201220088316C0
:1001B000870000008312A015200883168700831291
:1001C000871DE0280000E428000020162008831680
:1001D00087000000831208000830AE007708AF00E7
:1001E000201620088316870000008312A01520081F
:1001F000831687008312871DFB28071A0314071E26
:100200000310F80D0000A011200883168700831248
:100210008711AE0BF02820162008831687000000F7
:10022000831207122F0803191A2920122008831697
:10023000870083120000A015200883168700831210
:10024000871D202900008711A01120088316870030
:1002500000008312071220122008831687008312E1
:100260000800201620088316870000008312A015BE
:10027000200883168700000083120712201220082E
:1002800083168700000083128711A01120088316AF
:1002900087003C308312AD0069200330AD00692037
:1002A000201620088316870000008312A01520085E
:1002B0008316870000008312871D5C290712201215
:1002C000200883168700000083128711A0112008E0
:1002D000831687003D308312AD0069200130F7009E
:1002E000EC207808A8000130F700EC207808A7007F
:1002F0000130F700EC207808AC000130F700EC206A
:100300007808AB000130F700EC207808AA00F7016C
:10031000EC207808A900201220088316870000002E
:100320008312A0152008831687008312871D962943
:1003300000009A290000201620088316870000007C
:1003400083122808A2002708A1002A08A40029086F
:10035000A3002C08A6002B08A5008A110A12CC2A9B
:10036000AF010408AE002F10831B2F14A81FC02953
:10037000AE172E1EAE0AA709A809A70A0319A80AD4
:10038000280EF038AA00AA07E23EAB00323EAD00CC
:1003900028080F39AB07AB07AD07E93EAC00AC0747
:1003A000AC07270E0F39AC07AD07AC0DAD0DAD098D
:1003B000AD0D27080F39AD07AA0D0730A9000A3087
:1003C000AD07AC03031CE029AC07AB03031CE42915
:1003D000AB07AA03031CE829AA07A903031CEC29FD
:1003E00029308400831307302E052E1384032E0535
:1003F000031D012A2E1A840A2E1A012A2030F70022
:100400001E2A84072D30040203192E170008F70056
:10041000031D122A2E1B122A2E1A222AAE19122A64
:1004200020301D2AAE1F1A2A2D30F70084032E1308
:10043000AE131E2AAE152E123030F70777080C1EA9
:100440001F2A9900840A2E1F022A080027308400E0
:10045000831300080319392A0230F800F701F70B5B
:100460002F2AF80B2E2A9730F700F70B352A800B2E
:100470002C2A8A110A12F82A840183131F3083055B
:10048000713083168F000F08031787110C30031388
:100490009900A230980090308312980083160317B9
:1004A0000908C039890003131F129F120030031777
:1004B00088008312870188018901FF300313A0009F
:1004C000A101A201A301A401A501A601831603179E
:1004D0000908C039890003131F129F120030031747
:1004E0008800831203131F139F1383169F13831215
:1004F0001F149412A012200883168700831220165E
:100500002008831687008312A01120088316870015
:100510000130831294000030831694000108C7391B
:1005200008388100831290010030F80092000030FA
:1005300083169200831220152008831687008312E9
:10054000970183169B019C0101309D0083120317C4
:1005500087018801890104308D0000308F0003136A
:1005600021200D3003178D0000308F000313212050
:100570001B3003178D0000308F0003132120A701CB
:100580001830A800B3200130A700A801B320023022
:10059000A700A801B3203129003084002208A80058
:1005A0002108A700B02120300C1ED42A9900003069
:1005B00084002408A8002308A700B02120300C1EC6
:1005C000DF2A9900003084002608A8002508A7002B
:1005D000B02120300C1EEA2A99000A300C1EEE2AA7
:1005E00099000D300C1EF22A99006430A700262ACB
:0405F000CB2A6300AF
:04400E00F52CFF3F4F
:00000001FF
;PIC16F887
;CRC=17FE CREATED="17-V-13 12:14"
;CRC=2B66 CREATED="25-VIII-13 18:55"
/Modules/Sensors/MAG01A/SW/PIC16F887/main.lst
1,17 → 1,17
CCS PCM C Compiler, Version 4.106, 47914 17-V-13 12:14
CCS PCM C Compiler, Version 4.106, 47914 25-VIII-13 18:55
 
Filename: Z:\home\kaklik\svnMLAB\Modules\Sensors\MAG01A\SW\PIC16F887\main.lst
 
ROM used: 799 words (10%)
ROM used: 762 words (9%)
Largest free fragment is 2048
RAM used: 28 (8%) at main() level
38 (10%) worst case
RAM used: 12 (3%) at main() level
21 (6%) worst case
Stack: 2 locations
 
*
0000: MOVLW 02
0001: MOVWF 0A
0002: GOTO 266
0002: GOTO 23C
0003: NOP
.................... #include "main.h"
.................... #include <16F887.h>
37,212 → 37,175
....................
.................... #use delay(clock=8000000)
*
0250: MOVLW 37
0251: MOVWF 04
0252: BCF 03.7
0253: MOVF 00,W
0254: BTFSC 03.2
0255: GOTO 263
0256: MOVLW 02
0257: MOVWF 78
0258: CLRF 77
0259: DECFSZ 77,F
025A: GOTO 259
025B: DECFSZ 78,F
025C: GOTO 258
025D: MOVLW 97
025E: MOVWF 77
025F: DECFSZ 77,F
0260: GOTO 25F
0261: DECFSZ 00,F
0262: GOTO 256
0263: BCF 0A.3
0264: BCF 0A.4
0265: GOTO 31D (RETURN)
0226: MOVLW 27
0227: MOVWF 04
0228: BCF 03.7
0229: MOVF 00,W
022A: BTFSC 03.2
022B: GOTO 239
022C: MOVLW 02
022D: MOVWF 78
022E: CLRF 77
022F: DECFSZ 77,F
0230: GOTO 22F
0231: DECFSZ 78,F
0232: GOTO 22E
0233: MOVLW 97
0234: MOVWF 77
0235: DECFSZ 77,F
0236: GOTO 235
0237: DECFSZ 00,F
0238: GOTO 22C
0239: BCF 0A.3
023A: BCF 0A.4
023B: GOTO 2F8 (RETURN)
.................... #use i2c(Master,Slow,sda=PIN_C4,scl=PIN_C3)
*
0089: MOVLW 08
008A: MOVWF 78
008B: NOP
008C: BCF 07.3
008D: BCF 20.3
008E: MOVF 20,W
008F: BSF 03.5
0090: MOVWF 07
0091: NOP
0092: BCF 03.5
0093: RLF 3D,F
0094: BCF 07.4
0095: BTFSS 03.0
0096: GOTO 09D
0097: BSF 20.4
0098: MOVF 20,W
0099: BSF 03.5
009A: MOVWF 07
009B: GOTO 0A1
009C: BCF 03.5
009D: BCF 20.4
009E: MOVF 20,W
009F: BSF 03.5
00A0: MOVWF 07
00A1: NOP
00A2: BCF 03.5
00A3: BSF 20.3
00A4: MOVF 20,W
00A5: BSF 03.5
00A6: MOVWF 07
00A7: BCF 03.5
00A8: BTFSS 07.3
00A9: GOTO 0A8
00AA: DECFSZ 78,F
00AB: GOTO 08B
00AC: NOP
00AD: BCF 07.3
00AE: BCF 20.3
00AF: MOVF 20,W
00B0: BSF 03.5
00B1: MOVWF 07
00B2: NOP
00B3: BCF 03.5
00B4: BSF 20.4
00B5: MOVF 20,W
00B6: BSF 03.5
00B7: MOVWF 07
00B8: NOP
00B9: NOP
00BA: BCF 03.5
00BB: BSF 20.3
00BC: MOVF 20,W
00BD: BSF 03.5
00BE: MOVWF 07
00BF: BCF 03.5
00C0: BTFSS 07.3
00C1: GOTO 0C0
00C2: CLRF 78
00C3: NOP
00C4: BTFSC 07.4
00C5: BSF 78.0
00C6: BCF 07.3
00C7: BCF 20.3
00C8: MOVF 20,W
00C9: BSF 03.5
00CA: MOVWF 07
00CB: BCF 03.5
00CC: BCF 07.4
00CD: BCF 20.4
00CE: MOVF 20,W
00CF: BSF 03.5
00D0: MOVWF 07
00D1: BCF 03.5
00D2: RETURN
0069: MOVLW 08
006A: MOVWF 78
006B: NOP
006C: BCF 07.3
006D: BCF 20.3
006E: MOVF 20,W
006F: BSF 03.5
0070: MOVWF 07
0071: NOP
0072: BCF 03.5
0073: RLF 2D,F
0074: BCF 07.4
0075: BTFSS 03.0
0076: GOTO 07D
0077: BSF 20.4
0078: MOVF 20,W
0079: BSF 03.5
007A: MOVWF 07
007B: GOTO 081
007C: BCF 03.5
007D: BCF 20.4
007E: MOVF 20,W
007F: BSF 03.5
0080: MOVWF 07
0081: NOP
0082: BCF 03.5
0083: BSF 20.3
0084: MOVF 20,W
0085: BSF 03.5
0086: MOVWF 07
0087: BCF 03.5
0088: BTFSS 07.3
0089: GOTO 088
008A: DECFSZ 78,F
008B: GOTO 06B
008C: NOP
008D: BCF 07.3
008E: BCF 20.3
008F: MOVF 20,W
0090: BSF 03.5
0091: MOVWF 07
0092: NOP
0093: BCF 03.5
0094: BSF 20.4
0095: MOVF 20,W
0096: BSF 03.5
0097: MOVWF 07
0098: NOP
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: BTFSS 07.3
00A1: GOTO 0A0
00A2: CLRF 78
00A3: NOP
00A4: BTFSC 07.4
00A5: BSF 78.0
00A6: BCF 07.3
00A7: BCF 20.3
00A8: MOVF 20,W
00A9: BSF 03.5
00AA: MOVWF 07
00AB: BCF 03.5
00AC: BCF 07.4
00AD: BCF 20.4
00AE: MOVF 20,W
00AF: BSF 03.5
00B0: MOVWF 07
00B1: BCF 03.5
00B2: RETURN
*
010C: MOVLW 08
010D: MOVWF 3E
010E: MOVF 77,W
010F: MOVWF 3F
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
00EC: MOVLW 08
00ED: MOVWF 2E
00EE: MOVF 77,W
00EF: MOVWF 2F
00F0: BSF 20.4
00F1: MOVF 20,W
00F2: BSF 03.5
00F3: MOVWF 07
00F4: NOP
00F5: BCF 03.5
00F6: BSF 20.3
00F7: MOVF 20,W
00F8: BSF 03.5
00F9: MOVWF 07
00FA: BCF 03.5
00FB: BTFSS 07.3
00FC: GOTO 0FB
00FD: BTFSC 07.4
00FE: BSF 03.0
00FF: BTFSS 07.4
0100: BCF 03.0
0101: RLF 78,F
0102: NOP
0103: BCF 20.3
0104: MOVF 20,W
0105: BSF 03.5
0106: MOVWF 07
0107: BCF 03.5
0108: BCF 07.3
0109: DECFSZ 2E,F
010A: GOTO 0F0
010B: BSF 20.4
010C: MOVF 20,W
010D: BSF 03.5
010E: MOVWF 07
010F: NOP
0110: BCF 03.5
0111: BCF 07.4
0112: MOVF 2F,W
0113: BTFSC 03.2
0114: GOTO 11A
0115: BCF 20.4
0116: MOVF 20,W
0117: BSF 03.5
0118: MOVWF 07
0119: BCF 03.5
011A: NOP
011B: BSF 20.3
011C: MOVF 20,W
011D: BSF 03.5
011E: MOVWF 07
011F: BCF 03.5
0120: BTFSS 07.3
0121: GOTO 120
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 3E,F
012A: GOTO 110
012B: BSF 20.4
0123: BCF 07.3
0124: BCF 20.3
0125: MOVF 20,W
0126: BSF 03.5
0127: MOVWF 07
0128: NOP
0129: BCF 03.5
012A: BCF 07.4
012B: BCF 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 3F,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
*
001F: BCF 20.7
0020: MOVF 20,W
0021: BSF 03.5
0022: MOVWF 07
0023: BCF 03.5
0024: BCF 07.7
0025: MOVLW 08
0026: MOVWF 78
0027: GOTO 028
0028: NOP
0029: BSF 78.7
002A: GOTO 039
002B: BCF 78.7
002C: RRF 40,F
002D: BTFSC 03.0
002E: BSF 07.7
002F: BTFSS 03.0
0030: BCF 07.7
0031: BSF 78.6
0032: GOTO 039
0033: BCF 78.6
0034: DECFSZ 78,F
0035: GOTO 02C
0036: GOTO 037
0037: NOP
0038: BSF 07.7
0039: MOVLW 3F
003A: MOVWF 04
003B: DECFSZ 04,F
003C: GOTO 03B
003D: NOP
003E: BTFSC 78.7
003F: GOTO 02B
0040: BTFSC 78.6
0041: GOTO 033
0042: RETURN
012F: BCF 03.5
0130: RETURN
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8) //rcv TXD xmit RXD
....................
....................
.................... #include "HMC5883L.h"
276,68 → 239,68
.................... {
.................... i2c_start();
*
00D3: BSF 20.4
00D4: MOVF 20,W
00D5: BSF 03.5
00D6: MOVWF 07
00D7: NOP
00D8: BCF 03.5
00D9: BSF 20.3
00DA: MOVF 20,W
00DB: BSF 03.5
00DC: MOVWF 07
00DD: NOP
00DE: BCF 03.5
00DF: BCF 07.4
00E0: BCF 20.4
00E1: MOVF 20,W
00E2: BSF 03.5
00E3: MOVWF 07
00E4: NOP
00E5: BCF 03.5
00E6: BCF 07.3
00E7: BCF 20.3
00E8: MOVF 20,W
00E9: BSF 03.5
00EA: MOVWF 07
00B3: BSF 20.4
00B4: MOVF 20,W
00B5: BSF 03.5
00B6: MOVWF 07
00B7: NOP
00B8: BCF 03.5
00B9: BSF 20.3
00BA: MOVF 20,W
00BB: BSF 03.5
00BC: MOVWF 07
00BD: NOP
00BE: BCF 03.5
00BF: BCF 07.4
00C0: BCF 20.4
00C1: MOVF 20,W
00C2: BSF 03.5
00C3: MOVWF 07
00C4: NOP
00C5: BCF 03.5
00C6: BCF 07.3
00C7: BCF 20.3
00C8: MOVF 20,W
00C9: BSF 03.5
00CA: MOVWF 07
.................... i2c_write(HMC5883L_WRT_ADDR);
00EB: MOVLW 3C
00EC: BCF 03.5
00ED: MOVWF 3D
00EE: CALL 089
00CB: MOVLW 3C
00CC: BCF 03.5
00CD: MOVWF 2D
00CE: CALL 069
.................... i2c_write(reg);
00EF: MOVF 37,W
00F0: MOVWF 3D
00F1: CALL 089
00CF: MOVF 27,W
00D0: MOVWF 2D
00D1: CALL 069
.................... i2c_write(data);
00F2: MOVF 38,W
00F3: MOVWF 3D
00F4: CALL 089
00D2: MOVF 28,W
00D3: MOVWF 2D
00D4: CALL 069
.................... i2c_stop();
00F5: BCF 20.4
00F6: MOVF 20,W
00F7: BSF 03.5
00F8: MOVWF 07
00F9: NOP
00FA: BCF 03.5
00FB: BSF 20.3
00FC: MOVF 20,W
00FD: BSF 03.5
00FE: MOVWF 07
00FF: BCF 03.5
0100: BTFSS 07.3
0101: GOTO 100
0102: NOP
0103: GOTO 104
0104: NOP
0105: BSF 20.4
0106: MOVF 20,W
0107: BSF 03.5
0108: MOVWF 07
0109: NOP
00D5: BCF 20.4
00D6: MOVF 20,W
00D7: BSF 03.5
00D8: MOVWF 07
00D9: NOP
00DA: BCF 03.5
00DB: BSF 20.3
00DC: MOVF 20,W
00DD: BSF 03.5
00DE: MOVWF 07
00DF: BCF 03.5
00E0: BTFSS 07.3
00E1: GOTO 0E0
00E2: NOP
00E3: GOTO 0E4
00E4: NOP
00E5: BSF 20.4
00E6: MOVF 20,W
00E7: BSF 03.5
00E8: MOVWF 07
00E9: NOP
.................... }
010A: BCF 03.5
010B: RETURN
00EA: BCF 03.5
00EB: RETURN
....................
.................... //------------------------------
.................... int8 hmc5883l_read_reg(int8 reg)
367,12 → 330,12
.................... // from the HMC5883L x,y,z registers.
.................... hmc5883l_result compass = {0,0,0};
*
0287: CLRF 21
0288: CLRF 22
0289: CLRF 23
028A: CLRF 24
028B: CLRF 25
028C: CLRF 26
0260: CLRF 21
0261: CLRF 22
0262: CLRF 23
0263: CLRF 24
0264: CLRF 25
0265: CLRF 26
....................
.................... //------------------------------
.................... void hmc5883l_read_data(void)
388,154 → 351,154
....................
.................... 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
0131: BSF 20.4
0132: MOVF 20,W
0133: BSF 03.5
0134: MOVWF 07
0135: NOP
0136: BCF 03.5
0137: BSF 20.3
0138: MOVF 20,W
0139: BSF 03.5
013A: MOVWF 07
013B: NOP
013C: BCF 03.5
013D: BCF 07.4
013E: BCF 20.4
013F: MOVF 20,W
0140: BSF 03.5
0141: MOVWF 07
0142: NOP
0143: BCF 03.5
0144: BCF 07.3
0145: BCF 20.3
0146: MOVF 20,W
0147: BSF 03.5
0148: MOVWF 07
.................... i2c_write(HMC5883L_WRT_ADDR);
0169: MOVLW 3C
016A: BCF 03.5
016B: MOVWF 3D
016C: CALL 089
0149: MOVLW 3C
014A: BCF 03.5
014B: MOVWF 2D
014C: CALL 069
.................... i2c_write(HMC5883L_X_MSB_REG); // Point to X-msb register
016D: MOVLW 03
016E: MOVWF 3D
016F: CALL 089
014D: MOVLW 03
014E: MOVWF 2D
014F: CALL 069
.................... 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
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: BTFSS 07.3
015D: GOTO 15C
015E: BCF 07.4
015F: BCF 20.4
0160: MOVF 20,W
0161: BSF 03.5
0162: MOVWF 07
0163: NOP
0164: BCF 03.5
0165: BCF 07.3
0166: BCF 20.3
0167: MOVF 20,W
0168: BSF 03.5
0169: MOVWF 07
.................... i2c_write(HMC5883L_READ_ADDR);
018A: MOVLW 3D
018B: BCF 03.5
018C: MOVWF 3D
018D: CALL 089
016A: MOVLW 3D
016B: BCF 03.5
016C: MOVWF 2D
016D: CALL 069
....................
.................... x_msb = i2c_read();
018E: MOVLW 01
018F: MOVWF 77
0190: CALL 10C
0191: MOVF 78,W
0192: MOVWF 38
016E: MOVLW 01
016F: MOVWF 77
0170: CALL 0EC
0171: MOVF 78,W
0172: MOVWF 28
.................... x_lsb = i2c_read();
0193: MOVLW 01
0194: MOVWF 77
0195: CALL 10C
0196: MOVF 78,W
0197: MOVWF 37
0173: MOVLW 01
0174: MOVWF 77
0175: CALL 0EC
0176: MOVF 78,W
0177: MOVWF 27
....................
.................... z_msb = i2c_read();
0198: MOVLW 01
0199: MOVWF 77
019A: CALL 10C
019B: MOVF 78,W
019C: MOVWF 3C
0178: MOVLW 01
0179: MOVWF 77
017A: CALL 0EC
017B: MOVF 78,W
017C: MOVWF 2C
.................... z_lsb = i2c_read();
019D: MOVLW 01
019E: MOVWF 77
019F: CALL 10C
01A0: MOVF 78,W
01A1: MOVWF 3B
017D: MOVLW 01
017E: MOVWF 77
017F: CALL 0EC
0180: MOVF 78,W
0181: MOVWF 2B
....................
.................... y_msb = i2c_read();
01A2: MOVLW 01
01A3: MOVWF 77
01A4: CALL 10C
01A5: MOVF 78,W
01A6: MOVWF 3A
0182: MOVLW 01
0183: MOVWF 77
0184: CALL 0EC
0185: MOVF 78,W
0186: MOVWF 2A
.................... y_lsb = i2c_read(0); // do a NACK on last read
01A7: CLRF 77
01A8: CALL 10C
01A9: MOVF 78,W
01AA: MOVWF 39
0187: CLRF 77
0188: CALL 0EC
0189: MOVF 78,W
018A: MOVWF 29
....................
.................... 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
018B: BCF 20.4
018C: MOVF 20,W
018D: BSF 03.5
018E: MOVWF 07
018F: NOP
0190: BCF 03.5
0191: BSF 20.3
0192: MOVF 20,W
0193: BSF 03.5
0194: MOVWF 07
0195: BCF 03.5
0196: BTFSS 07.3
0197: GOTO 196
0198: NOP
0199: GOTO 19A
019A: NOP
019B: BSF 20.4
019C: MOVF 20,W
019D: BSF 03.5
019E: MOVWF 07
019F: NOP
....................
.................... // Combine high and low bytes into 16-bit values.
.................... compass.x = make16(x_msb, x_lsb);
01C0: BCF 03.5
01C1: MOVF 38,W
01C2: MOVWF 22
01C3: MOVF 37,W
01C4: MOVWF 21
01A0: BCF 03.5
01A1: MOVF 28,W
01A2: MOVWF 22
01A3: MOVF 27,W
01A4: MOVWF 21
.................... compass.y = make16(y_msb, y_lsb);
01C5: MOVF 3A,W
01C6: MOVWF 24
01C7: MOVF 39,W
01C8: MOVWF 23
01A5: MOVF 2A,W
01A6: MOVWF 24
01A7: MOVF 29,W
01A8: MOVWF 23
.................... compass.z = make16(z_msb, z_lsb);
01C9: MOVF 3C,W
01CA: MOVWF 26
01CB: MOVF 3B,W
01CC: MOVWF 25
01A9: MOVF 2C,W
01AA: MOVWF 26
01AB: MOVF 2B,W
01AC: MOVWF 25
.................... }
01CD: BCF 0A.3
01CE: BCF 0A.4
01CF: GOTO 2F6 (RETURN)
01AD: BCF 0A.3
01AE: BCF 0A.4
01AF: GOTO 2CC (RETURN)
....................
....................
....................
2717,165 → 2680,160
.................... void main()
.................... {
*
0266: CLRF 04
0267: BCF 03.7
0268: MOVLW 1F
0269: ANDWF 03,F
026A: MOVLW 71
026B: BSF 03.5
026C: MOVWF 0F
026D: MOVF 0F,W
026E: BCF 03.5
026F: BCF 20.7
0270: MOVF 20,W
0271: BSF 03.5
0272: MOVWF 07
0273: BCF 03.5
0274: BSF 07.7
0275: BSF 03.5
0276: BSF 03.6
0277: MOVF 09,W
0278: ANDLW C0
0279: MOVWF 09
027A: BCF 03.6
027B: BCF 1F.4
027C: BCF 1F.5
027D: MOVLW 00
027E: BSF 03.6
027F: MOVWF 08
0280: BCF 03.5
0281: CLRF 07
0282: CLRF 08
0283: CLRF 09
023C: CLRF 04
023D: BCF 03.7
023E: MOVLW 1F
023F: ANDWF 03,F
0240: MOVLW 71
0241: BSF 03.5
0242: MOVWF 0F
0243: MOVF 0F,W
0244: BSF 03.6
0245: BCF 07.3
0246: MOVLW 0C
0247: BCF 03.6
0248: MOVWF 19
0249: MOVLW A2
024A: MOVWF 18
024B: MOVLW 90
024C: BCF 03.5
024D: MOVWF 18
024E: BSF 03.5
024F: BSF 03.6
0250: MOVF 09,W
0251: ANDLW C0
0252: MOVWF 09
0253: BCF 03.6
0254: BCF 1F.4
0255: BCF 1F.5
0256: MOVLW 00
0257: BSF 03.6
0258: MOVWF 08
0259: BCF 03.5
025A: CLRF 07
025B: CLRF 08
025C: CLRF 09
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
*
028D: CLRF 34
028E: CLRF 33
.................... float last,b,anemo_speed;
.................... unsigned int16 anemo_round=0;
.................... unsigned int16 i;
....................
.................... //signed int16 X,Y,Z;
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
028F: BSF 03.5
0290: BSF 03.6
0291: MOVF 09,W
0292: ANDLW C0
0293: MOVWF 09
0294: BCF 03.6
0295: BCF 1F.4
0296: BCF 1F.5
0297: MOVLW 00
0298: BSF 03.6
0299: MOVWF 08
0266: BSF 03.5
0267: BSF 03.6
0268: MOVF 09,W
0269: ANDLW C0
026A: MOVWF 09
026B: BCF 03.6
026C: BCF 1F.4
026D: BCF 1F.5
026E: MOVLW 00
026F: BSF 03.6
0270: MOVWF 08
.................... setup_adc(ADC_CLOCK_DIV_2);
029A: BCF 03.5
029B: BCF 03.6
029C: BCF 1F.6
029D: BCF 1F.7
029E: BSF 03.5
029F: BCF 1F.7
02A0: BCF 03.5
02A1: BSF 1F.0
0271: BCF 03.5
0272: BCF 03.6
0273: BCF 1F.6
0274: BCF 1F.7
0275: BSF 03.5
0276: BCF 1F.7
0277: BCF 03.5
0278: BSF 1F.0
.................... setup_spi(SPI_SS_DISABLED);
02A2: BCF 14.5
02A3: BCF 20.5
02A4: MOVF 20,W
02A5: BSF 03.5
02A6: MOVWF 07
02A7: BCF 03.5
02A8: BSF 20.4
02A9: MOVF 20,W
02AA: BSF 03.5
02AB: MOVWF 07
02AC: BCF 03.5
02AD: BCF 20.3
02AE: MOVF 20,W
02AF: BSF 03.5
02B0: MOVWF 07
02B1: MOVLW 01
02B2: BCF 03.5
02B3: MOVWF 14
02B4: MOVLW 00
02B5: BSF 03.5
02B6: MOVWF 14
0279: BCF 14.5
027A: BCF 20.5
027B: MOVF 20,W
027C: BSF 03.5
027D: MOVWF 07
027E: BCF 03.5
027F: BSF 20.4
0280: MOVF 20,W
0281: BSF 03.5
0282: MOVWF 07
0283: BCF 03.5
0284: BCF 20.3
0285: MOVF 20,W
0286: BSF 03.5
0287: MOVWF 07
0288: MOVLW 01
0289: BCF 03.5
028A: MOVWF 14
028B: MOVLW 00
028C: BSF 03.5
028D: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
02B7: MOVF 01,W
02B8: ANDLW C7
02B9: IORLW 08
02BA: MOVWF 01
028E: MOVF 01,W
028F: ANDLW C7
0290: IORLW 08
0291: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
02BB: BCF 03.5
02BC: CLRF 10
0292: BCF 03.5
0293: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
02BD: MOVLW 00
02BE: MOVWF 78
02BF: MOVWF 12
02C0: MOVLW 00
02C1: BSF 03.5
02C2: MOVWF 12
0294: MOVLW 00
0295: MOVWF 78
0296: MOVWF 12
0297: MOVLW 00
0298: BSF 03.5
0299: MOVWF 12
.................... setup_ccp1(CCP_OFF);
02C3: BCF 03.5
02C4: BSF 20.2
02C5: MOVF 20,W
02C6: BSF 03.5
02C7: MOVWF 07
02C8: BCF 03.5
02C9: CLRF 17
02CA: BSF 03.5
02CB: CLRF 1B
02CC: CLRF 1C
02CD: MOVLW 01
02CE: MOVWF 1D
.................... setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
02CF: BCF 03.5
02D0: BSF 03.6
02D1: CLRF 07
02D2: CLRF 08
02D3: CLRF 09
029A: BCF 03.5
029B: BSF 20.2
029C: MOVF 20,W
029D: BSF 03.5
029E: MOVWF 07
029F: BCF 03.5
02A0: CLRF 17
02A1: BSF 03.5
02A2: CLRF 1B
02A3: CLRF 1C
02A4: MOVLW 01
02A5: MOVWF 1D
.................... setup_comparator(NC_NC_NC_NC);
02A6: BCF 03.5
02A7: BSF 03.6
02A8: CLRF 07
02A9: CLRF 08
02AA: CLRF 09
....................
.................... printf("Magnetometr: \r\n",);
02D4: MOVLW 04
02D5: MOVWF 0D
02D6: MOVLW 00
02D7: MOVWF 0F
02D8: BCF 03.6
02D9: CALL 043
.................... printf("(c)mlab JACHO 2013: \r\n",);
02DA: MOVLW 0D
02DB: BSF 03.6
02DC: MOVWF 0D
02DD: MOVLW 00
02DE: MOVWF 0F
02DF: BCF 03.6
02E0: CALL 043
02AB: MOVLW 04
02AC: MOVWF 0D
02AD: MOVLW 00
02AE: MOVWF 0F
02AF: BCF 03.6
02B0: CALL 021
.................... printf("(c)mlab.cz kaklik 2013: \r\n",);
02B1: MOVLW 0D
02B2: BSF 03.6
02B3: MOVWF 0D
02B4: MOVLW 00
02B5: MOVWF 0F
02B6: BCF 03.6
02B7: CALL 021
.................... printf("X, Y, Z \r\n",);
02E1: MOVLW 19
02E2: BSF 03.6
02E3: MOVWF 0D
02E4: MOVLW 00
02E5: MOVWF 0F
02E6: BCF 03.6
02E7: CALL 043
02B8: MOVLW 1B
02B9: BSF 03.6
02BA: MOVWF 0D
02BB: MOVLW 00
02BC: MOVWF 0F
02BD: BCF 03.6
02BE: CALL 021
....................
....................
.................... // Init the HMC5883L. Set Mode register for
.................... // continuous measurements.
.................... hmc5883l_write_reg(HMC5883L_CFG_A_REG, 0x18); // no average, maximal update range
02E8: CLRF 37
02E9: MOVLW 18
02EA: MOVWF 38
02EB: CALL 0D3
.................... hmc5883l_write_reg(HMC5883L_CFG_B_REG, 0xE0); // maximal range
02EC: MOVLW 01
02ED: MOVWF 37
02EE: MOVLW E0
02EF: MOVWF 38
02F0: CALL 0D3
02BF: CLRF 27
02C0: MOVLW 18
02C1: MOVWF 28
02C2: CALL 0B3
.................... hmc5883l_write_reg(HMC5883L_CFG_B_REG, 0x00); // minimal range
02C3: MOVLW 01
02C4: MOVWF 27
02C5: CLRF 28
02C6: CALL 0B3
.................... hmc5883l_write_reg(HMC5883L_MODE_REG, 0x00);
02F1: MOVLW 02
02F2: MOVWF 37
02F3: CLRF 38
02F4: CALL 0D3
02C7: MOVLW 02
02C8: MOVWF 27
02C9: CLRF 28
02CA: CALL 0B3
....................
.................... // Continuously read and display the x,y,z results.
.................... // Wait at least 67 ms between reads, re the HMC5883L data sheet.
2885,56 → 2843,61
.................... {
....................
.................... hmc5883l_read_data();
02F5: GOTO 151
02CB: GOTO 131
.................... printf("%6Ld %6Ld %6Ld \n\r", compass.x, compass.y, compass.z);
02F6: MOVLW 00
02F7: MOVWF 04
02F8: MOVF 22,W
02F9: MOVWF 38
02FA: MOVF 21,W
02FB: MOVWF 37
02FC: CALL 1D0
02FD: MOVLW 20
02FE: MOVWF 40
02FF: CALL 01F
0300: MOVLW 00
0301: MOVWF 04
0302: MOVF 24,W
0303: MOVWF 38
0304: MOVF 23,W
0305: MOVWF 37
0306: CALL 1D0
0307: MOVLW 20
0308: MOVWF 40
0309: CALL 01F
030A: MOVLW 00
030B: MOVWF 04
030C: MOVF 26,W
030D: MOVWF 38
030E: MOVF 25,W
030F: MOVWF 37
0310: CALL 1D0
0311: MOVLW 20
0312: MOVWF 40
0313: CALL 01F
0314: MOVLW 0A
0315: MOVWF 40
0316: CALL 01F
0317: MOVLW 0D
0318: MOVWF 40
0319: CALL 01F
02CC: MOVLW 00
02CD: MOVWF 04
02CE: MOVF 22,W
02CF: MOVWF 28
02D0: MOVF 21,W
02D1: MOVWF 27
02D2: CALL 1B0
02D3: MOVLW 20
02D4: BTFSS 0C.4
02D5: GOTO 2D4
02D6: MOVWF 19
02D7: MOVLW 00
02D8: MOVWF 04
02D9: MOVF 24,W
02DA: MOVWF 28
02DB: MOVF 23,W
02DC: MOVWF 27
02DD: CALL 1B0
02DE: MOVLW 20
02DF: BTFSS 0C.4
02E0: GOTO 2DF
02E1: MOVWF 19
02E2: MOVLW 00
02E3: MOVWF 04
02E4: MOVF 26,W
02E5: MOVWF 28
02E6: MOVF 25,W
02E7: MOVWF 27
02E8: CALL 1B0
02E9: MOVLW 20
02EA: BTFSS 0C.4
02EB: GOTO 2EA
02EC: MOVWF 19
02ED: MOVLW 0A
02EE: BTFSS 0C.4
02EF: GOTO 2EE
02F0: MOVWF 19
02F1: MOVLW 0D
02F2: BTFSS 0C.4
02F3: GOTO 2F2
02F4: MOVWF 19
.................... delay_ms(100);
031A: MOVLW 64
031B: MOVWF 37
031C: GOTO 250
02F5: MOVLW 64
02F6: MOVWF 27
02F7: GOTO 226
.................... }
031D: GOTO 2F5
02F8: GOTO 2CB
....................
.................... }
....................
....................
....................
031E: SLEEP
02F9: SLEEP
 
Configuration Fuses:
Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
/Modules/Sensors/MAG01A/SW/PIC16F887/main.pjt
17,7 → 17,7
0=0000 %S 0 0 796 451 3 0
[Opened Files]
1=main.c
2=
2=main.h
3=C:\Program Files (x86)\PICC\devices\16F887.h
4=HMC5883L.h
5=HMC5883L.c
/Modules/Sensors/MAG01A/SW/PIC16F887/main.sta
1,18 → 1,18
 
ROM used: 799 (10%)
799 (10%) including unused fragments
ROM used: 762 (9%)
762 (9%) including unused fragments
 
0 Average locations per line
3 Average locations per statement
2 Average locations per statement
 
RAM used: 28 (8%) at main() level
38 (10%) worst case
RAM used: 12 (3%) at main() level
21 (6%) worst case
 
Stack used: 2 worst case (out of 8 total available)
 
Lines Stmts % Files
----- ----- --- -----
48 19 6 main.c
43 19 6 main.c
22 0 0 main.h
423 0 0 C:\Program Files (x86)\PICC\devices\16F887.h
25 0 0 HMC5883L.h
19,39 → 19,38
76 28 9 HMC5883L.c
2172 260 85 C:\Program Files (x86)\PICC\drivers\math.h
----- -----
2766 307 Total
2761 307 Total
 
Page ROM % RAM Vol Diff Functions:
---- --- --- --- --- ---- ----------
0 22 3 1 @delay_ms1
0 69 9 3 @I2C_READ_1
0 74 9 1 @I2C_WRITE_1
0 36 5 1 @PUTCHAR_1_
0 74 10 1 @I2C_WRITE_1
0 57 7 2 102 1.8 hmc5883l_write_reg
0 127 16 6 636 3.3 hmc5883l_read_data
0 185 23 16 722 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 16 9 @PRINTF_LD_69
0 127 17 6 636 3.3 hmc5883l_read_data
0 190 25 0 595 3.3 MAIN
0 9 1 0 78 2.7 @const229
0 72 9 3 722 3.9 @PSTRINGC7_9600_62_63
0 14 2 0 @const231
0 6 1 0 @const232
0 118 15 9 @PRINTF_LD_9600_62_63
 
Program metrics:
Functions 3
Functions 5
Statements 307
Comments 358
Volume (V) 1829
Difficilty (D) 8.6
Effort to implement (E) 15712
Time to implement (T) 15 minutes
Comments 356
Volume (V) 2913
Difficilty (D) 14.9
Effort to implement (E) 43483
Time to implement (T) 40 minutes
Est Delivered Bugs (B) 0
Cyclomatic Complexity 1
Maintainability (MI) 16
Maintainability (MI) 95
 
Segment Used Free
----------- ---- ----
00000-00003 4 0
00004-007FF 795 1249
00004-007FF 758 1286
00800-00FFF 0 2048
01000-017FF 0 2048
01800-01FFF 0 2048
/Modules/Sensors/MAG01A/SW/PIC16F887/main.sym
1,7 → 1,7
004-005 @READ_PROGRAM_MEMORY8.P1
004 @WRITE_PROGRAM_MEMORY8.P2
015 CCP_1
015 CCP_1_LOW
015 CCP_1
016 CCP_1_HIGH
01B CCP_2_LOW
01B CCP_2
8,36 → 8,30
01C CCP_2_HIGH
020 @TRIS_C
021-026 compass
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 @delay_ms1.P1
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_READ_1.P1
03D @I2C_WRITE_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
027 hmc5883l_write_reg.reg
027 @delay_ms1.P1
027 hmc5883l_read_data.x_lsb
027-028 @PRINTF_LD_9600_62_63.P1
027 @PSTRINGC7_9600_62_63.@SCRATCH1
028 hmc5883l_write_reg.data
028 hmc5883l_read_data.x_msb
028 @PSTRINGC7_9600_62_63.@SCRATCH2
029 hmc5883l_read_data.y_lsb
029 @PSTRINGC7_9600_62_63.@SCRATCH3
029 @PRINTF_LD_9600_62_63.@SCRATCH1
02A hmc5883l_read_data.y_msb
02A @PRINTF_LD_9600_62_63.@SCRATCH2
02B hmc5883l_read_data.z_lsb
02B @PRINTF_LD_9600_62_63.@SCRATCH3
02C hmc5883l_read_data.z_msb
02C @PRINTF_LD_9600_62_63.@SCRATCH4
02D @I2C_READ_1.P1
02D @I2C_WRITE_1.P2
02D @PRINTF_LD_9600_62_63.@SCRATCH5
02E @I2C_READ_1.@SCRATCH1
02E @PRINTF_LD_9600_62_63.@SCRATCH6
02F @I2C_READ_1.@SCRATCH2
02F @PRINTF_LD_9600_62_63.@SCRATCH7
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
49,19 → 43,18
10D-10E @READ_PROGRAM_MEMORY8.P2
 
ROM Allocation:
0250 @delay_ms1
010C @I2C_READ_1
0089 @I2C_WRITE_1
001F @PUTCHAR_1_
00D3 hmc5883l_write_reg
0151 hmc5883l_read_data
0266 MAIN
0004 @const237
0043 @PSTRINGC7_69
000D @const239
0019 @const240
01D0 @PRINTF_LD_69
0266 @cinit
0226 @delay_ms1
00EC @I2C_READ_1
0069 @I2C_WRITE_1
00B3 hmc5883l_write_reg
0131 hmc5883l_read_data
023C MAIN
0004 @const229
0021 @PSTRINGC7_9600_62_63
000D @const231
001B @const232
01B0 @PRINTF_LD_9600_62_63
023C @cinit
 
 
User Memory space:
/Modules/Sensors/MAG01A/SW/PIC16F887/main.tre
1,15 → 1,9
ÀÄmain
ÀÄMAIN 0/185 Ram=16
ÀÄMAIN 0/190 Ram=0
ÃÄ??0??
ÃÄ@PSTRINGC7_69 0/70 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PSTRINGC7_69 0/70 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PSTRINGC7_69 0/70 Ram=3
³ ÃÄ@PUTCHAR_1_ 0/36 Ram=1
³ ÀÄ@PUTCHAR_1_ 0/36 Ram=1
ÃÄ@PSTRINGC7_9600_62_63 0/72 Ram=3
ÃÄ@PSTRINGC7_9600_62_63 0/72 Ram=3
ÃÄ@PSTRINGC7_9600_62_63 0/72 Ram=3
ÃÄhmc5883l_write_reg 0/57 Ram=2
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
³ ÃÄ@I2C_WRITE_1 0/74 Ram=1
32,15 → 26,7
³ ÃÄ@I2C_READ_1 0/69 Ram=3
³ ÃÄ@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
ÃÄ@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
ÃÄ@PRINTF_LD_9600_62_63 0/118 Ram=9
ÃÄ@PRINTF_LD_9600_62_63 0/118 Ram=9
ÃÄ@PRINTF_LD_9600_62_63 0/118 Ram=9
ÀÄ@delay_ms1 0/22 Ram=1
/Modules/Sensors/MAG01A/TODO.txt
1,3 → 1,3
 
Neni vyvedeny DRDY pin, takze maximalni rychrlost cteni vzorku je: 75 Hz.