CCS PCM C Compiler, Version 4.106, 47914               12-4-13 14:16

               Filename: C:\Users\Honza\Documents\pic\I2C_klavesnice\main.lst

               ROM used: 963 words (12%)
                         Largest free fragment is 2048
               RAM used: 7 (2%) at main() level
                         35 (10%) worst case
               Stack:    2 locations

*
0000:  MOVLW  02
0001:  MOVWF  0A
0002:  GOTO   273
0003:  NOP
.................... #include "C:\Users\Honza\Documents\pic\I2C_klavesnice\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) 
*
025D:  MOVLW  35
025E:  MOVWF  04
025F:  BCF    03.7
0260:  MOVF   00,W
0261:  BTFSC  03.2
0262:  GOTO   270
0263:  MOVLW  02
0264:  MOVWF  78
0265:  CLRF   77
0266:  DECFSZ 77,F
0267:  GOTO   266
0268:  DECFSZ 78,F
0269:  GOTO   265
026A:  MOVLW  97
026B:  MOVWF  77
026C:  DECFSZ 77,F
026D:  GOTO   26C
026E:  DECFSZ 00,F
026F:  GOTO   263
0270:  BCF    0A.3
0271:  BCF    0A.4
0272:  GOTO   3BF (RETURN)
....................  
....................  
....................  
.................... //For AKCE 
.................... //ADRESA pro èteni 0x39 
.................... //pro zápis 0x38 
....................  
....................  
.................... #define EEPROM_SDA  PIN_B0 
.................... #define EEPROM_SCL  PIN_B1 
.................... #use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL) 
*
00A9:  MOVLW  08
00AA:  MOVWF  78
00AB:  NOP
00AC:  BCF    06.1
00AD:  BSF    03.5
00AE:  BCF    06.1
00AF:  NOP
00B0:  BCF    03.5
00B1:  RLF    34,F
00B2:  BCF    06.0
00B3:  BTFSS  03.0
00B4:  GOTO   0B8
00B5:  BSF    03.5
00B6:  BSF    06.0
00B7:  BCF    03.5
00B8:  BTFSC  03.0
00B9:  GOTO   0BD
00BA:  BSF    03.5
00BB:  BCF    06.0
00BC:  BCF    03.5
00BD:  BSF    03.5
00BE:  BSF    06.1
00BF:  BCF    03.5
00C0:  BTFSS  06.1
00C1:  GOTO   0C0
00C2:  DECFSZ 78,F
00C3:  GOTO   0AB
00C4:  NOP
00C5:  BCF    06.1
00C6:  BSF    03.5
00C7:  BCF    06.1
00C8:  NOP
00C9:  BSF    06.0
00CA:  NOP
00CB:  NOP
00CC:  BSF    06.1
00CD:  BCF    03.5
00CE:  BTFSS  06.1
00CF:  GOTO   0CE
00D0:  CLRF   78
00D1:  NOP
00D2:  BTFSC  06.0
00D3:  BSF    78.0
00D4:  BCF    06.1
00D5:  BSF    03.5
00D6:  BCF    06.1
00D7:  BCF    03.5
00D8:  BCF    06.0
00D9:  BSF    03.5
00DA:  BCF    06.0
00DB:  BCF    03.5
00DC:  RETURN
00DD:  MOVLW  08
00DE:  MOVWF  35
00DF:  MOVF   77,W
00E0:  MOVWF  36
00E1:  BSF    03.5
00E2:  BSF    06.0
00E3:  NOP
00E4:  BSF    06.1
00E5:  BCF    03.5
00E6:  BTFSS  06.1
00E7:  GOTO   0E6
00E8:  BTFSC  06.0
00E9:  BSF    03.0
00EA:  BTFSS  06.0
00EB:  BCF    03.0
00EC:  RLF    78,F
00ED:  NOP
00EE:  BSF    03.5
00EF:  BCF    06.1
00F0:  BCF    03.5
00F1:  BCF    06.1
00F2:  DECFSZ 35,F
00F3:  GOTO   0E1
00F4:  BSF    03.5
00F5:  BSF    06.0
00F6:  NOP
00F7:  BCF    03.5
00F8:  BCF    06.0
00F9:  MOVF   36,W
00FA:  BTFSC  03.2
00FB:  GOTO   0FF
00FC:  BSF    03.5
00FD:  BCF    06.0
00FE:  BCF    03.5
00FF:  NOP
0100:  BSF    03.5
0101:  BSF    06.1
0102:  BCF    03.5
0103:  BTFSS  06.1
0104:  GOTO   103
0105:  NOP
0106:  BCF    06.1
0107:  BSF    03.5
0108:  BCF    06.1
0109:  NOP
010A:  BCF    03.5
010B:  BCF    06.0
010C:  BSF    03.5
010D:  BCF    06.0
010E:  BCF    03.5
010F:  BCF    0A.3
0110:  BCF    0A.4
0111:  GOTO   33C (RETURN)
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD 
*
003F:  BSF    03.5
0040:  BCF    06.3
0041:  BCF    03.5
0042:  BCF    06.3
0043:  MOVLW  08
0044:  MOVWF  78
0045:  GOTO   046
0046:  NOP
0047:  BSF    78.7
0048:  GOTO   057
0049:  BCF    78.7
004A:  RRF    3D,F
004B:  BTFSC  03.0
004C:  BSF    06.3
004D:  BTFSS  03.0
004E:  BCF    06.3
004F:  BSF    78.6
0050:  GOTO   057
0051:  BCF    78.6
0052:  DECFSZ 78,F
0053:  GOTO   04A
0054:  GOTO   055
0055:  NOP
0056:  BSF    06.3
0057:  MOVLW  3F
0058:  MOVWF  04
0059:  DECFSZ 04,F
005A:  GOTO   059
005B:  NOP
005C:  BTFSC  78.7
005D:  GOTO   049
005E:  BTFSC  78.6
005F:  GOTO   051
0060:  RETURN
....................  
....................  
.................... void main() 
.................... { 
*
003E:  DATA 00,00
*
0273:  CLRF   04
0274:  BCF    03.7
0275:  MOVLW  1F
0276:  ANDWF  03,F
0277:  MOVLW  71
0278:  BSF    03.5
0279:  MOVWF  0F
027A:  MOVF   0F,W
027B:  BCF    06.3
027C:  BCF    03.5
027D:  BSF    06.3
027E:  BSF    03.5
027F:  BSF    03.6
0280:  MOVF   09,W
0281:  ANDLW  C0
0282:  MOVWF  09
0283:  BCF    03.6
0284:  BCF    1F.4
0285:  BCF    1F.5
0286:  MOVLW  00
0287:  BSF    03.6
0288:  MOVWF  08
0289:  BCF    03.5
028A:  CLRF   07
028B:  CLRF   08
028C:  CLRF   09
....................  
....................    setup_adc_ports(NO_ANALOGS|VSS_VDD); 
*
0290:  BSF    03.5
0291:  BSF    03.6
0292:  MOVF   09,W
0293:  ANDLW  C0
0294:  MOVWF  09
0295:  BCF    03.6
0296:  BCF    1F.4
0297:  BCF    1F.5
0298:  MOVLW  00
0299:  BSF    03.6
029A:  MOVWF  08
....................    setup_adc(ADC_CLOCK_DIV_2); 
029B:  BCF    03.5
029C:  BCF    03.6
029D:  BCF    1F.6
029E:  BCF    1F.7
029F:  BSF    03.5
02A0:  BCF    1F.7
02A1:  BCF    03.5
02A2:  BSF    1F.0
....................    setup_spi(SPI_SS_DISABLED); 
02A3:  BCF    14.5
02A4:  BCF    20.5
02A5:  MOVF   20,W
02A6:  BSF    03.5
02A7:  MOVWF  07
02A8:  BCF    03.5
02A9:  BSF    20.4
02AA:  MOVF   20,W
02AB:  BSF    03.5
02AC:  MOVWF  07
02AD:  BCF    03.5
02AE:  BCF    20.3
02AF:  MOVF   20,W
02B0:  BSF    03.5
02B1:  MOVWF  07
02B2:  MOVLW  01
02B3:  BCF    03.5
02B4:  MOVWF  14
02B5:  MOVLW  00
02B6:  BSF    03.5
02B7:  MOVWF  14
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
02B8:  MOVF   01,W
02B9:  ANDLW  C7
02BA:  IORLW  08
02BB:  MOVWF  01
....................    setup_timer_1(T1_DISABLED); 
02BC:  BCF    03.5
02BD:  CLRF   10
....................    setup_timer_2(T2_DISABLED,0,1); 
02BE:  MOVLW  00
02BF:  MOVWF  78
02C0:  MOVWF  12
02C1:  MOVLW  00
02C2:  BSF    03.5
02C3:  MOVWF  12
....................    setup_ccp1(CCP_OFF); 
02C4:  BCF    03.5
02C5:  BSF    20.2
02C6:  MOVF   20,W
02C7:  BSF    03.5
02C8:  MOVWF  07
02C9:  BCF    03.5
02CA:  CLRF   17
02CB:  BSF    03.5
02CC:  CLRF   1B
02CD:  CLRF   1C
02CE:  MOVLW  01
02CF:  MOVWF  1D
....................    setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard 
02D0:  BCF    03.5
02D1:  BSF    03.6
02D2:  CLRF   07
02D3:  CLRF   08
02D4:  CLRF   09
....................  
.................... printf("Simple Thermomether  \r\n",); 
02D5:  MOVLW  04
02D6:  MOVWF  0D
02D7:  MOVLW  00
02D8:  MOVWF  0F
02D9:  BCF    03.6
02DA:  GOTO   061
....................  
.................... int16 data1, data2, data3; 
.................... signed int16 X, Y, Z; 
....................  
.................... unsigned int8 XL,XH,YL,YH,ZL,ZH; 
....................  
....................  
....................   while(TRUE) 
....................  {  
....................  
.................... data1=0; 
02DB:  CLRF   22
02DC:  CLRF   21
.................... data2=0 ; 
02DD:  CLRF   24
02DE:  CLRF   23
....................  
....................  
.................... //akcelerometr 
....................    int1 ack; 
....................    i2c_start();            // If the write command is acknowledged, 
02DF:  BSF    03.5
02E0:  BSF    06.0
02E1:  NOP
02E2:  BSF    06.1
02E3:  NOP
02E4:  BCF    03.5
02E5:  BCF    06.0
02E6:  BSF    03.5
02E7:  BCF    06.0
02E8:  NOP
02E9:  BCF    03.5
02EA:  BCF    06.1
02EB:  BSF    03.5
02EC:  BCF    06.1
....................    ack = i2c_write(0xB4);//hen the device is ready. 
02ED:  MOVLW  B4
02EE:  BCF    03.5
02EF:  MOVWF  34
02F0:  CALL   0A9
02F1:  MOVF   78,W
02F2:  BCF    33.0
02F3:  BTFSC  78.0
02F4:  BSF    33.0
....................    i2c_stop(); 
02F5:  BSF    03.5
02F6:  BCF    06.0
02F7:  NOP
02F8:  BSF    06.1
02F9:  BCF    03.5
02FA:  BTFSS  06.1
02FB:  GOTO   2FA
02FC:  NOP
02FD:  GOTO   2FE
02FE:  NOP
02FF:  BSF    03.5
0300:  BSF    06.0
0301:  NOP
....................   ack=!ack; 
0302:  MOVLW  01
0303:  BCF    03.5
0304:  XORWF  33,F
....................     
....................     
....................     
....................    i2c_stop(); 
0305:  BSF    03.5
0306:  BCF    06.0
0307:  NOP
0308:  BSF    06.1
0309:  BCF    03.5
030A:  BTFSS  06.1
030B:  GOTO   30A
030C:  NOP
030D:  GOTO   30E
030E:  NOP
030F:  BSF    03.5
0310:  BSF    06.0
0311:  NOP
....................  
....................    i2c_start(); 
0312:  BSF    06.0
0313:  NOP
0314:  BSF    06.1
0315:  NOP
0316:  BCF    03.5
0317:  BCF    06.0
0318:  BSF    03.5
0319:  BCF    06.0
031A:  NOP
031B:  BCF    03.5
031C:  BCF    06.1
031D:  BSF    03.5
031E:  BCF    06.1
....................    I2C_Write(0xB5); 
031F:  MOVLW  B5
0320:  BCF    03.5
0321:  MOVWF  34
0322:  CALL   0A9
....................    I2C_write(0x04); 
0323:  MOVLW  04
0324:  MOVWF  34
0325:  CALL   0A9
.................... // i2c_stop(); 
....................    i2c_start(); 
0326:  BSF    03.5
0327:  BSF    06.0
0328:  NOP
0329:  BSF    06.1
032A:  NOP
032B:  BCF    03.5
032C:  BTFSS  06.1
032D:  GOTO   32C
032E:  BCF    06.0
032F:  BSF    03.5
0330:  BCF    06.0
0331:  NOP
0332:  BCF    03.5
0333:  BCF    06.1
0334:  BSF    03.5
0335:  BCF    06.1
....................    I2C_Write(0xB4); 
0336:  MOVLW  B4
0337:  BCF    03.5
0338:  MOVWF  34
0339:  CALL   0A9
....................  XH=i2c_read(0); 
033A:  CLRF   77
033B:  GOTO   0DD
033C:  MOVF   78,W
033D:  MOVWF  2E
....................    i2c_stop();  
033E:  BSF    03.5
033F:  BCF    06.0
0340:  NOP
0341:  BSF    06.1
0342:  BCF    03.5
0343:  BTFSS  06.1
0344:  GOTO   343
0345:  NOP
0346:  GOTO   347
0347:  NOP
0348:  BSF    03.5
0349:  BSF    06.0
034A:  NOP
....................  
....................  
.................... printf("Stav: %d (procenta)\r\n", ack); 
034B:  MOVLW  00
034C:  BCF    03.5
034D:  BTFSC  33.0
034E:  MOVLW  01
034F:  MOVWF  34
0350:  MOVLW  10
0351:  BSF    03.6
0352:  MOVWF  0D
0353:  MOVLW  00
0354:  MOVWF  0F
0355:  BCF    03.0
0356:  MOVLW  06
0357:  BCF    03.6
0358:  MOVWF  35
0359:  CALL   112
035A:  MOVF   34,W
035B:  MOVWF  35
035C:  MOVLW  1F
035D:  MOVWF  36
035E:  GOTO   176
035F:  MOVLW  14
0360:  BSF    03.6
0361:  MOVWF  0D
0362:  MOVLW  00
0363:  MOVWF  0F
0364:  BCF    03.0
0365:  MOVLW  0D
0366:  BCF    03.6
0367:  MOVWF  35
0368:  CALL   112
....................  
.................... printf("Stavx: %Ld(procenta)\r\n", X); 
0369:  MOVLW  1B
036A:  BSF    03.6
036B:  MOVWF  0D
036C:  MOVLW  00
036D:  MOVWF  0F
036E:  BCF    03.0
036F:  MOVLW  07
0370:  BCF    03.6
0371:  MOVWF  35
0372:  CALL   112
0373:  MOVLW  10
0374:  MOVWF  04
0375:  MOVF   28,W
0376:  MOVWF  35
0377:  MOVF   27,W
0378:  MOVWF  34
0379:  CALL   1DD
037A:  MOVLW  20
037B:  BSF    03.6
037C:  MOVWF  0D
037D:  MOVLW  00
037E:  MOVWF  0F
037F:  BCF    03.0
0380:  MOVLW  0C
0381:  BCF    03.6
0382:  MOVWF  35
0383:  CALL   112
.................... printf("Stavy: %Ld(procenta)\r\n", Y); 
0384:  MOVLW  27
0385:  BSF    03.6
0386:  MOVWF  0D
0387:  MOVLW  00
0388:  MOVWF  0F
0389:  BCF    03.0
038A:  MOVLW  07
038B:  BCF    03.6
038C:  MOVWF  35
038D:  CALL   112
038E:  MOVLW  10
038F:  MOVWF  04
0390:  MOVF   2A,W
0391:  MOVWF  35
0392:  MOVF   29,W
0393:  MOVWF  34
0394:  CALL   1DD
0395:  MOVLW  2C
0396:  BSF    03.6
0397:  MOVWF  0D
0398:  MOVLW  00
0399:  MOVWF  0F
039A:  BCF    03.0
039B:  MOVLW  0C
039C:  BCF    03.6
039D:  MOVWF  35
039E:  CALL   112
.................... printf("Stavz: %Ld(procenta)\r\n", Z); 
039F:  MOVLW  33
03A0:  BSF    03.6
03A1:  MOVWF  0D
03A2:  MOVLW  00
03A3:  MOVWF  0F
03A4:  BCF    03.0
03A5:  MOVLW  07
03A6:  BCF    03.6
03A7:  MOVWF  35
03A8:  CALL   112
03A9:  MOVLW  10
03AA:  MOVWF  04
03AB:  MOVF   2C,W
03AC:  MOVWF  35
03AD:  MOVF   2B,W
03AE:  MOVWF  34
03AF:  CALL   1DD
03B0:  MOVLW  38
03B1:  BSF    03.6
03B2:  MOVWF  0D
03B3:  MOVLW  00
03B4:  MOVWF  0F
03B5:  BCF    03.0
03B6:  MOVLW  0C
03B7:  BCF    03.6
03B8:  MOVWF  35
03B9:  CALL   112
....................  
.................... delay_ms (2000); 
03BA:  MOVLW  08
03BB:  MOVWF  34
03BC:  MOVLW  FA
03BD:  MOVWF  35
03BE:  GOTO   25D
03BF:  DECFSZ 34,F
03C0:  GOTO   3BC
....................  
....................  }  
03C1:  GOTO   2DB
.................... } 
03C2:  SLEEP

Configuration Fuses:
   Word  1: 2CF5   INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUG
   Word  2: 3FFF   NOWRT BORV40