/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.err
0,0 → 1,6
>>> Warning 202 "Z:\home\kaklik\svn\svnMLAB\Designs\Measuring_instruments\RMDS01C\SW\PIC16F887\main.h" Line 19(5,8): Variable never used: rs232_errors
>>> Warning 202 "main.c" Line 16(16,21): Variable never used: count
>>> Warning 202 "main.c" Line 22(16,18): Variable never used: of
>>> Warning 202 "main.c" Line 24(12,15): Variable never used: cmd
Memory usage: ROM=5% RAM=8% - 10%
0 Errors, 4 Warnings.
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.esym
0,0 → 1,445
D G "__PCM__" 0 177 ""4.106""
D G "__DEVICE__" 0 177 "887"
D G "__DATE__" 0 177 ""04-II-14""
D G "__TIME__" 0 177 ""15:49:01""
D G "ID" 0 1 ""$Id: main.c 2916 2013-04-14 17:42:03Z kaklik $""
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 "LED" 0 7 "PIN_E1"
D G "CE" 0 8 "PIN_E2"
D G "SEL0" 0 10 "PIN_E0" "external counter division ratio"
D G "SEL1" 0 11 "PIN_E1" "external counter division ratio"
D G "MR" 0 12 "PIN_E2" "external counter master reset"
D G "CLKI" 0 13 "PIN_C0" "internal counter input"
D G "BEEP" 0 14 "PIN_C3" "buzzer"
V G "count" 0 16 "int32"
V G "buf_len" 0 18 "int8"
V G "buffer" 0 19 "int8[8]" "I2C buffer"
V G "address" 0 20 "int8"
V G "of" 0 22 "int16"
V G "cmd" 0 24 "int8[40]"
F G "ssp_interupt" 0 28 "void()"
V L "incoming" 0 30 "int8"
V L "state" 0 30 "int8"
C L "ssp_interupt" 0 5 1 "FUNCTION"
C L "ssp_interupt" 0 5 1 "FUNCTION"
C L "ssp_interupt" 0 5 4 "FUNCTION"
C L "ssp_interupt" 0 5 1 "FUNCTION"
C L "ssp_interupt" 0 5 1 "FUNCTION"
C L "MAIN" 0 5 40 "FUNCTION"
F G "MAIN" 0 117 "void()" "setup_adc_ports(NO_ANALOGS|VSS_VDD);"
C L "MAIN" 0 5 9 "FUNCTION"
C L "MAIN" 0 5 1 "FUNCTION"
C L "MAIN" 0 5 1 "FUNCTION"
C L "MAIN" 0 5 1 "FUNCTION"
C L "MAIN" 0 5 1 "FUNCTION"
C L "MAIN" 0 5 4 "FUNCTION"
C L "MAIN" 0 5 1 "FUNCTION"
C L "MAIN" 0 5 3 "FUNCTION"
C L "MAIN" 0 5 1 "FUNCTION"
C L "MAIN" 0 5 2 "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 "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
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 "i2c_slaveaddr" 1 2
F B "i2c_poll" 0 1
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.lst
0,0 → 1,521
CCS PCM C Compiler, Version 4.106, 47914 04-II-14 15:49
 
Filename: Z:\home\kaklik\svn\svnMLAB\Designs\Measuring_instruments\RMDS01C\SW\PIC16F887\main.lst
 
ROM used: 421 words (5%)
Largest free fragment is 2048
RAM used: 31 (8%) at main() level
37 (10%) worst case
Stack: 3 worst case (1 in main + 2 for interrupts)
 
