Problem with comparison.
/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
0,0 → 1,31
#include "main.h"
 
#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_C6,rcv=PIN_C7,bits=8)
 
#include "../LTS01.h"
 
void main()
{
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
setup_ccp1(CCP_OFF);
setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
 
printf("Simple Thermomether with LTS01A sensor \r\n",);
printf("(c) MLAB.cz 2013 JACHO \r\n",);
while(TRUE)
{
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
Property changes:
Added: svn:mime-type
+application/octet-stream
\ No newline at end of property
/Modules/Sensors/LTS01A/SW/PIC16F887/main.err
0,0 → 1,2
Memory usage: ROM=13% RAM=3% - 10%
0 Errors, 0 Warnings.
/Modules/Sensors/LTS01A/SW/PIC16F887/main.esym
0,0 → 1,417
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"
d G "PIN_A3" 2 23 "43"
d G "PIN_A4" 2 24 "44"
d G "PIN_A5" 2 25 "45"
d G "PIN_A6" 2 26 "46"
d G "PIN_A7" 2 27 "47"
d G "PIN_B0" 2 29 "48"
d G "PIN_B1" 2 30 "49"
d G "PIN_B2" 2 31 "50"
d G "PIN_B3" 2 32 "51"
d G "PIN_B4" 2 33 "52"
d G "PIN_B5" 2 34 "53"
d G "PIN_B6" 2 35 "54"
d G "PIN_B7" 2 36 "55"
d G "PIN_C0" 2 38 "56"
d G "PIN_C1" 2 39 "57"
d G "PIN_C2" 2 40 "58"
d G "PIN_C3" 2 41 "59"
d G "PIN_C4" 2 42 "60"
d G "PIN_C5" 2 43 "61"
d G "PIN_C6" 2 44 "62"
d G "PIN_C7" 2 45 "63"
d G "PIN_D0" 2 47 "64"
d G "PIN_D1" 2 48 "65"
d G "PIN_D2" 2 49 "66"
d G "PIN_D3" 2 50 "67"
d G "PIN_D4" 2 51 "68"
d G "PIN_D5" 2 52 "69"
d G "PIN_D6" 2 53 "70"
d G "PIN_D7" 2 54 "71"
d G "PIN_E0" 2 56 "72"
d G "PIN_E1" 2 57 "73"
d G "PIN_E2" 2 58 "74"
d G "PIN_E3" 2 59 "75"
d G "FALSE" 2 62 "0"
d G "TRUE" 2 63 "1"
d G "BYTE" 2 65 "int8"
d G "BOOLEAN" 2 66 "int1"
d G "getc" 2 68 "getch"
d G "fgetc" 2 69 "getch"
d G "getchar" 2 70 "getch"
d G "putc" 2 71 "putchar"
d G "fputc" 2 72 "putchar"
d G "fgets" 2 73 "gets"
d G "fputs" 2 74 "puts"
d G "WDT_FROM_SLEEP" 2 79 "3"
d G "WDT_TIMEOUT" 2 80 "11"
d G "MCLR_FROM_SLEEP" 2 81 "19"
d G "MCLR_FROM_RUN" 2 82 "27"
d G "NORMAL_POWER_UP" 2 83 "25"
d G "BROWNOUT_RESTART" 2 84 "26"
d G "T0_INTERNAL" 2 91 "0"
d G "T0_EXT_L_TO_H" 2 92 "32"
d G "T0_EXT_H_TO_L" 2 93 "48"
d G "T0_DIV_1" 2 95 "8"
d G "T0_DIV_2" 2 96 "0"
d G "T0_DIV_4" 2 97 "1"
d G "T0_DIV_8" 2 98 "2"
d G "T0_DIV_16" 2 99 "3"
d G "T0_DIV_32" 2 100 "4"
d G "T0_DIV_64" 2 101 "5"
d G "T0_DIV_128" 2 102 "6"
d G "T0_DIV_256" 2 103 "7"
d G "T0_8_BIT" 2 106 "0"
d G "RTCC_INTERNAL" 2 108 "0" "The following are provided for compatibility"
d G "RTCC_EXT_L_TO_H" 2 109 "32" "with older compiler versions"
d G "RTCC_EXT_H_TO_L" 2 110 "48"
d G "RTCC_DIV_1" 2 111 "8"
d G "RTCC_DIV_2" 2 112 "0"
d G "RTCC_DIV_4" 2 113 "1"
d G "RTCC_DIV_8" 2 114 "2"
d G "RTCC_DIV_16" 2 115 "3"
d G "RTCC_DIV_32" 2 116 "4"
d G "RTCC_DIV_64" 2 117 "5"
d G "RTCC_DIV_128" 2 118 "6"
d G "RTCC_DIV_256" 2 119 "7"
d G "RTCC_8_BIT" 2 120 "0"
d G "WDT_18MS" 2 132 "8"
d G "WDT_36MS" 2 133 "9"
d G "WDT_72MS" 2 134 "10"
d G "WDT_144MS" 2 135 "11"
d G "WDT_288MS" 2 136 "12"
d G "WDT_576MS" 2 137 "13"
d G "WDT_1152MS" 2 138 "14"
d G "WDT_2304MS" 2 139 "15"
d G "WDT_ON" 2 143 "0x4100"
d G "WDT_OFF" 2 144 "0"
d G "WDT_DIV_16" 2 145 "0x100"
d G "WDT_DIV_8" 2 146 "0x300"
d G "WDT_DIV_4" 2 147 "0x500"
d G "WDT_DIV_2" 2 148 "0x700"
d G "WDT_TIMES_1" 2 149 "0x900" "Default"
d G "WDT_TIMES_2" 2 150 "0xB00"
d G "WDT_TIMES_4" 2 151 "0xD00"
d G "WDT_TIMES_8" 2 152 "0xF00"
d G "WDT_TIMES_16" 2 153 "0x1100"
d G "WDT_TIMES_32" 2 154 "0x1300"
d G "WDT_TIMES_64" 2 155 "0x1500"
d G "WDT_TIMES_128" 2 156 "0x1700"
d G "T1_DISABLED" 2 162 "0"
d G "T1_INTERNAL" 2 163 "5"
d G "T1_EXTERNAL" 2 164 "7"
d G "T1_EXTERNAL_SYNC" 2 165 "3"
d G "T1_CLK_OUT" 2 167 "8"
d G "T1_DIV_BY_1" 2 169 "0"
d G "T1_DIV_BY_2" 2 170 "0x10"
d G "T1_DIV_BY_4" 2 171 "0x20"
d G "T1_DIV_BY_8" 2 172 "0x30"
d G "T1_GATE" 2 174 "0x40"
d G "T1_GATE_INVERTED" 2 175 "0xC0"
d G "T2_DISABLED" 2 180 "0"
d G "T2_DIV_BY_1" 2 181 "4"
d G "T2_DIV_BY_4" 2 182 "5"
d G "T2_DIV_BY_16" 2 183 "6"
d G "CCP_OFF" 2 189 "0"
d G "CCP_CAPTURE_FE" 2 190 "4"
d G "CCP_CAPTURE_RE" 2 191 "5"
d G "CCP_CAPTURE_DIV_4" 2 192 "6"
d G "CCP_CAPTURE_DIV_16" 2 193 "7"
d G "CCP_COMPARE_SET_ON_MATCH" 2 194 "8"
d G "CCP_COMPARE_CLR_ON_MATCH" 2 195 "9"
d G "CCP_COMPARE_INT" 2 196 "0xA"
d G "CCP_COMPARE_RESET_TIMER" 2 197 "0xB"
d G "CCP_PWM" 2 198 "0xC"
d G "CCP_PWM_PLUS_1" 2 199 "0x1c"
d G "CCP_PWM_PLUS_2" 2 200 "0x2c"
d G "CCP_PWM_PLUS_3" 2 201 "0x3c"
d G "CCP_PWM_H_H" 2 206 "0x0c"
d G "CCP_PWM_H_L" 2 207 "0x0d"
d G "CCP_PWM_L_H" 2 208 "0x0e"
d G "CCP_PWM_L_L" 2 209 "0x0f"
d G "CCP_PWM_FULL_BRIDGE" 2 211 "0x40"
d G "CCP_PWM_FULL_BRIDGE_REV" 2 212 "0xC0"
d G "CCP_PWM_HALF_BRIDGE" 2 213 "0x80"
d G "CCP_SHUTDOWN_ON_COMP1" 2 215 "0x100000"
d G "CCP_SHUTDOWN_ON_COMP2" 2 216 "0x200000"
d G "CCP_SHUTDOWN_ON_COMP" 2 217 "0x300000"
d G "CCP_SHUTDOWN_ON_INT0" 2 218 "0x400000"
d G "CCP_SHUTDOWN_ON_COMP1_INT0" 2 219 "0x500000"
d G "CCP_SHUTDOWN_ON_COMP2_INT0" 2 220 "0x600000"
d G "CCP_SHUTDOWN_ON_COMP_INT0" 2 221 "0x700000"
d G "CCP_SHUTDOWN_AC_L" 2 223 "0x000000"
d G "CCP_SHUTDOWN_AC_H" 2 224 "0x040000"
d G "CCP_SHUTDOWN_AC_F" 2 225 "0x080000"
d G "CCP_SHUTDOWN_BD_L" 2 227 "0x000000"
d G "CCP_SHUTDOWN_BD_H" 2 228 "0x010000"
d G "CCP_SHUTDOWN_BD_F" 2 229 "0x020000"
d G "CCP_SHUTDOWN_RESTART" 2 231 "0x80000000"
d G "CCP_PULSE_STEERING_A" 2 233 "0x01000000"
d G "CCP_PULSE_STEERING_B" 2 234 "0x02000000"
d G "CCP_PULSE_STEERING_C" 2 235 "0x04000000"
d G "CCP_PULSE_STEERING_D" 2 236 "0x08000000"
d G "CCP_PULSE_STEERING_SYNC" 2 237 "0x10000000"
d G "SPI_MASTER" 2 245 "0x20"
d G "SPI_SLAVE" 2 246 "0x24"
d G "SPI_L_TO_H" 2 247 "0"
d G "SPI_H_TO_L" 2 248 "0x10"
d G "SPI_CLK_DIV_4" 2 249 "0"
d G "SPI_CLK_DIV_16" 2 250 "1"
d G "SPI_CLK_DIV_64" 2 251 "2"
d G "SPI_CLK_T2" 2 252 "3"
d G "SPI_SS_DISABLED" 2 253 "1"
d G "SPI_SAMPLE_AT_END" 2 255 "0x8000"
d G "SPI_XMIT_L_TO_H" 2 256 "0x4000"
d G "UART_ADDRESS" 2 262 "2"
d G "UART_DATA" 2 263 "4"
d G "UART_AUTODETECT" 2 264 "8"
d G "UART_AUTODETECT_NOWAIT" 2 265 "9"
d G "UART_WAKEUP_ON_RDA" 2 266 "10"
d G "UART_SEND_BREAK" 2 267 "13"
d G "NC_NC_NC_NC" 2 273 "0x00"
d G "NC_NC" 2 274 "0x00"
d G "CP1_A0_A3" 2 277 "0x00090080"
d G "CP1_A1_A3" 2 278 "0x000A0081"
d G "CP1_B3_A3" 2 279 "0x00880082"
d G "CP1_B1_A3" 2 280 "0x00280083"
d G "CP1_A0_VREF" 2 281 "0x00010084"
d G "CP1_A1_VREF" 2 282 "0x00020085"
d G "CP1_B3_VREF" 2 283 "0x00800086"
d G "CP1_B1_VREF" 2 284 "0x00200087"
d G "CP1_OUT_ON_A4" 2 286 "0x00000020"
d G "CP1_INVERT" 2 287 "0x00000010"
d G "CP1_ABSOLUTE_VREF" 2 288 "0x20000000"
d G "CP2_A0_A2" 2 291 "0x00058000"
d G "CP2_A1_A2" 2 292 "0x00068100"
d G "CP2_B3_A2" 2 293 "0x00848200"
d G "CP2_B1_A2" 2 294 "0x00248300"
d G "CP2_A0_VREF" 2 295 "0x00018400"
d G "CP2_A1_VREF" 2 296 "0x00028500"
d G "CP2_B3_VREF" 2 297 "0x00808600"
d G "CP2_B1_VREF" 2 298 "0x00208700"
d G "CP2_OUT_ON_A5" 2 300 "0x00002000"
d G "CP2_INVERT" 2 301 "0x00001000"
d G "CP2_ABSOLUTE_VREF" 2 302 "0x10000000"
d G "CP2_T1_SYNC" 2 305 "0x01000000"
d G "CP2_T1_GATE" 2 306 "0x02000000"
d G "VREF_LOW" 2 315 "0xa0"
d G "VREF_HIGH" 2 316 "0x80"
d G "OSC_31KHZ" 2 322 "1"
d G "OSC_125KHZ" 2 323 "0x11"
d G "OSC_250KHZ" 2 324 "0x21"
d G "OSC_500KHZ" 2 325 "0x31"
d G "OSC_1MHZ" 2 326 "0x41"
d G "OSC_2MHZ" 2 327 "0x51"
d G "OSC_4MHZ" 2 328 "0x61"
d G "OSC_8MHZ" 2 329 "0x71"
d G "OSC_INTRC" 2 330 "1"
d G "OSC_NORMAL" 2 331 "0"
d G "OSC_STATE_STABLE" 2 333 "4"
d G "OSC_31KHZ_STABLE" 2 334 "2"
d G "ADC_OFF" 2 342 "0" "ADC Off"
d G "ADC_CLOCK_DIV_2" 2 343 "0x100"
d G "ADC_CLOCK_DIV_8" 2 344 "0x40"
d G "ADC_CLOCK_DIV_32" 2 345 "0x80"
d G "ADC_CLOCK_INTERNAL" 2 346 "0xc0" "Internal 2-6us"
d G "sAN0" 2 350 "1" "| A0"
d G "sAN1" 2 351 "2" "| A1"
d G "sAN2" 2 352 "4" "| A2"
d G "sAN3" 2 353 "8" "| A3"
d G "sAN4" 2 354 "16" "| A5"
d G "sAN5" 2 355 "32" "| E0"
d G "sAN6" 2 356 "64" "| E1"
d G "sAN7" 2 357 "128" "| E2"
d G "sAN8" 2 358 "0x10000" "| B2"
d G "sAN9" 2 359 "0x20000" "| B3"
d G "sAN10" 2 360 "0x40000" "| B1"
d G "sAN11" 2 361 "0x80000" "| B4"
d G "sAN12" 2 362 "0x100000" "| B0"
d G "sAN13" 2 363 "0x200000" "| B5"
d G "NO_ANALOGS" 2 364 "0" "None"
d G "ALL_ANALOG" 2 365 "0x1F00FF" "A0 A1 A2 A3 A5 E0 E1 E2 B0 B1 B2 B3 B4 B5"
d G "VSS_VDD" 2 368 "0x0000" "| Range 0-Vdd"
d G "VSS_VREF" 2 369 "0x1000" "| Range 0-Vref"
d G "VREF_VREF" 2 370 "0x3000" "| Range Vref-Vref"
d G "VREF_VDD" 2 371 "0x2000" "| Range Vref-Vdd"
d G "ADC_START_AND_READ" 2 375 "7" "This is the default if nothing is specified"
d G "ADC_START_ONLY" 2 376 "1"
d G "ADC_READ_ONLY" 2 377 "6"
d G "L_TO_H" 2 389 "0x40"
d G "H_TO_L" 2 390 "0"
d G "GLOBAL" 2 392 "0x0BC0"
d G "INT_RTCC" 2 393 "0x000B20"
d G "INT_RB" 2 394 "0x01FF0B08"
d G "INT_EXT_L2H" 2 395 "0x50000B10"
d G "INT_EXT_H2L" 2 396 "0x60000B10"
d G "INT_EXT" 2 397 "0x000B10"
d G "INT_AD" 2 398 "0x008C40"
d G "INT_TBE" 2 399 "0x008C10"
d G "INT_RDA" 2 400 "0x008C20"
d G "INT_TIMER1" 2 401 "0x008C01"
d G "INT_TIMER2" 2 402 "0x008C02"
d G "INT_CCP1" 2 403 "0x008C04"
d G "INT_CCP2" 2 404 "0x008D01"
d G "INT_SSP" 2 405 "0x008C08"
d G "INT_BUSCOL" 2 406 "0x008D08"
d G "INT_EEPROM" 2 407 "0x008D10"
d G "INT_TIMER0" 2 408 "0x000B20"
d G "INT_OSC_FAIL" 2 409 "0x008D80"
d G "INT_COMP" 2 410 "0x008D20"
d G "INT_COMP2" 2 411 "0x008D40"
d G "INT_ULPWU" 2 412 "0x008D04"
d G "INT_RB0" 2 413 "0x0010B08"
d G "INT_RB1" 2 414 "0x0020B08"
d G "INT_RB2" 2 415 "0x0040B08"
d G "INT_RB3" 2 416 "0x0080B08"
d G "INT_RB4" 2 417 "0x0100B08"
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_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
F B "sleep" 0 0
F B "delay_cycles" 1 0
F B "read_bank" 2 0
F B "write_bank" 3 0
F B "shift_left" 2 2
F B "shift_right" 2 2
F B "rotate_left" 2 0
F B "rotate_right" 2 0
F B "_mul" 2 0
F B "memset" 3 0
F B "isamoung" 2 0
F B "isamong" 2 0
F B "bit_set" 2 0
F B "bit_clear" 2 0
F B "bit_test" 2 0
F B "toupper" 1 0
F B "tolower" 1 0
F B "swap" 1 0
F B "printf" 1 255
F B "fprintf" 1 255
F B "sprintf" 1 255
F B "make8" 2 0
F B "make16" 2 0
F B "make32" 1 255
F B "label_address" 1 1
F B "goto_address" 1 0
F B "_va_arg" 1 0
F B "offsetofbit" 2 2
F B "enable_interrupts" 1 0
F B "disable_interrupts" 1 0
F B "interrupt_active" 1 0
F B "clear_interrupt" 1 0
F B "jump_to_isr" 1 0
F B "ext_int_edge" 1 2
F B "read_eeprom" 1 0
F B "write_eeprom" 2 0
F B "read_program_eeprom" 1 0
F B "write_program_eeprom" 2 0
F B "write_program_memory" 4 0
F B "write_program_memory8" 4 0
F B "read_program_memory" 4 0
F B "read_program_memory8" 4 0
F B "erase_program_eeprom" 1 0
F B "strcpy" 2 0
F B "memcpy" 3 0
F B "strstr100" 2 0
F B "output_high" 1 0
F B "output_low" 1 0
F B "input" 1 0
F B "input_state" 1 0
F B "output_float" 1 0
F B "output_drive" 1 0
F B "output_bit" 1 1
F B "output_toggle" 1 0
F B "output_a" 1 0
F B "output_b" 1 0
F B "output_c" 1 0
F B "output_d" 1 0
F B "output_e" 1 0
F B "input_a" 0 0
F B "input_b" 0 0
F B "input_c" 0 0
F B "input_d" 0 0
F B "input_e" 0 0
F B "set_tris_a" 1 0
F B "set_tris_b" 1 0
F B "set_tris_c" 1 0
F B "set_tris_d" 1 0
F B "set_tris_e" 1 0
F B "get_tris_a" 0 0
F B "get_tris_b" 0 0
F B "get_tris_c" 0 0
F B "get_tris_d" 0 0
F B "get_tris_e" 0 0
F B "input_change_a" 0 0
F B "input_change_b" 0 0
F B "input_change_c" 0 0
F B "input_change_d" 0 0
F B "input_change_e" 0 0
F B "port_b_pullups" 1 0
F B "setup_counters" 2 0
F B "setup_wdt" 1 0
F B "restart_cause" 0 0
F B "restart_wdt" 0 0
F B "get_rtcc" 0 0
F B "set_rtcc" 1 0
F B "get_timer0" 0 0
F B "set_timer0" 1 0
F B "setup_comparator" 1 0
F B "setup_port_a" 1 0
F B "setup_adc_ports" 1 0
F B "setup_adc" 1 0
F B "set_adc_channel" 1 0
F B "read_adc" 0 1
F B "adc_done" 0 0
F B "setup_timer_0" 1 0
F B "setup_vref" 1 0
F B "setup_timer_1" 1 0
F B "get_timer1" 0 0
F B "set_timer1" 1 0
F B "setup_timer_2" 3 0
F B "get_timer2" 0 0
F B "set_timer2" 1 0
F B "setup_ccp1" 1 2
F B "set_pwm1_duty" 1 0
F B "setup_ccp2" 1 0
F B "set_pwm2_duty" 1 0
F B "setup_oscillator" 1 2
F B "setup_spi" 1 0
F B "spi_read" 0 1
F B "spi_write" 1 0
F B "spi_data_is_in" 0 0
F B "setup_spi2" 1 0
F B "spi_read2" 0 1
F B "spi_write2" 1 0
F B "spi_data_is_in2" 0 0
F B "brownout_enable" 1 0
F B "delay_ms" 1 0
F B "delay_us" 1 0
F B "i2c_read" 0 2
F B "i2c_write" 1 2
F B "i2c_start" 0 2
F B "i2c_stop" 0 1
F B "i2c_isr_state" 0 1
F B "putchar" 1 2
F B "puts" 1 2
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
0,0 → 1,133
: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=8F98 CREATED="26-VIII-13 18:26"
/Modules/Sensors/LTS01A/SW/PIC16F887/main.lst
0,0 → 1,572
CCS PCM C Compiler, Version 4.106, 47914 26-VIII-13 18:26
 
Filename: Z:\home\kaklik\svnMLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.lst
 
ROM used: 1029 words (13%)
Largest free fragment is 2048
RAM used: 10 (3%) at main() level
36 (10%) worst case
Stack: 2 locations
 
*
0000: MOVLW 03
0001: MOVWF 0A
0002: GOTO 35C
0003: NOP
.................... #include "main.h"
.................... #include <16F887.h>
.................... //////// Standard Header file for the PIC16F887 device ////////////////
.................... #device PIC16F887
.................... #list
....................
.................... #device adc=8
....................
.................... #FUSES NOWDT //No Watch Dog Timer
.................... #FUSES INTRC //Internal RC Osc
.................... #FUSES NOPUT //No Power Up Timer
.................... #FUSES MCLR //Master Clear pin enabled
.................... #FUSES NOPROTECT //Code not protected from reading
.................... #FUSES NOCPD //No EE protection
.................... #FUSES NOBROWNOUT //No brownout reset
.................... #FUSES IESO //Internal External Switch Over mode enabled
.................... #FUSES FCMEN //Fail-safe clock monitor enabled
.................... #FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
.................... #FUSES NODEBUG //No Debug mode for ICD
.................... #FUSES NOWRT //Program memory not write protected
.................... #FUSES BORV40 //Brownout reset at 4.0V
....................
.................... #use delay(clock=8000000)
*
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_C4
.................... #define S_SCL PIN_C3
.................... #use i2c(master, sda=S_SDA, scl=S_SCL)
*
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: BSF 20.3
00A2: MOVF 20,W
00A3: BSF 03.5
00A4: MOVWF 07
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: 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()
.................... {
*
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);
*
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);
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);
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);
03A8: MOVF 01,W
03A9: ANDLW C7
03AA: IORLW 08
03AB: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
03AC: BCF 03.5
03AD: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
03AE: MOVLW 00
03AF: MOVWF 78
03B0: MOVWF 12
03B1: MOVLW 00
03B2: BSF 03.5
03B3: MOVWF 12
.................... setup_ccp1(CCP_OFF);
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
03C0: BCF 03.5
03C1: BSF 03.6
03C2: CLRF 07
03C3: CLRF 08
03C4: CLRF 09
....................
.................... 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)
.................... {
.................... 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
.................... }
0403: GOTO 3D2
.................... }
....................
0404: SLEEP
 
