CCS PCM C Compiler, Version 4.106, 47914 06-4-13 20:57
Filename: C:\Users\Honza\Documents\pic\I2C_bat_cteni\main.lst
ROM used: 986 words (12%)
Largest free fragment is 2048
RAM used: 6 (2%) at main() level
19 (5%) worst case
Stack: 2 locations
*
0000: MOVLW 01
0001: MOVWF 0A
0002: GOTO 1DC
0003: NOP
.................... #include "C:\Users\Honza\Documents\pic\I2C_bat_cteni\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)
*
00D7: MOVLW 29
00D8: MOVWF 04
00D9: BCF 03.7
00DA: MOVF 00,W
00DB: BTFSC 03.2
00DC: GOTO 0EA
00DD: MOVLW 02
00DE: MOVWF 78
00DF: CLRF 77
00E0: DECFSZ 77,F
00E1: GOTO 0E0
00E2: DECFSZ 78,F
00E3: GOTO 0DF
00E4: MOVLW 97
00E5: MOVWF 77
00E6: DECFSZ 77,F
00E7: GOTO 0E6
00E8: DECFSZ 00,F
00E9: GOTO 0DD
00EA: RETURN
....................
....................
....................
.................... #define EEPROM_SDA PIN_B0
.................... #define EEPROM_SCL PIN_B1
.................... #use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL)
*
00A3: MOVLW 08
00A4: MOVWF 78
00A5: NOP
00A6: BCF 06.1
00A7: BSF 03.5
00A8: BCF 06.1
00A9: NOP
00AA: BCF 03.5
00AB: RLF 29,F
00AC: BCF 06.0
00AD: BTFSS 03.0
00AE: GOTO 0B2
00AF: BSF 03.5
00B0: BSF 06.0
00B1: BCF 03.5
00B2: BTFSC 03.0
00B3: GOTO 0B7
00B4: BSF 03.5
00B5: BCF 06.0
00B6: BCF 03.5
00B7: BSF 03.5
00B8: BSF 06.1
00B9: BCF 03.5
00BA: BTFSS 06.1
00BB: GOTO 0BA
00BC: DECFSZ 78,F
00BD: GOTO 0A5
00BE: NOP
00BF: BCF 06.1
00C0: BSF 03.5
00C1: BCF 06.1
00C2: NOP
00C3: BSF 06.0
00C4: NOP
00C5: NOP
00C6: BSF 06.1
00C7: BCF 03.5
00C8: BTFSS 06.1
00C9: GOTO 0C8
00CA: CLRF 78
00CB: NOP
00CC: BTFSC 06.0
00CD: BSF 78.0
00CE: BCF 06.1
00CF: BSF 03.5
00D0: BCF 06.1
00D1: BCF 03.5
00D2: BCF 06.0
00D3: BSF 03.5
00D4: BCF 06.0
00D5: BCF 03.5
00D6: RETURN
*
0137: MOVLW 08
0138: MOVWF 2A
0139: MOVF 77,W
013A: MOVWF 2B
013B: BSF 03.5
013C: BSF 06.0
013D: NOP
013E: BSF 06.1
013F: BCF 03.5
0140: BTFSS 06.1
0141: GOTO 140
0142: BTFSC 06.0
0143: BSF 03.0
0144: BTFSS 06.0
0145: BCF 03.0
0146: RLF 78,F
0147: NOP
0148: BSF 03.5
0149: BCF 06.1
014A: BCF 03.5
014B: BCF 06.1
014C: DECFSZ 2A,F
014D: GOTO 13B
014E: BSF 03.5
014F: BSF 06.0
0150: NOP
0151: BCF 03.5
0152: BCF 06.0
0153: MOVF 2B,W
0154: BTFSC 03.2
0155: GOTO 159
0156: BSF 03.5
0157: BCF 06.0
0158: BCF 03.5
0159: NOP
015A: BSF 03.5
015B: BSF 06.1
015C: BCF 03.5
015D: BTFSS 06.1
015E: GOTO 15D
015F: NOP
0160: BCF 06.1
0161: BSF 03.5
0162: BCF 06.1
0163: NOP
0164: BCF 03.5
0165: BCF 06.0
0166: BSF 03.5
0167: BCF 06.0
0168: BCF 03.5
0169: BCF 0A.3
016A: BCF 0A.4
016B: GOTO 344 (RETURN)
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD
*
0039: BSF 03.5
003A: BCF 06.3
003B: BCF 03.5
003C: BCF 06.3
003D: MOVLW 08
003E: MOVWF 78
003F: GOTO 040
0040: NOP
0041: BSF 78.7
0042: GOTO 051
0043: BCF 78.7
0044: RRF 2D,F
0045: BTFSC 03.0
0046: BSF 06.3
0047: BTFSS 03.0
0048: BCF 06.3
0049: BSF 78.6
004A: GOTO 051
004B: BCF 78.6
004C: DECFSZ 78,F
004D: GOTO 044
004E: GOTO 04F
004F: NOP
0050: BSF 06.3
0051: MOVLW 3F
0052: MOVWF 04
0053: DECFSZ 04,F
0054: GOTO 053
0055: NOP
0056: BTFSC 78.7
0057: GOTO 043
0058: BTFSC 78.6
0059: GOTO 04B
005A: RETURN
....................
....................
.................... void main()
.................... {
*
0038: DATA 00,00
*
01DC: CLRF 04
01DD: BCF 03.7
01DE: MOVLW 1F
01DF: ANDWF 03,F
01E0: MOVLW 71
01E1: BSF 03.5
01E2: MOVWF 0F
01E3: MOVF 0F,W
01E4: BCF 06.3
01E5: BCF 03.5
01E6: BSF 06.3
01E7: BSF 03.5
01E8: BSF 03.6
01E9: MOVF 09,W
01EA: ANDLW C0
01EB: MOVWF 09
01EC: BCF 03.6
01ED: BCF 1F.4
01EE: BCF 1F.5
01EF: MOVLW 00
01F0: BSF 03.6
01F1: MOVWF 08
01F2: BCF 03.5
01F3: CLRF 07
01F4: CLRF 08
01F5: CLRF 09
....................
.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);
*
01F9: BSF 03.5
01FA: BSF 03.6
01FB: MOVF 09,W
01FC: ANDLW C0
01FD: MOVWF 09
01FE: BCF 03.6
01FF: BCF 1F.4
0200: BCF 1F.5
0201: MOVLW 00
0202: BSF 03.6
0203: MOVWF 08
.................... setup_adc(ADC_CLOCK_DIV_2);
0204: BCF 03.5
0205: BCF 03.6
0206: BCF 1F.6
0207: BCF 1F.7
0208: BSF 03.5
0209: BCF 1F.7
020A: BCF 03.5
020B: BSF 1F.0
.................... setup_spi(SPI_SS_DISABLED);
020C: BCF 14.5
020D: BCF 20.5
020E: MOVF 20,W
020F: BSF 03.5
0210: MOVWF 07
0211: BCF 03.5
0212: BSF 20.4
0213: MOVF 20,W
0214: BSF 03.5
0215: MOVWF 07
0216: BCF 03.5
0217: BCF 20.3
0218: MOVF 20,W
0219: BSF 03.5
021A: MOVWF 07
021B: MOVLW 01
021C: BCF 03.5
021D: MOVWF 14
021E: MOVLW 00
021F: BSF 03.5
0220: MOVWF 14
.................... setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1);
0221: MOVF 01,W
0222: ANDLW C7
0223: IORLW 08
0224: MOVWF 01
.................... setup_timer_1(T1_DISABLED);
0225: BCF 03.5
0226: CLRF 10
.................... setup_timer_2(T2_DISABLED,0,1);
0227: MOVLW 00
0228: MOVWF 78
0229: MOVWF 12
022A: MOVLW 00
022B: BSF 03.5
022C: MOVWF 12
.................... setup_ccp1(CCP_OFF);
022D: BCF 03.5
022E: BSF 20.2
022F: MOVF 20,W
0230: BSF 03.5
0231: MOVWF 07
0232: BCF 03.5
0233: CLRF 17
0234: BSF 03.5
0235: CLRF 1B
0236: CLRF 1C
0237: MOVLW 01
0238: MOVWF 1D
.................... setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard
0239: BCF 03.5
023A: BSF 03.6
023B: CLRF 07
023C: CLRF 08
023D: CLRF 09
....................
.................... printf("Simple Thermomether \r\n",);
023E: MOVLW 04
023F: MOVWF 0D
0240: MOVLW 00
0241: MOVWF 0F
0242: BCF 03.6
0243: GOTO 05B
.................... unsigned int8 STAV1,STAV2;
....................
.................... unsigned int16 SOUCET, SOUCET1;
.................... unsigned int8 LSB;
.................... //unsigned int8
....................
.................... //while(TRUE)
.................... //{
....................
....................
....................
....................
.................... i2c_start(); //blockdatacontrol
0244: BSF 03.5
0245: BSF 06.0
0246: NOP
0247: BSF 06.1
0248: NOP
0249: BCF 03.5
024A: BCF 06.0
024B: BSF 03.5
024C: BCF 06.0
024D: NOP
024E: BCF 03.5
024F: BCF 06.1
0250: BSF 03.5
0251: BCF 06.1
.................... I2C_Write(0xAA);
0252: MOVLW AA
0253: BCF 03.5
0254: MOVWF 29
0255: CALL 0A3
.................... I2C_write(0x61);
0256: MOVLW 61
0257: MOVWF 29
0258: CALL 0A3
.................... i2c_start();
0259: BSF 03.5
025A: BSF 06.0
025B: NOP
025C: BSF 06.1
025D: NOP
025E: BCF 03.5
025F: BTFSS 06.1
0260: GOTO 25F
0261: BCF 06.0
0262: BSF 03.5
0263: BCF 06.0
0264: NOP
0265: BCF 03.5
0266: BCF 06.1
0267: BSF 03.5
0268: BCF 06.1
.................... I2C_Write(0xAA);
0269: MOVLW AA
026A: BCF 03.5
026B: MOVWF 29
026C: CALL 0A3
.................... i2c_write(0x00);
026D: CLRF 29
026E: CALL 0A3
.................... i2c_stop();
026F: BSF 03.5
0270: BCF 06.0
0271: NOP
0272: BSF 06.1
0273: BCF 03.5
0274: BTFSS 06.1
0275: GOTO 274
0276: NOP
0277: GOTO 278
0278: NOP
0279: BSF 03.5
027A: BSF 06.0
027B: NOP
.................... delay_ms (1);
027C: MOVLW 01
027D: BCF 03.5
027E: MOVWF 29
027F: CALL 0D7
....................
....................
.................... i2c_start();//dataflashclass
0280: BSF 03.5
0281: BSF 06.0
0282: NOP
0283: BSF 06.1
0284: NOP
0285: BCF 03.5
0286: BCF 06.0
0287: BSF 03.5
0288: BCF 06.0
0289: NOP
028A: BCF 03.5
028B: BCF 06.1
028C: BSF 03.5
028D: BCF 06.1
.................... I2C_Write(0xAA);
028E: MOVLW AA
028F: BCF 03.5
0290: MOVWF 29
0291: CALL 0A3
.................... I2C_write(0x3e);
0292: MOVLW 3E
0293: MOVWF 29
0294: CALL 0A3
....................
.................... i2c_start();
0295: BSF 03.5
0296: BSF 06.0
0297: NOP
0298: BSF 06.1
0299: NOP
029A: BCF 03.5
029B: BTFSS 06.1
029C: GOTO 29B
029D: BCF 06.0
029E: BSF 03.5
029F: BCF 06.0
02A0: NOP
02A1: BCF 03.5
02A2: BCF 06.1
02A3: BSF 03.5
02A4: BCF 06.1
.................... I2C_Write(0xAA);
02A5: MOVLW AA
02A6: BCF 03.5
02A7: MOVWF 29
02A8: CALL 0A3
.................... i2c_write(0x40);
02A9: MOVLW 40
02AA: MOVWF 29
02AB: CALL 0A3
.................... i2c_stop();
02AC: BSF 03.5
02AD: BCF 06.0
02AE: NOP
02AF: BSF 06.1
02B0: BCF 03.5
02B1: BTFSS 06.1
02B2: GOTO 2B1
02B3: NOP
02B4: GOTO 2B5
02B5: NOP
02B6: BSF 03.5
02B7: BSF 06.0
02B8: NOP
.................... delay_ms (1);
02B9: MOVLW 01
02BA: BCF 03.5
02BB: MOVWF 29
02BC: CALL 0D7
....................
....................
.................... i2c_start();//dataflashblock
02BD: BSF 03.5
02BE: BSF 06.0
02BF: NOP
02C0: BSF 06.1
02C1: NOP
02C2: BCF 03.5
02C3: BCF 06.0
02C4: BSF 03.5
02C5: BCF 06.0
02C6: NOP
02C7: BCF 03.5
02C8: BCF 06.1
02C9: BSF 03.5
02CA: BCF 06.1
.................... I2C_Write(0xAA);
02CB: MOVLW AA
02CC: BCF 03.5
02CD: MOVWF 29
02CE: CALL 0A3
.................... I2C_write(0x3f);
02CF: MOVLW 3F
02D0: MOVWF 29
02D1: CALL 0A3
....................
.................... i2c_start();
02D2: BSF 03.5
02D3: BSF 06.0
02D4: NOP
02D5: BSF 06.1
02D6: NOP
02D7: BCF 03.5
02D8: BTFSS 06.1
02D9: GOTO 2D8
02DA: BCF 06.0
02DB: BSF 03.5
02DC: BCF 06.0
02DD: NOP
02DE: BCF 03.5
02DF: BCF 06.1
02E0: BSF 03.5
02E1: BCF 06.1
.................... I2C_Write(0xAA);
02E2: MOVLW AA
02E3: BCF 03.5
02E4: MOVWF 29
02E5: CALL 0A3
.................... I2C_write(0x00);
02E6: CLRF 29
02E7: CALL 0A3
.................... i2c_stop();
02E8: BSF 03.5
02E9: BCF 06.0
02EA: NOP
02EB: BSF 06.1
02EC: BCF 03.5
02ED: BTFSS 06.1
02EE: GOTO 2ED
02EF: NOP
02F0: GOTO 2F1
02F1: NOP
02F2: BSF 03.5
02F3: BSF 06.0
02F4: NOP
....................
.................... delay_ms (1);
02F5: MOVLW 01
02F6: BCF 03.5
02F7: MOVWF 29
02F8: CALL 0D7
....................
....................
....................
....................
....................
....................
....................
....................
.................... int i=64;
02F9: MOVLW 40
02FA: MOVWF 28
.................... SOUCET=0;
02FB: CLRF 24
02FC: CLRF 23
.................... for (i=64;i<=96;++i)
02FD: MOVWF 28
02FE: MOVF 28,W
02FF: SUBLW 60
0300: BTFSS 03.0
0301: GOTO 372
.................... {
.................... printf("%u\r\n",i);
0302: MOVF 28,W
0303: MOVWF 29
0304: MOVLW 1B
0305: MOVWF 2A
0306: GOTO 100
0307: MOVLW 0D
0308: MOVWF 2D
0309: CALL 039
030A: MOVLW 0A
030B: MOVWF 2D
030C: CALL 039
.................... i2c_stop();
030D: BSF 03.5
030E: BCF 06.0
030F: NOP
0310: BSF 06.1
0311: BCF 03.5
0312: BTFSS 06.1
0313: GOTO 312
0314: NOP
0315: GOTO 316
0316: NOP
0317: BSF 03.5
0318: BSF 06.0
0319: NOP
....................
.................... i2c_start();//blockdata
031A: BSF 06.0
031B: NOP
031C: BSF 06.1
031D: NOP
031E: BCF 03.5
031F: BCF 06.0
0320: BSF 03.5
0321: BCF 06.0
0322: NOP
0323: BCF 03.5
0324: BCF 06.1
0325: BSF 03.5
0326: BCF 06.1
.................... I2C_Write(0xAA);
0327: MOVLW AA
0328: BCF 03.5
0329: MOVWF 29
032A: CALL 0A3
.................... I2C_write(i);
032B: MOVF 28,W
032C: MOVWF 29
032D: CALL 0A3
....................
.................... i2c_start();
032E: BSF 03.5
032F: BSF 06.0
0330: NOP
0331: BSF 06.1
0332: NOP
0333: BCF 03.5
0334: BTFSS 06.1
0335: GOTO 334
0336: BCF 06.0
0337: BSF 03.5
0338: BCF 06.0
0339: NOP
033A: BCF 03.5
033B: BCF 06.1
033C: BSF 03.5
033D: BCF 06.1
.................... I2C_Write(0xAB);
033E: MOVLW AB
033F: BCF 03.5
0340: MOVWF 29
0341: CALL 0A3
.................... STAV1=I2C_read(0);
0342: CLRF 77
0343: GOTO 137
0344: MOVF 78,W
0345: MOVWF 21
.................... i2c_stop();
0346: BSF 03.5
0347: BCF 06.0
0348: NOP
0349: BSF 06.1
034A: BCF 03.5
034B: BTFSS 06.1
034C: GOTO 34B
034D: NOP
034E: GOTO 34F
034F: NOP
0350: BSF 03.5
0351: BSF 06.0
0352: NOP
....................
.................... printf("STAV %lX \r\n", STAV1);
0353: MOVLW 10
0354: BCF 03.5
0355: BSF 03.6
0356: MOVWF 0D
0357: MOVLW 00
0358: MOVWF 0F
0359: BCF 03.0
035A: MOVLW 05
035B: BCF 03.6
035C: MOVWF 29
035D: CALL 16C
035E: MOVF 21,W
035F: MOVWF 29
0360: MOVLW 37
0361: MOVWF 2A
0362: CALL 1BB
0363: MOVLW 20
0364: MOVWF 2D
0365: CALL 039
0366: MOVLW 0D
0367: MOVWF 2D
0368: CALL 039
0369: MOVLW 0A
036A: MOVWF 2D
036B: CALL 039
.................... SOUCET=SOUCET+STAV1;
036C: MOVF 21,W
036D: ADDWF 23,F
036E: BTFSC 03.0
036F: INCF 24,F
....................
....................
....................
....................
....................
.................... }
0370: INCF 28,F
0371: GOTO 2FE
.................... SOUCET1=SOUCET;
0372: MOVF 24,W
0373: MOVWF 26
0374: MOVF 23,W
0375: MOVWF 25
.................... SOUCET1=SOUCET1>>8;
0376: MOVF 26,W
0377: MOVWF 25
0378: CLRF 26
.................... printf("Deleno 256: %lX (procenta)\r\n", SOUCET1);
0379: MOVLW 16
037A: BSF 03.6
037B: MOVWF 0D
037C: MOVLW 00
037D: MOVWF 0F
037E: BCF 03.0
037F: MOVLW 0C
0380: BCF 03.6
0381: MOVWF 29
0382: CALL 16C
0383: MOVF 26,W
0384: MOVWF 29
0385: MOVLW 37
0386: MOVWF 2A
0387: CALL 1BB
0388: MOVF 25,W
0389: MOVWF 29
038A: MOVLW 37
038B: MOVWF 2A
038C: CALL 1BB
038D: MOVLW 1D
038E: BSF 03.6
038F: MOVWF 0D
0390: MOVLW 00
0391: MOVWF 0F
0392: BSF 03.0
0393: MOVLW 0D
0394: BCF 03.6
0395: MOVWF 29
0396: CALL 16C
.................... SOUCET1=SOUCET-SOUCET1;
0397: MOVF 25,W
0398: SUBWF 23,W
0399: MOVWF 25
039A: MOVF 26,W
039B: BTFSS 03.0
039C: INCFSZ 26,W
039D: GOTO 3A0
039E: MOVF 24,W
039F: GOTO 3A1
03A0: SUBWF 24,W
03A1: MOVWF 26
.................... printf("Soucet - soucet/256: %lX \r\n", SOUCET1);
03A2: MOVLW 25
03A3: BSF 03.6
03A4: MOVWF 0D
03A5: MOVLW 00
03A6: MOVWF 0F
03A7: BCF 03.0
03A8: MOVLW 15
03A9: BCF 03.6
03AA: MOVWF 29
03AB: CALL 16C
03AC: MOVF 26,W
03AD: MOVWF 29
03AE: MOVLW 37
03AF: MOVWF 2A
03B0: CALL 1BB
03B1: MOVF 25,W
03B2: MOVWF 29
03B3: MOVLW 37
03B4: MOVWF 2A
03B5: CALL 1BB
03B6: MOVLW 20
03B7: MOVWF 2D
03B8: CALL 039
03B9: MOVLW 0D
03BA: MOVWF 2D
03BB: CALL 039
03BC: MOVLW 0A
03BD: MOVWF 2D
03BE: CALL 039
.................... LSB=(unsigned int8)SOUCET1;
03BF: MOVF 25,W
03C0: MOVWF 27
.................... printf("LSB: %lX\r\n", LSB);
03C1: MOVLW 33
03C2: BSF 03.6
03C3: MOVWF 0D
03C4: MOVLW 00
03C5: MOVWF 0F
03C6: BCF 03.0
03C7: MOVLW 05
03C8: BCF 03.6
03C9: MOVWF 29
03CA: CALL 16C
03CB: MOVF 27,W
03CC: MOVWF 29
03CD: MOVLW 37
03CE: MOVWF 2A
03CF: CALL 1BB
03D0: MOVLW 0D
03D1: MOVWF 2D
03D2: CALL 039
03D3: MOVLW 0A
03D4: MOVWF 2D
03D5: CALL 039
.................... //printf("Stav: %X (procenta)\r\n", STAV2);
....................
....................
....................
....................
.................... delay_ms (100);
03D6: MOVLW 64
03D7: MOVWF 29
03D8: CALL 0D7
.................... }
03D9: SLEEP
Configuration Fuses:
Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
Word 2: 3FFF NOWRT BORV40