*
0000: MOVLW 01
0001: MOVWF 0A
0002: GOTO 111
0003: NOP
0004: MOVWF 7F
0005: SWAPF 03,W
0006: CLRF 03
0007: MOVWF 21
0008: MOVF 0A,W
0009: MOVWF 20
000A: CLRF 0A
000B: MOVF 04,W
000C: MOVWF 22
000D: MOVF 77,W
000E: MOVWF 23
000F: MOVF 78,W
0010: MOVWF 24
0011: MOVF 79,W
0012: MOVWF 25
0013: MOVF 7A,W
0014: MOVWF 26
0015: BCF 03.7
0016: BCF 03.5
0017: MOVLW 8C
0018: MOVWF 04
0019: BTFSS 00.3
001A: GOTO 01D
001B: BTFSC 0C.3
001C: GOTO 02E
001D: MOVF 22,W
001E: MOVWF 04
001F: MOVF 23,W
0020: MOVWF 77
0021: MOVF 24,W
0022: MOVWF 78
0023: MOVF 25,W
0024: MOVWF 79
0025: MOVF 26,W
0026: MOVWF 7A
0027: MOVF 20,W
0028: MOVWF 0A
0029: SWAPF 21,W
002A: MOVWF 03
002B: SWAPF 7F,F
002C: SWAPF 7F,W
002D: RETFIE
002E: BCF 0A.3
002F: BCF 0A.4
0030: GOTO 03E
.................... #define ID "$Id: main.c 2916 2013-04-14 17:42:03Z kaklik $"
.................... #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 HS //High speed Osc (> 4mhz for PCM/PCH) (>10mhz for PCD)
.................... #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=20000000)
*
00D8: MOVLW 3A
00D9: MOVWF 04
00DA: BCF 03.7
00DB: MOVF 00,W
00DC: BTFSC 03.2
00DD: GOTO 0EB
00DE: MOVLW 06
00DF: MOVWF 78
00E0: CLRF 77
00E1: DECFSZ 77,F
00E2: GOTO 0E1
00E3: DECFSZ 78,F
00E4: GOTO 0E0
00E5: MOVLW 7B
00E6: MOVWF 77
00E7: DECFSZ 77,F
00E8: GOTO 0E7
00E9: DECFSZ 00,F
00EA: GOTO 0DE
00EB: BCF 0A.3
00EC: BCF 0A.4
00ED: GOTO 179 (RETURN)
.................... #use rs232(baud=9600,parity=N,xmit=PIN_C6,rcv=PIN_C7,bits=8,errors)
....................
....................
....................
.................... #use i2c(SLAVE, Fast, sda=PIN_C4, scl=PIN_C3, force_hw, address=0xA2)
*
0031: MOVF 13,W
0032: MOVF 3F,W
0033: MOVWF 13
0034: BSF 14.4
0035: BCF 0C.3
0036: BSF 03.5
0037: BTFSC 14.0
0038: GOTO 037
0039: CLRF 78
003A: BCF 03.5
003B: BTFSC 14.4
003C: INCF 78,F
003D: RETURN
....................
.................... //#include <string.h>
....................
.................... #define LED PIN_E1
.................... #define CE PIN_E2
....................
.................... #define SEL0 PIN_E0 // external counter division ratio
.................... #define SEL1 PIN_E1 // external counter division ratio
.................... #define MR PIN_E2 // external counter master reset
.................... #define CLKI PIN_C0 // internal counter input
.................... #define BEEP PIN_C3 // buzzer
....................
.................... unsigned int32 count;
....................
.................... const int8 buf_len=8;
.................... int8 buffer[buf_len]; // I2C buffer
.................... int8 address=0;
....................
.................... unsigned int16 of=0; // count of overflow
....................
.................... const char cmd[40]={0xB5, 0x62, 0x06, 0x31, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x80, 0x84, 0x1E, 0x00, 0xE0, 0xC8, 0x10, 0x00, 0x40, 0x42, 0x0F, 0x00, 0xA0, 0x86, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF7, 0x00, 0x00, 0x00, 0x12, 0x03};
....................
....................
.................... #INT_SSP
.................... void ssp_interupt ()
.................... {
.................... BYTE incoming, state;
....................
.................... state = i2c_isr_state();
003E: BSF 03.5
003F: BTFSC 14.5
0040: GOTO 049
0041: BCF 03.5
0042: CLRF 38
0043: BSF 03.5
0044: BTFSS 14.2
0045: GOTO 049
0046: BCF 03.5
0047: BSF 38.7
0048: BSF 03.5
0049: BCF 03.5
004A: MOVF 38,W
004B: INCF 38,F
004C: MOVWF 3D
.................... if(state < 0x80) //Master is sending data
004D: MOVF 3D,W
004E: SUBLW 7F
004F: BTFSS 03.0
0050: GOTO 069
.................... {
.................... incoming = i2c_read();
0051: BCF 14.6
0052: BTFSS 0C.3
0053: GOTO 052
0054: MOVF 13,W
0055: BSF 14.4
0056: MOVWF 3C
.................... if(state == 1) //First received byte is address
0057: DECFSZ 3D,W
0058: GOTO 05F
.................... {
.................... address = incoming;
0059: MOVF 3C,W
005A: MOVWF 35
.................... if (incoming == 2)
005B: MOVF 3C,W
005C: SUBLW 02
005D: BTFSS 03.2
005E: GOTO 05F
.................... {
.................... /* buffer[0]=make8(anemo,0);
.................... buffer[1]=make8(anemo,1);
.................... buffer[2]=make8(rain,0);
.................... buffer[3]=make8(rain,1);
.................... */ }
.................... }
.................... if(state == 2) //Second received byte is data
005F: MOVF 3D,W
0060: SUBLW 02
0061: BTFSS 03.2
0062: GOTO 069
.................... buffer[address] = incoming;
0063: MOVLW 2D
0064: ADDWF 35,W
0065: MOVWF 04
0066: BCF 03.7
0067: MOVF 3C,W
0068: MOVWF 00
.................... }
.................... if(state == 0x80) //Master is requesting data
0069: MOVF 3D,W
006A: SUBLW 80
006B: BTFSS 03.2
006C: GOTO 085
.................... {
.................... if(address <= buf_len) i2c_write(buffer[address]);
006D: MOVF 35,W
006E: SUBLW 08
006F: BTFSS 03.0
0070: GOTO 07A
0071: MOVLW 2D
0072: ADDWF 35,W
0073: MOVWF 04
0074: BCF 03.7
0075: MOVF 00,W
0076: MOVWF 3E
0077: MOVWF 3F
0078: CALL 031
.................... else i2c_write(ID[address - buf_len]);
0079: GOTO 085
007A: MOVLW 08
007B: SUBWF 35,W
007C: ADDWF 00,W
007D: MOVWF 04
007E: BCF 03.7
007F: BTFSC 56.0
0080: BSF 03.7
0081: MOVF 00,W
0082: MOVWF 3E
0083: MOVWF 3F
0084: CALL 031
.................... }
.................... }
....................
....................
....................
.................... /*#int_EXT // Interrupt from 1PPS
.................... void EXT_isr(void)
.................... {
.................... unsigned int16 countH;
.................... unsigned int8 countL;
.................... char countS[10], a[4], b[4], c[4]; // strings for printing results
....................
.................... countL=0;
.................... countH=get_timer1(); // read internal counter
.................... output_low(SEL0);
.................... output_low(SEL1);
.................... countL=input(CLKI); // read bit 0 of external counter
.................... output_high(SEL0);
.................... output_low(SEL1);
.................... countL|=input(CLKI)<<1; // read bit 1 of external counter
.................... output_low(SEL0);
.................... output_high(SEL1);
.................... countL|=input(CLKI)<<2; // read bit 2 of external counter
.................... output_high(SEL0);
.................... output_high(SEL1);
.................... countL|=input(CLKI)<<3; // read bit 3 of external counter
....................
.................... output_low(MR); // External counter Master Reset
.................... output_high(MR);
....................
.................... set_timer1(0); // Internal counter reset
....................
.................... count=((unsigned int32)of<<20)+((unsigned int32)countH<<4)+(unsigned int32)countL; // concatenate
....................
.................... sprintf(countS,"%09Lu", count); // engeneering values conversion
.................... strncpy(a, countS, 3); a[3]='\0';
.................... strncpy(b, &countS[3], 3); b[3]='\0';
.................... strncpy(c, &countS[6], 3); c[3]='\0';
....................
.................... printf("%s\r\n", countS); // output to RS232
....................
.................... output_toggle(BEEP); // cvak...
....................
.................... of=0; // reset overflow counter
.................... }
....................
.................... #int_TIMER1 // Interrupf from overflow
.................... void TIMER1_isr(void)
.................... {
.................... of++;
.................... }
....................
....................
.................... /*#int_TIMER2 // every 10 ms
.................... void TIMER2_isr(void)
.................... {
.................... output_low(CE);
.................... count=get_timer1();
.................... set_timer1(0);
.................... output_high(CE);
.................... }*/
....................
....................
0085: BCF 0C.3
0086: BCF 0A.3
0087: BCF 0A.4
0088: GOTO 01D
.................... void main()
.................... {
*
0111: CLRF 04
0112: BCF 03.7
0113: MOVLW 1F
0114: ANDWF 03,F
0115: BSF 03.5
0116: BSF 03.6
0117: BSF 07.3
0118: MOVLW 08
0119: BCF 03.6
011A: MOVWF 19
011B: MOVLW 02
011C: MOVWF 1A
011D: MOVLW A6
011E: MOVWF 18
011F: MOVLW 90
0120: BCF 03.5
0121: MOVWF 18
0122: BSF 28.3
0123: MOVF 28,W
0124: BSF 03.5
0125: MOVWF 07
0126: BCF 03.5
0127: BSF 28.4
0128: MOVF 28,W
0129: BSF 03.5
012A: MOVWF 07
012B: MOVLW A2
012C: MOVWF 13
012D: MOVLW 36
012E: BCF 03.5
012F: MOVWF 14
0130: CLRF 35
0131: CLRF 37
0132: CLRF 36
0133: BSF 03.5
0134: BSF 03.6
0135: MOVF 09,W
0136: ANDLW C0
0137: MOVWF 09
0138: BCF 03.6
0139: BCF 1F.4
013A: BCF 1F.5
013B: MOVLW 00
013C: BSF 03.6
013D: MOVWF 08
013E: BCF 03.5
013F: CLRF 07
0140: CLRF 08
0141: CLRF 09
.................... /* setup_adc_ports(NO_ANALOGS|VSS_VDD);
.................... setup_adc(ADC_OFF);
.................... // setup_spi(SPI_SS_DISABLED);
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
.................... // setup_wdt(WDT_144MS);
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1);
.................... setup_timer_2(T2_DIV_BY_16,196,16);
.................... setup_ccp1(CCP_OFF);
.................... setup_comparator(NC_NC_NC_NC);
.................... setup_vref(FALSE);
....................
.................... */
....................
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
*
0148: BSF 03.5
0149: BSF 03.6
014A: MOVF 09,W
014B: ANDLW C0
014C: MOVWF 09
014D: BCF 03.6
014E: BCF 1F.4
014F: BCF 1F.5
0150: MOVLW 00
0151: BSF 03.6
0152: MOVWF 08
.................... // setup_adc(ADC_CLOCK_DIV_2);
.................... setup_adc(ADC_OFF);
0153: BCF 03.5
0154: BCF 03.6
0155: BCF 1F.0
.................... // setup_spi(SPI_SS_DISABLED); //must not be set if I2C are in use!
.................... setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1);
0156: BSF 03.5
0157: MOVF 01,W
0158: ANDLW C7
0159: IORLW 28
015A: MOVWF 01
.................... // setup_timer_0(RTCC_INTERNAL);setup_wdt(WDT_144MS);
.................... setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1|T1_CLK_OUT);
015B: MOVLW 0F
015C: BCF 03.5
015D: MOVWF 10
.................... // setup_timer_2(T2_DISABLED,0,1);
.................... setup_comparator(NC_NC_NC_NC);
015E: BSF 03.6
015F: CLRF 07
0160: CLRF 08
0161: CLRF 09
.................... setup_vref(FALSE);
0162: BSF 03.5
0163: BCF 03.6
0164: CLRF 17
.................... // setup_oscillator(OSC_8MHZ|OSC_INTRC);
....................
.................... // ext_int_edge( L_TO_H ); // set 1PPS active edge
.................... // enable_interrupts(INT_TIMER1);
.................... // enable_interrupts(INT_EXT);
.................... enable_interrupts(INT_SSP);
0165: BSF 0C.3
.................... // enable_interrupts(INT_TIMER2);
.................... enable_interrupts(GLOBAL);
0166: MOVLW C0
0167: BCF 03.5
0168: IORWF 0B,F
....................
....................
.................... /* delay_ms(1000);
.................... int n;
.................... for (n=0;n<40;n++) putc(cmd[n]); // setup GPS
....................
.................... */
....................
.................... printf("cvak...\r\n");
0169: MOVLW 89
016A: BSF 03.6
016B: MOVWF 0D
016C: MOVLW 00
016D: MOVWF 0F
016E: BCF 03.6
016F: GOTO 08E
....................
....................
.................... buffer[2]=0;
0170: CLRF 2F
.................... buffer[3]=0;
0171: CLRF 30
.................... buffer[4]=0;
0172: CLRF 31
.................... buffer[5]=0;
0173: CLRF 32
....................
.................... while(true)
.................... {
.................... // output_high(LED);
.................... delay_ms(1000);
0174: MOVLW 04
0175: MOVWF 39
0176: MOVLW FA
0177: MOVWF 3A
0178: GOTO 0D8
0179: DECFSZ 39,F
017A: GOTO 176
.................... // output_low(LED);
.................... // delay_ms(999);
.................... printf("%X %X %X %X\r\n", buffer[0],buffer[1],buffer[2],buffer[3]);
017B: MOVF 2D,W
017C: MOVWF 39
017D: MOVLW 37
017E: MOVWF 3A
017F: CALL 0EE
0180: MOVLW 20
0181: BTFSS 0C.4
0182: GOTO 181
0183: MOVWF 19
0184: MOVF 2E,W
0185: MOVWF 39
0186: MOVLW 37
0187: MOVWF 3A
0188: CALL 0EE
0189: MOVLW 20
018A: BTFSS 0C.4
018B: GOTO 18A
018C: MOVWF 19
018D: MOVF 2F,W
018E: MOVWF 39
018F: MOVLW 37
0190: MOVWF 3A
0191: CALL 0EE
0192: MOVLW 20
0193: BTFSS 0C.4
0194: GOTO 193
0195: MOVWF 19
0196: MOVF 30,W
0197: MOVWF 39
0198: MOVLW 37
0199: MOVWF 3A
019A: CALL 0EE
019B: MOVLW 0D
019C: BTFSS 0C.4
019D: GOTO 19C
019E: MOVWF 19
019F: MOVLW 0A
01A0: BTFSS 0C.4
01A1: GOTO 1A0
01A2: MOVWF 19
....................
.................... }
01A3: GOTO 174
.................... }
01A4: SLEEP
 