Configuration Fuses:
Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
Word 2: 3FFF NOWRT BORV40
/Modules/Sensors/LTS01A/SW/PIC16F887/main.pjt
0,0 → 1,28
[PROJECT]
Target=main.hex
Development_Mode=
Processor_Text=PIC16F887
ToolSuite=CCS
Processor=0x887F
[main]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
[mru-list]
1=main.c
[Windows]
0=0000 %S 0 0 796 451 3 0
[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
0,0 → 1,60
 
ROM used: 1029 (13%)
1029 (13%) including unused fragments
 
2 Average locations per line
43 Average locations per statement
 
RAM used: 10 (3%) at main() level
36 (10%) worst case
 
Stack used: 2 worst case (out of 8 total available)
 
Lines Stmts % Files
----- ----- --- -----
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
----- -----
500 24 Total
 
Page ROM % RAM Vol Diff Functions:
---- --- --- --- --- ---- ----------
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 6 13 @DIV3232
0 237 23 13 @PRINTF_L32D_9600_62_63FPFPF
 
Program metrics:
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) 147
 
Segment Used Free
----------- ---- ----
00000-00003 4 0
00004-007FF 1025 1019
00800-00FFF 0 2048
01000-017FF 0 2048
01800-01FFF 0 2048
 
 
 
