CCS PCM C Compiler, Version 4.106, 47914               02-4-13 10:53

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

               ROM used: 859 words (10%)
                         Largest free fragment is 2048
               RAM used: 7 (2%) at main() level
                         19 (5%) worst case
               Stack:    2 locations

*
0000:  MOVLW  01
0001:  MOVWF  0A
0002:  GOTO   1E1
0003:  NOP
.................... #include "C:\Users\Honza\Documents\pic\I2C_magnetometr\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) 
*
01CB:  MOVLW  25
01CC:  MOVWF  04
01CD:  BCF    03.7
01CE:  MOVF   00,W
01CF:  BTFSC  03.2
01D0:  GOTO   1DE
01D1:  MOVLW  02
01D2:  MOVWF  78
01D3:  CLRF   77
01D4:  DECFSZ 77,F
01D5:  GOTO   1D4
01D6:  DECFSZ 78,F
01D7:  GOTO   1D3
01D8:  MOVLW  97
01D9:  MOVWF  77
01DA:  DECFSZ 77,F
01DB:  GOTO   1DA
01DC:  DECFSZ 00,F
01DD:  GOTO   1D1
01DE:  BCF    0A.3
01DF:  BCF    0A.4
01E0:  GOTO   357 (RETURN)
....................  
....................  
.................... #define EEPROM_SDA  PIN_B0 
.................... #define EEPROM_SCL  PIN_B1 
.................... #use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL) 
*
009B:  MOVLW  08
009C:  MOVWF  78
009D:  NOP
009E:  BCF    06.1
009F:  BSF    03.5
00A0:  BCF    06.1
00A1:  NOP
00A2:  BCF    03.5
00A3:  RLF    24,F
00A4:  BCF    06.0
00A5:  BTFSS  03.0
00A6:  GOTO   0AA
00A7:  BSF    03.5
00A8:  BSF    06.0
00A9:  BCF    03.5
00AA:  BTFSC  03.0
00AB:  GOTO   0AF
00AC:  BSF    03.5
00AD:  BCF    06.0
00AE:  BCF    03.5
00AF:  BSF    03.5
00B0:  BSF    06.1
00B1:  BCF    03.5
00B2:  BTFSS  06.1
00B3:  GOTO   0B2
00B4:  DECFSZ 78,F
00B5:  GOTO   09D
00B6:  NOP
00B7:  BCF    06.1
00B8:  BSF    03.5
00B9:  BCF    06.1
00BA:  NOP
00BB:  BSF    06.0
00BC:  NOP
00BD:  NOP
00BE:  BSF    06.1
00BF:  BCF    03.5
00C0:  BTFSS  06.1
00C1:  GOTO   0C0
00C2:  CLRF   78
00C3:  NOP
00C4:  BTFSC  06.0
00C5:  BSF    78.0
00C6:  BCF    06.1
00C7:  BSF    03.5
00C8:  BCF    06.1
00C9:  BCF    03.5
00CA:  BCF    06.0
00CB:  BSF    03.5
00CC:  BCF    06.0
00CD:  BCF    03.5
00CE:  RETURN
00CF:  MOVLW  08
00D0:  MOVWF  25
00D1:  MOVF   77,W
00D2:  MOVWF  26
00D3:  BSF    03.5
00D4:  BSF    06.0
00D5:  NOP
00D6:  BSF    06.1
00D7:  BCF    03.5
00D8:  BTFSS  06.1
00D9:  GOTO   0D8
00DA:  BTFSC  06.0
00DB:  BSF    03.0
00DC:  BTFSS  06.0
00DD:  BCF    03.0
00DE:  RLF    78,F
00DF:  NOP
00E0:  BSF    03.5
00E1:  BCF    06.1
00E2:  BCF    03.5
00E3:  BCF    06.1
00E4:  DECFSZ 25,F
00E5:  GOTO   0D3
00E6:  BSF    03.5
00E7:  BSF    06.0
00E8:  NOP
00E9:  BCF    03.5
00EA:  BCF    06.0
00EB:  MOVF   26,W
00EC:  BTFSC  03.2
00ED:  GOTO   0F1
00EE:  BSF    03.5
00EF:  BCF    06.0
00F0:  BCF    03.5
00F1:  NOP
00F2:  BSF    03.5
00F3:  BSF    06.1
00F4:  BCF    03.5
00F5:  BTFSS  06.1
00F6:  GOTO   0F5
00F7:  NOP
00F8:  BCF    06.1
00F9:  BSF    03.5
00FA:  BCF    06.1
00FB:  NOP
00FC:  BCF    03.5
00FD:  BCF    06.0
00FE:  BSF    03.5
00FF:  BCF    06.0
0100:  BCF    03.5
0101:  RETURN
.................... #use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD 
*
0031:  BSF    03.5
0032:  BCF    06.3
0033:  BCF    03.5
0034:  BCF    06.3
0035:  MOVLW  08
0036:  MOVWF  78
0037:  GOTO   038
0038:  NOP
0039:  BSF    78.7
003A:  GOTO   049
003B:  BCF    78.7
003C:  RRF    2B,F
003D:  BTFSC  03.0
003E:  BSF    06.3
003F:  BTFSS  03.0
0040:  BCF    06.3
0041:  BSF    78.6
0042:  GOTO   049
0043:  BCF    78.6
0044:  DECFSZ 78,F
0045:  GOTO   03C
0046:  GOTO   047
0047:  NOP
0048:  BSF    06.3
0049:  MOVLW  3F
004A:  MOVWF  04
004B:  DECFSZ 04,F
004C:  GOTO   04B
004D:  NOP
004E:  BTFSC  78.7
004F:  GOTO   03B
0050:  BTFSC  78.6
0051:  GOTO   043
0052:  RETURN
....................  
....................  
.................... void main() 
.................... { 
*
01E1:  CLRF   04
01E2:  BCF    03.7
01E3:  MOVLW  1F
01E4:  ANDWF  03,F
01E5:  MOVLW  71
01E6:  BSF    03.5
01E7:  MOVWF  0F
01E8:  MOVF   0F,W
01E9:  BCF    06.3
01EA:  BCF    03.5
01EB:  BSF    06.3
01EC:  BSF    03.5
01ED:  BSF    03.6
01EE:  MOVF   09,W
01EF:  ANDLW  C0
01F0:  MOVWF  09
01F1:  BCF    03.6
01F2:  BCF    1F.4
01F3:  BCF    1F.5
01F4:  MOVLW  00
01F5:  BSF    03.6
01F6:  MOVWF  08
01F7:  BCF    03.5
01F8:  CLRF   07
01F9:  CLRF   08
01FA:  CLRF   09
....................  
....................    setup_adc_ports(NO_ANALOGS|VSS_VDD); 
*
01FE:  BSF    03.5
01FF:  BSF    03.6
0200:  MOVF   09,W
0201:  ANDLW  C0
0202:  MOVWF  09
0203:  BCF    03.6
0204:  BCF    1F.4
0205:  BCF    1F.5
0206:  MOVLW  00
0207:  BSF    03.6
0208:  MOVWF  08
....................    setup_adc(ADC_CLOCK_DIV_2); 
0209:  BCF    03.5
020A:  BCF    03.6
020B:  BCF    1F.6
020C:  BCF    1F.7
020D:  BSF    03.5
020E:  BCF    1F.7
020F:  BCF    03.5
0210:  BSF    1F.0
....................    setup_spi(SPI_SS_DISABLED); 
0211:  BCF    14.5
0212:  BCF    20.5
0213:  MOVF   20,W
0214:  BSF    03.5
0215:  MOVWF  07
0216:  BCF    03.5
0217:  BSF    20.4
0218:  MOVF   20,W
0219:  BSF    03.5
021A:  MOVWF  07
021B:  BCF    03.5
021C:  BCF    20.3
021D:  MOVF   20,W
021E:  BSF    03.5
021F:  MOVWF  07
0220:  MOVLW  01
0221:  BCF    03.5
0222:  MOVWF  14
0223:  MOVLW  00
0224:  BSF    03.5
0225:  MOVWF  14
....................    setup_timer_0(RTCC_INTERNAL|RTCC_DIV_1); 
0226:  MOVF   01,W
0227:  ANDLW  C7
0228:  IORLW  08
0229:  MOVWF  01
....................    setup_timer_1(T1_DISABLED); 
022A:  BCF    03.5
022B:  CLRF   10
....................    setup_timer_2(T2_DISABLED,0,1); 
022C:  MOVLW  00
022D:  MOVWF  78
022E:  MOVWF  12
022F:  MOVLW  00
0230:  BSF    03.5
0231:  MOVWF  12
....................    setup_ccp1(CCP_OFF); 
0232:  BCF    03.5
0233:  BSF    20.2
0234:  MOVF   20,W
0235:  BSF    03.5
0236:  MOVWF  07
0237:  BCF    03.5
0238:  CLRF   17
0239:  BSF    03.5
023A:  CLRF   1B
023B:  CLRF   1C
023C:  MOVLW  01
023D:  MOVWF  1D
....................    setup_comparator(NC_NC_NC_NC);// This device COMP currently not supported by the PICWizard 
023E:  BCF    03.5
023F:  BSF    03.6
0240:  CLRF   07
0241:  CLRF   08
0242:  CLRF   09
....................  
.................... printf("Simple Thermomether  \r\n",); 
0243:  MOVLW  04
0244:  MOVWF  0D
0245:  MOVLW  00
0246:  MOVWF  0F
0247:  BCF    03.6
0248:  GOTO   053
....................  
.................... int STAV1; 
.................... unsigned int data1; 
....................  
....................    
....................   while(TRUE) 
....................  {  
....................     
....................  
....................  
.................... //akcelerometr 
....................    int1 ack; 
....................    i2c_start();            // If the write command is acknowledged, 
0249:  BSF    03.5
024A:  BSF    06.0
024B:  NOP
024C:  BSF    06.1
024D:  NOP
024E:  BCF    03.5
024F:  BCF    06.0
0250:  BSF    03.5
0251:  BCF    06.0
0252:  NOP
0253:  BCF    03.5
0254:  BCF    06.1
0255:  BSF    03.5
0256:  BCF    06.1
....................    ack = i2c_write(0xD1);// then the device is ready. 
0257:  MOVLW  D1
0258:  BCF    03.5
0259:  MOVWF  24
025A:  CALL   09B
025B:  MOVF   78,W
025C:  BCF    23.0
025D:  BTFSC  78.0
025E:  BSF    23.0
....................    i2c_stop(); 
025F:  BSF    03.5
0260:  BCF    06.0
0261:  NOP
0262:  BSF    06.1
0263:  BCF    03.5
0264:  BTFSS  06.1
0265:  GOTO   264
0266:  NOP
0267:  GOTO   268
0268:  NOP
0269:  BSF    03.5
026A:  BSF    06.0
026B:  NOP
....................   ack=!ack; 
026C:  MOVLW  01
026D:  BCF    03.5
026E:  XORWF  23,F
....................     
....................     
....................     
....................    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
....................  
....................    i2c_start(); 
027C:  BSF    06.0
027D:  NOP
027E:  BSF    06.1
027F:  NOP
0280:  BCF    03.5
0281:  BCF    06.0
0282:  BSF    03.5
0283:  BCF    06.0
0284:  NOP
0285:  BCF    03.5
0286:  BCF    06.1
0287:  BSF    03.5
0288:  BCF    06.1
....................    I2C_Write(0xD0); 
0289:  MOVLW  D0
028A:  BCF    03.5
028B:  MOVWF  24
028C:  CALL   09B
....................    I2C_write(0x28); 
028D:  MOVLW  28
028E:  MOVWF  24
028F:  CALL   09B
....................    i2c_stop(); 
0290:  BSF    03.5
0291:  BCF    06.0
0292:  NOP
0293:  BSF    06.1
0294:  BCF    03.5
0295:  BTFSS  06.1
0296:  GOTO   295
0297:  NOP
0298:  GOTO   299
0299:  NOP
029A:  BSF    03.5
029B:  BSF    06.0
029C:  NOP
....................    i2c_start(); 
029D:  BSF    06.0
029E:  NOP
029F:  BSF    06.1
02A0:  NOP
02A1:  BCF    03.5
02A2:  BCF    06.0
02A3:  BSF    03.5
02A4:  BCF    06.0
02A5:  NOP
02A6:  BCF    03.5
02A7:  BCF    06.1
02A8:  BSF    03.5
02A9:  BCF    06.1
....................    I2C_Write(0xD1); 
02AA:  MOVLW  D1
02AB:  BCF    03.5
02AC:  MOVWF  24
02AD:  CALL   09B
....................    STAV1=i2c_read(0); 
02AE:  CLRF   77
02AF:  CALL   0CF
02B0:  MOVF   78,W
02B1:  MOVWF  21
....................    i2c_stop();  
02B2:  BSF    03.5
02B3:  BCF    06.0
02B4:  NOP
02B5:  BSF    06.1
02B6:  BCF    03.5
02B7:  BTFSS  06.1
02B8:  GOTO   2B7
02B9:  NOP
02BA:  GOTO   2BB
02BB:  NOP
02BC:  BSF    03.5
02BD:  BSF    06.0
02BE:  NOP
....................  
.................... i2c_start(); 
02BF:  BSF    06.0
02C0:  NOP
02C1:  BSF    06.1
02C2:  NOP
02C3:  BCF    03.5
02C4:  BCF    06.0
02C5:  BSF    03.5
02C6:  BCF    06.0
02C7:  NOP
02C8:  BCF    03.5
02C9:  BCF    06.1
02CA:  BSF    03.5
02CB:  BCF    06.1
....................    I2C_Write(0xD0); 
02CC:  MOVLW  D0
02CD:  BCF    03.5
02CE:  MOVWF  24
02CF:  CALL   09B
....................    I2C_write(0x0F); 
02D0:  MOVLW  0F
02D1:  MOVWF  24
02D2:  CALL   09B
....................    i2c_stop(); 
02D3:  BSF    03.5
02D4:  BCF    06.0
02D5:  NOP
02D6:  BSF    06.1
02D7:  BCF    03.5
02D8:  BTFSS  06.1
02D9:  GOTO   2D8
02DA:  NOP
02DB:  GOTO   2DC
02DC:  NOP
02DD:  BSF    03.5
02DE:  BSF    06.0
02DF:  NOP
....................    i2c_start(); 
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
....................    I2C_Write(0xD1); 
02ED:  MOVLW  D1
02EE:  BCF    03.5
02EF:  MOVWF  24
02F0:  CALL   09B
....................    data1=i2c_read(0); 
02F1:  CLRF   77
02F2:  CALL   0CF
02F3:  MOVF   78,W
02F4:  MOVWF  22
....................    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
....................     
....................     
....................  
....................  
....................  
.................... printf("Stav: %d (procenta)\r\n", ack); 
0302:  MOVLW  00
0303:  BCF    03.5
0304:  BTFSC  23.0
0305:  MOVLW  01
0306:  MOVWF  24
0307:  MOVLW  10
0308:  BSF    03.6
0309:  MOVWF  0D
030A:  MOVLW  00
030B:  MOVWF  0F
030C:  BCF    03.0
030D:  MOVLW  06
030E:  BCF    03.6
030F:  MOVWF  25
0310:  CALL   102
0311:  MOVF   24,W
0312:  MOVWF  25
0313:  MOVLW  1F
0314:  MOVWF  26
0315:  CALL   166
0316:  MOVLW  14
0317:  BSF    03.6
0318:  MOVWF  0D
0319:  MOVLW  00
031A:  MOVWF  0F
031B:  BCF    03.0
031C:  MOVLW  0D
031D:  BCF    03.6
031E:  MOVWF  25
031F:  CALL   102
.................... printf("Stav: %d (procenta)\r\n", STAV1); 
0320:  MOVLW  1B
0321:  BSF    03.6
0322:  MOVWF  0D
0323:  MOVLW  00
0324:  MOVWF  0F
0325:  BCF    03.0
0326:  MOVLW  06
0327:  BCF    03.6
0328:  MOVWF  25
0329:  CALL   102
032A:  MOVF   21,W
032B:  MOVWF  25
032C:  MOVLW  1F
032D:  MOVWF  26
032E:  CALL   166
032F:  MOVLW  1F
0330:  BSF    03.6
0331:  MOVWF  0D
0332:  MOVLW  00
0333:  MOVWF  0F
0334:  BCF    03.0
0335:  MOVLW  0D
0336:  BCF    03.6
0337:  MOVWF  25
0338:  CALL   102
.................... printf("Stav: %du(procenta)\r\n", data1); 
0339:  MOVLW  26
033A:  BSF    03.6
033B:  MOVWF  0D
033C:  MOVLW  00
033D:  MOVWF  0F
033E:  BCF    03.0
033F:  MOVLW  06
0340:  BCF    03.6
0341:  MOVWF  25
0342:  CALL   102
0343:  MOVF   22,W
0344:  MOVWF  25
0345:  MOVLW  1F
0346:  MOVWF  26
0347:  CALL   166
0348:  MOVLW  2A
0349:  BSF    03.6
034A:  MOVWF  0D
034B:  MOVLW  00
034C:  MOVWF  0F
034D:  BCF    03.0
034E:  MOVLW  0D
034F:  BCF    03.6
0350:  MOVWF  25
0351:  CALL   102
.................... delay_ms (2000); 
0352:  MOVLW  08
0353:  MOVWF  24
0354:  MOVLW  FA
0355:  MOVWF  25
0356:  GOTO   1CB
0357:  DECFSZ 24,F
0358:  GOTO   354
....................  
....................  }  
0359:  GOTO   249
.................... } 
035A:  SLEEP

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