Configuration Fuses:
Word 1: 2CF2 HS NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
Word 2: 3FFF NOWRT BORV40
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.sta
0,0 → 1,53
 
ROM used: 421 (5%)
421 (5%) including unused fragments
 
1 Average locations per line
13 Average locations per statement
 
RAM used: 31 (8%) at main() level
37 (10%) worst case
 
Stack used: 3 worst case (out of 8 total available)
 
Lines Stmts % Files
----- ----- --- -----
176 33 100 main.c
22 0 0 main.h
423 0 0 C:\Program Files (x86)\PICC\Devices\16F887.h
----- -----
621 33 Total
 
Page ROM % RAM Vol Diff Functions:
---- --- --- --- --- ---- ----------
0 22 5 1 @delay_ms1
0 13 3 1 @I2C_WRITE_1
0 75 18 4 420 5.5 ssp_interupt
0 148 35 1 574 3.8 MAIN
0 5 1 0 231 6.6 @const88
0 74 18 3 231 6.6 @PSTRINGC7_9600_62_63
0 35 8 2 367 7.0 @PRINTF_X_9600_62_63
 
Program metrics:
Functions 5
Statements 33
Comments 180
Volume (V) 2590
Difficilty (D) 28.8
Effort to implement (E) 74647
Time to implement (T) 1 hours, 9 minutes
Est Delivered Bugs (B) 1
Cyclomatic Complexity 12
Maintainability (MI) 114
 