/Modules/Sensors/LTS01A/SW/PIC16F887/main.sym
0,0 → 1,114
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
01C CCP_2_HIGH
020 @TRIS_C
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_
079 @SCRATCH
07A @SCRATCH
107.6 C1OUT
108.6 C2OUT
10D-10E @READ_PROGRAM_MEMORY8.P1
10D-10E @WRITE_PROGRAM_MEMORY8.P2
 
ROM Allocation:
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:
 
User Memory space:
 
Project Directory:
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:
Z:\home\kaklik\svnMLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main (main)
 
Compiler Settings:
Processor: PIC16F887
Pointer Size: 16
ADC Range: 0-255
Opt Level: 9
Short,Int,Long: UNSIGNED: 1,8,16
Float,Double: 32,32
 
Output Files:
Errors: main.err
Ext Symbols: main.esym
INHX8: main.hex
Symbols: main.sym
List: main.lst
Debug/COFF: main.cof
Project: main.PJT
Call Tree: main.tre
Statistics: main.sta
/Modules/Sensors/LTS01A/SW/PIC16F887/main.tre
0,0 → 1,19
ÀÄmain
ÀÄMAIN 0/169 Ram=4
ÃÄ??0??
ÃÄ@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
³ ÀÄ@DIV3232 0/66 Ram=13
ÀÄ@delay_ms1 0/22 Ram=1
/Modules/Sensors/LTS01A/SW/PIC16F887/main.bak
0,0 → 1,50
#include "D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.h"
 
