Problem with comparison.
/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.c
0,0 → 1,52
#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
 
//Adresa pro VDD, VDD, VDD W 0x9E R 0x9F
//Adresa pro GND GND GND W 0x90 R 0x91
 
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(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);
}
}
 
/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.esym
0,0 → 1,415
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 "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_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"
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
/Modules/Sensors/LTS01A/SW/PIC16F887/main.hex
0,0 → 1,220
: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
:04400E00F52CFF3F4F
:00000001FF
;PIC16F887
;CRC=B7AC CREATED="19-7-13 17:14"
/Modules/Sensors/LTS01A/SW/PIC16F887/main.lst
0,0 → 1,625
CCS PCM C Compiler, Version 4.106, 47914 19-7-13 17:14
 
Filename: D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.lst
 
ROM used: 1725 words (21%)
Largest free fragment is 2048
RAM used: 10 (3%) at main() level
38 (10%) worst case
Stack: 2 locations
 
*
0000: MOVLW 05
0001: MOVWF 0A
0002: GOTO 574
0003: NOP
.................... #include "D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\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)
*
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)
....................
....................
....................
.................... #define S_SDA PIN_C3
.................... #define S_SCL PIN_C4
.................... #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
00A0: BCF 03.5
00A1: BCF 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
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
....................
.................... //Adresa pro VDD, VDD, VDD W 0x9E R 0x9F
.................... //Adresa pro GND GND GND W 0x90 R 0x91
....................
.................... 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
....................
.................... 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
.................... 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
.................... 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
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
05B9: MOVF 01,W
05BA: ANDLW C7
05BB: IORLW 08
05BC: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
05BD: BCF 03.5
05BE: 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
.................... 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
.................... 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
....................
.................... 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;
....................
.................... 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
.................... }
06BB: GOTO 5E3
.................... }
....................
06BC: 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.sta
0,0 → 1,63
 
ROM used: 1725 (21%)
1725 (21%) including unused fragments
 
3 Average locations per line
66 Average locations per statement
 
RAM used: 10 (3%) at main() level
38 (10%) worst case
 
Stack used: 2 worst case (out of 8 total available)
 
Lines Stmts % Files
----- ----- --- -----
53 26 100 main.c
20 0 0 main.h
423 0 0 C:\Program Files (x86)\PICC\devices\16F887.h
----- -----
496 26 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
Inline 5 @FTOSD
0 66 4 13 @DIV3232
0 348 20 13 @PRINTF_L32D_69FPFPF
 
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
Est Delivered Bugs (B) 0
Cyclomatic Complexity 1
Maintainability (MI) 132
 
Segment Used Free
----------- ---- ----
00000-00003 4 0
00004-007FF 1721 323
00800-00FFF 0 2048
01000-017FF 0 2048
01800-01FFF 0 2048
 
 
 
/Modules/Sensors/LTS01A/SW/PIC16F887/main.err
0,0 → 1,2
Memory usage: ROM=21% RAM=3% - 10%
0 Errors, 0 Warnings.
/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)
 
/Modules/Sensors/LTS01A/SW/PIC16F887/main.pjt
0,0 → 1,24
[PROJECT]
Target=D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main.hex
Development_Mode=
Processor_Text=PIC16F887
ToolSuite=CCS
Processor=0x887F
[D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\main]
Type=4
Path=
FileList=
BuildTool=
OptionString=
AdditionalOptionString=
[mru-list]
1=D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\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=
/Modules/Sensors/LTS01A/SW/PIC16F887/main.sym
0,0 → 1,140
004-005 @READ_PROGRAM_MEMORY8.P1
004 @WRITE_PROGRAM_MEMORY8.P2
015 CCP_1_LOW
015 CCP_1
016 CCP_1_HIGH
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
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:
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
 
 
User Memory space:
 
User Memory space:
 
Project Directory:
D:\Honza\MLAB\Modules\Sensors\LTS01A\SW\PIC16F887\
 
Project Files:
main.c
main.h
C:\Program Files (x86)\PICC\devices\16F887.h
 
Units:
D:\Honza\MLAB\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,34
ÀÄmain
ÀÄmain 0/329 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
³ ÃÄ@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