Segment Used Free
----------- ---- ----
00000-00003 4 0
00004-00030 45 0
00031-007FF 372 1627
00800-00FFF 0 2048
01000-017FF 0 2048
01800-01FFF 0 2048
 
 
 
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.sym
0,0 → 1,120
004-005 @READ_PROGRAM_MEMORY8.P1
004 @WRITE_PROGRAM_MEMORY8.P2
015 CCP_1
015 CCP_1_LOW
016 CCP_1_HIGH
01B CCP_2
01B CCP_2_LOW
01C CCP_2_HIGH
020 @INTERRUPT_AREA
021 @INTERRUPT_AREA
022 @INTERRUPT_AREA
023 @INTERRUPT_AREA
024 @INTERRUPT_AREA
025 @INTERRUPT_AREA
026 @INTERRUPT_AREA
027 rs232_errors
028 @TRIS_C
029-02C count
02D-034 buffer
035 address
036-037 of
038 @I2C_STATE
039 @PRINTF_X_9600_62_63.P1
039 MAIN.@SCRATCH1
039 @PSTRINGC7_9600_62_63.@SCRATCH1
03A @PRINTF_X_9600_62_63.P1
03A @delay_ms1.P2
03A @PSTRINGC7_9600_62_63.@SCRATCH2
03B @PSTRINGC7_9600_62_63.@SCRATCH3
03C ssp_interupt.incoming
03D ssp_interupt.state
03E ssp_interupt.@SCRATCH1
03F @I2C_WRITE_1.P1
03F ssp_interupt.@SCRATCH2
077 @SCRATCH
078 @SCRATCH
078 _RETURN_
079 @SCRATCH
07A @SCRATCH
07F @INTERRUPT_AREA
0FF @INTERRUPT_AREA
107.6 C1OUT
108.6 C2OUT
10D-10E @READ_PROGRAM_MEMORY8.P1
10D-10E @WRITE_PROGRAM_MEMORY8.P2
17F @INTERRUPT_AREA
1FF @INTERRUPT_AREA
27F @INTERRUPT_AREA
2FF @INTERRUPT_AREA
37F @INTERRUPT_AREA
3FF @INTERRUPT_AREA
47F @INTERRUPT_AREA
4FF @INTERRUPT_AREA
57F @INTERRUPT_AREA
5FF @INTERRUPT_AREA
67F @INTERRUPT_AREA
6FF @INTERRUPT_AREA
77F @INTERRUPT_AREA
7FF @INTERRUPT_AREA
87F @INTERRUPT_AREA
8FF @INTERRUPT_AREA
97F @INTERRUPT_AREA
9FF @INTERRUPT_AREA
A7F @INTERRUPT_AREA
AFF @INTERRUPT_AREA
B7F @INTERRUPT_AREA
BFF @INTERRUPT_AREA
C7F @INTERRUPT_AREA
CFF @INTERRUPT_AREA
D7F @INTERRUPT_AREA
DFF @INTERRUPT_AREA
E7F @INTERRUPT_AREA
EFF @INTERRUPT_AREA
F7F @INTERRUPT_AREA
FFF @INTERRUPT_AREA
 