#define S_SDA PIN_C3
#define S_SCL PIN_C4
#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
 
 
void main()
{
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_spi(SPI_SS_DISABLED);
setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
setup_timer_1(T1_DISABLED);
setup_timer_2(T2_DISABLED,0,1);
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;
while(TRUE)
{
 
 
i2c_start();
I2C_Write(0x9E);
I2C_write(0x00);
i2c_stop();
i2c_start();
I2C_Write(0x9F);
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);
}
}
 
/Modules/Sensors/LTS01A/SW/PIC16F887/main.h
0,0 → 1,19
#include <16F887.h>
#device adc=8
 
#FUSES NOWDT //No Watch Dog Timer
#FUSES INTRC //Internal RC Osc
#FUSES NOPUT //No Power Up Timer
#FUSES MCLR //Master Clear pin enabled
#FUSES NOPROTECT //Code not protected from reading
#FUSES NOCPD //No EE protection
#FUSES NOBROWNOUT //No brownout reset
#FUSES IESO //Internal External Switch Over mode enabled
#FUSES FCMEN //Fail-safe clock monitor enabled
#FUSES NOLVP //No low voltage prgming, B3(PIC16) or B5(PIC18) used for I/O
#FUSES NODEBUG //No Debug mode for ICD
#FUSES NOWRT //Program memory not write protected
#FUSES BORV40 //Brownout reset at 4.0V
 
#use delay(clock=8000000)