ROM Allocation:
00D8 @delay_ms1
0031 @I2C_WRITE_1
003E ssp_interupt
0111 MAIN
0089 @const88
008E @PSTRINGC7_9600_62_63
00EE @PRINTF_X_9600_62_63
0111 @cinit
 
 
User Memory space:
 
User Memory space:
 
Project Directory:
Z:\home\kaklik\svn\svnMLAB\Designs\Measuring_instruments\RMDS01C\SW\PIC16F887\
 
Project Files:
main.c
main.h
C:\Program Files (x86)\PICC\Devices\16F887.h
 
Units:
Z:\home\kaklik\svn\svnMLAB\Designs\Measuring_instruments\RMDS01C\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
/Designs/Measuring_instruments/RMDS01C/SW/PIC16F887/main.tre
0,0 → 1,12
ÀÄmain
ÃÄMAIN 0/148 Ram=1
³ ÃÄ??0??
³ ÃÄ@PSTRINGC7_9600_62_63 0/74 Ram=3
³ ÃÄ@delay_ms1 0/22 Ram=1
³ ÃÄ@PRINTF_X_9600_62_63 0/35 Ram=2
³ ÃÄ@PRINTF_X_9600_62_63 0/35 Ram=2
³ ÃÄ@PRINTF_X_9600_62_63 0/35 Ram=2
³ ÀÄ@PRINTF_X_9600_62_63 0/35 Ram=2
ÀÄssp_interupt 0/75 Ram=4
ÃÄ@I2C_WRITE_1 0/13 Ram=1
ÀÄ@I2C_WRITE_1 0/13 Ram=1