CCS PCM C Compiler, Version 4.106, 47914 25-3-13 12:58Filename: C:\Users\Honza\Documents\pic\serio_tlak\pic\main.lstROM used: 516 words (6%)Largest free fragment is 2048RAM used: 24 (7%) at main() level79 (21%) worst caseStack: 2 locations*0000: MOVLW 010001: MOVWF 0A0002: GOTO 18F0003: NOP.................... #include "C:\Users\Honza\Documents\pic\serio_tlak\pic\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)........................................................................................................................ /**** Automatic weather station 01A ****/.................... #define VERSION "0.1"........................................ #define ID "$Id: main.c 2858 2013-03-22 16:04:13Z kaklik $".................... #include <string.h>.................... ////////////////////////////////////////////////////////////////////////////.................... //// (C) Copyright 1996,2008 Custom Computer Services ////.................... //// This source code may only be used by licensed users of the CCS C ////.................... //// compiler. This source code may only be distributed to other ////.................... //// licensed users of the CCS C compiler. No other use, reproduction ////.................... //// or distribution is permitted without written permission. ////.................... //// Derivative programs created using this software in object code ////.................... //// form are not restricted in any way. ////.................... ////////////////////////////////////////////////////////////////////////////........................................ #ifndef _STRING.................... #define _STRING.................... #include <stddef.h>.................... ///////////////////////////////////////////////////////////////////////////.................... //// (C) Copyright 1996,2003 Custom Computer Services ////.................... //// This source code may only be used by licensed users of the CCS C ////.................... //// compiler. This source code may only be distributed to other ////.................... //// licensed users of the CCS C compiler. No other use, reproduction ////.................... //// or distribution is permitted without written permission. ////.................... //// Derivative programs created using this software in object code ////.................... //// form are not restricted in any way. ////.................... ///////////////////////////////////////////////////////////////////////////........................................ #ifndef _STDDEF........................................ #define _STDDEF........................................ #if sizeof(unsigned int8 *)==1.................... #define ptrdiff_t unsigned int8.................... #else.................... #define ptrdiff_t unsigned int16.................... #endif........................................ #define size_t unsigned int8.................... #define wchar_t char.................... #define NULL 0........................................ #define offsetof(s,f) (offsetofbit(s,f)/8)........................................ #endif........................................ #include <ctype.h>.................... ////////////////////////////////////////////////////////////////////////////.................... //// (C) Copyright 1996,2003 Custom Computer Services ////.................... //// This source code may only be used by licensed users of the CCS C ////.................... //// compiler. This source code may only be distributed to other ////.................... //// licensed users of the CCS C compiler. No other use, reproduction ////.................... //// or distribution is permitted without written permission. ////.................... //// Derivative programs created using this software in object code ////.................... //// form are not restricted in any way. ////.................... ////////////////////////////////////////////////////////////////////////////........................................ #ifndef _CTYPE.................... #define _CTYPE........................................ #define islower(x) isamong(x,"abcdefghijklmnopqrstuvwxyz").................... #define isupper(x) isamong(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZ").................... #define isalnum(x) isamong(x,"0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").................... #define isalpha(x) isamong(x,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz").................... #define isdigit(x) isamong(x,"0123456789").................... #define isspace(x) ((x)==' ').................... #define isxdigit(x) isamong(x,"0123456789ABCDEFabcdef").................... #define iscntrl(x) ((x)<' ').................... #define isprint(x) ((x)>=' ').................... #define isgraph(x) ((x)>' ').................... #define ispunct(x) (((x)>' ')&&!isalnum(x))........................................ #endif........................................................................................................................ //////////////////////////////////////////////.................... //// Uncomment the following define to ////.................... //// allow some functions to use a ////.................... //// quicker algorithm, but use more ROM ////.................... //// ////.................... //// #define FASTER_BUT_MORE_ROM ////.................... //////////////////////////////////////////////................................................................................ /*Copying functions*/.................... /* standard template:.................... void *memmove(void *s1, void *s2, size_t n)..................... Copies max of n characters safely (not following ending '\0').................... from s2 in s1; if s2 has less than n characters, appends 0 */........................................ char *memmove(void *s1,char *s2,size_t n).................... {.................... char *sc1;.................... char *sc2;.................... sc1=s1;.................... sc2=s2;.................... if(sc2<sc1 && sc1 <sc2 +n).................... for(sc1+=n,sc2+=n;0<n;--n).................... *--sc1=*--sc2;.................... else.................... for(;0<n;--n).................... *sc1++=*sc2++;.................... return s1;.................... }........................................ /* Standard template: char *strcpy(char *s1, const char *s2).................... copies the string s2 including the null character to s1..................... This is a compiler built in to handle the different address.................... spaces */........................................ #define strcopy strcpy........................................ /* standard template:.................... char *strncpy(char *s1, const char *s2, size_t n)..................... Copies max of n characters (not following ending '\0').................... from s2 in s1; if s2 has less than n characters, appends 0 */........................................ char *strncpy(char *s1, char *s2, size_t n).................... {.................... char *s;........................................ for (s = s1; n > 0 && *s2 != '\0'; n--).................... *s++ = *s2++;.................... for (; n > 0; n--).................... *s++ = '\0';........................................ return(s1);.................... }.................... /***********************************************************/........................................ /*concatenation functions*/.................... /* standard template: char *strcat(char *s1, const char *s2).................... appends s2 to s1*/........................................ char *strcat(char *s1, char *s2).................... {.................... char *s;........................................ for (s = s1; *s != '\0'; ++s);.................... while(*s2 != '\0').................... {.................... *s = *s2;.................... ++s;.................... ++s2;.................... }........................................ *s = '\0';.................... return(s1);.................... }.................... /* standard template: char *strncat(char *s1, char *s2,size_t n).................... appends not more than n characters from s2 to s1*/........................................ char *strncat(char *s1, char *s2, size_t n).................... {.................... char *s;........................................ for (s = s1; *s != '\0'; ++s);.................... while(*s2 != '\0' && 0<n).................... {.................... *s = *s2;.................... ++s;.................... ++s2;.................... --n;.................... }........................................ *s = '\0';.................... return(s1);.................... }........................................ /***********************************************************/............................................................ /*comparison functions*/.................... /* standard template: signed int memcmp(void *s1, void *s2)..................... Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */........................................ signed int8 memcmp(void * s1,char *s2,size_t n).................... {.................... char *su1, *su2;.................... for(su1=s1, su2=s2; 0<n; ++su1, ++su2, --n).................... {.................... if(*su1!=*su2).................... return ((*su1<*su2)?-1:+1);.................... }.................... return 0;.................... }........................................ /* standard template: int strcmp(const char *s1, const char *s2)..................... Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */........................................ signed int8 strcmp(char *s1, char *s2).................... {.................... for (; *s1 == *s2; s1++, s2++).................... if (*s1 == '\0').................... return(0);.................... return((*s1 < *s2) ? -1: 1);.................... }.................... /* standard template: int strcoll(const char *s1, const char *s2)..................... Compares s1 & s2; returns -1 if s1<s2, 0 if s1=s2, 1 if s1>s2 */........................................ signed int8 strcoll(char *s1, char *s2).................... {.................... for (; *s1 == *s2; s1++, s2++).................... if (*s1 == '\0').................... return(0);.................... return((*s1 < *s2) ? -1: 1);.................... }........................................ /* standard template:.................... int strncmp(const char *s1, const char *s2, size_t n)..................... Compares max of n characters (not following 0) from s1 to s2;.................... returns same as strcmp */........................................ signed int8 strncmp(char *s1, char *s2, size_t n).................... {.................... for (; n > 0; s1++, s2++, n--).................... if (*s1 != *s2).................... return((*s1 <*s2) ? -1: 1);.................... else if (*s1 == '\0').................... return(0);.................... return(0);.................... }.................... /* standard template:.................... int strxfrm(const char *s1, const char *s2, size_t n)..................... transforms maximum of n characters from s2 and places them into s1*/.................... size_t strxfrm(char *s1, char *s2, size_t n).................... {.................... char *s;.................... unsigned int8 n1;.................... n1=n;.................... for (s = s1; n > 0 && *s2 != '\0'; n--).................... *s++ = *s2++;.................... for (; n > 0; n--).................... *s++ = '\0';........................................ return(n1);.................... }........................................................................................................................ /***********************************************************/.................... /*Search functions*/.................... /* standard template: void *memchr(const char *s, int c)..................... Finds first occurrence of c in n characters of s */........................................ char *memchr(void *s,unsigned int8 c,size_t n).................... {.................... char uc;.................... char *su;.................... uc=c;.................... for(su=s;0<n;++su,--n).................... if(*su==uc).................... return su;.................... return NULL;.................... }........................................ /* standard template: char *strchr(const char *s, int c)..................... Finds first occurrence of c in s */........................................ char *strchr(char *s, unsigned int8 c).................... {.................... for (; *s != c; s++).................... if (*s == '\0').................... return(0);.................... return(s);.................... }.................... /* standard template:.................... size_t strcspn(const char *s1, const char *s2)..................... Computes length of max initial segment of s1 that.................... consists entirely of characters NOT from s2*/........................................ unsigned int8 strcspn(char *s1, char *s2).................... {.................... char *sc1, *sc2;........................................ for (sc1 = s1; *sc1 != 0; sc1++).................... for (sc2 = s2; *sc2 != 0; sc2++).................... if (*sc1 == *sc2).................... return(sc1 - s1);.................... return(sc1 - s1);.................... }.................... /* standard template:.................... char *strpbrk(const char *s1, const char *s2)..................... Locates first occurence of any character from s2 in s1;.................... returns s1 if s2 is empty string */........................................ char *strpbrk(char *s1, char *s2).................... {.................... char *sc1, *sc2;........................................ for (sc1 = s1; *sc1 != 0; sc1++).................... for (sc2 = s2; *sc2 != 0; sc2++).................... if (*sc1 == *sc2).................... return(sc1);.................... return(0);.................... }............................................................ /* standard template: char *strrchr(const char *s, int c)..................... Finds last occurrence of c in s */........................................ char *strrchr(char *s, unsigned int8 c).................... {.................... char *p;........................................ for (p = 0; ; s++).................... {.................... if (*s == c).................... p = s;.................... if (*s == '\0').................... return(p);.................... }.................... }.................... /* computes length of max initial segment of s1 consisting.................... entirely of characters from s2 */........................................ unsigned int8 strspn(char *s1, char *s2).................... {.................... char *sc1, *sc2;........................................ for (sc1 = s1; *sc1 != 0; sc1++).................... for (sc2 = s2; ; sc2++).................... if (*sc2 == '\0').................... return(sc1 - s1);.................... else if (*sc1 == *sc2).................... break;.................... return(sc1 - s1);.................... }.................... /* standard template:.................... char *strstr(const char *s1, const char *s2);.................... Locates first occurence of character sequence s2 in s1;.................... returns 0 if s2 is empty string........................................ Uncomment #define FASTER_BUT_MORE_ROM at the top of the.................... file to use the faster algorithm */.................... char *strstr(char *s1, char *s2).................... {.................... char *s, *t;........................................ #ifdef FASTER_BUT_MORE_ROM.................... if (*s2 == '\0').................... return(s1);.................... #endif........................................ while (*s1).................... {.................... for(s = s1, t = s2; *t && (*s == *t); ++s, ++t);........................................ if (*t == '\0').................... return s1;.................... ++s1;.................... #ifdef FASTER_BUT_MORE_ROM.................... while(*s1 != '\0' && *s1 != *s2).................... ++s1;.................... #endif.................... }.................... return 0;.................... }........................................ /* standard template: char *strtok(char *s1, const char *s2)......................................... Finds next token in s1 delimited by a character from separator.................... string s2 (which can be different from call to call). First call.................... starts at beginning of s1 searching for first character NOT.................... contained in s2; returns 0 if none is found..................... If one is found, it is the start of first token (return value)..................... Function then searches from there for a character contained in s2..................... If none is found, current token extends to end of s1, and subsequent.................... searches for a token will return 0. If one is found, it is.................... overwritten by '\0', which terminates current token. Function saves.................... pointer to following character from which next search will start..................... Each subsequent call, with 0 as first argument, starts searching.................... from saved pointer */........................................ char *strtok(char *s1, char *s2).................... {.................... char *beg, *end;.................... static char *save;*01A9: BCF 03.601AA: CLRF 2001AB: CLRF 21........................................ beg = (s1)? s1: save;.................... beg += strspn(beg, s2);.................... if (*beg == '\0').................... {.................... *save = ' ';.................... return(0);.................... }.................... end = strpbrk(beg, s2);.................... if (*end != '\0').................... {.................... *end = '\0';.................... end++;.................... }.................... save = end;.................... return(beg);.................... }........................................ /*****************************************************************/.................... /*Miscellaneous functions*/.................... /* standard template.................... maps error number in errnum to an error message string.................... Returns: Pointer to string.................... */.................... #ifdef _ERRNO.................... char * strerror(unsigned int8 errnum).................... {.................... char s[15];.................... switch( errnum).................... {.................... case 0:.................... strcpy(s,"no errors");.................... return s;.................... case EDOM :.................... strcpy(s,"domain error");.................... return s;.................... case ERANGE:.................... strcpy(s,"range error");.................... return s;.................... }.................... }.................... #ENDIF.................... /* standard template: size_t strlen(const char *s)..................... Computes length of s1 (preceding terminating 0) */........................................ unsigned int8 strlen(char *s).................... {.................... char *sc;........................................ for (sc = s; *sc != 0; sc++);*0032: MOVF 66,W0033: MOVWF 680034: MOVF 65,W0035: MOVWF 670036: MOVF 68,W0037: MOVWF 7A0038: MOVF 67,W0039: MOVWF 04003A: BCF 03.7003B: BTFSC 7A.0003C: BSF 03.7003D: MOVF 00,F003E: BTFSC 03.2003F: GOTO 0440040: INCF 67,F0041: BTFSC 03.20042: INCF 68,F0043: GOTO 036.................... return(sc - s);0044: MOVF 65,W0045: SUBWF 67,W0046: MOVWF 770047: MOVF 68,W0048: MOVWF 7A0049: MOVF 66,W004A: BTFSS 03.0004B: INCFSZ 66,W004C: SUBWF 7A,F004D: MOVF 77,W004E: MOVWF 78.................... }004F: RETURN........................................ /* standard template: size_t stricmp(const char *s1, const char *s2)..................... Compares s1 to s2 ignoring case (upper vs. lower) */........................................ signed int8 stricmp(char *s1, char *s2).................... {.................... for(; *s1==*s2||(isalpha(*s1)&&isalpha(*s2)&&(*s1==*s2+32||*s2==*s1+32));.................... s1++, s2++).................... if (*s1 == '\0').................... return(0);.................... return((*s1 < *s2) ? -1: 1);.................... }............................................................ /* standard template: char *strlwr(char *s)..................... Replaces uppercase letters by lowercase;.................... returns pointer to new string s */........................................ char *strlwr(char *s).................... {.................... char *p;........................................ for (p = s; *p != '\0'; p++).................... if (*p >= 'A' && *p <='Z').................... *p += 'a' - 'A';.................... return(s);.................... }............................................................ /************************************************************/............................................................ #endif........................................ #use rs232(baud=9600,parity=N,xmit=PIN_B7,rcv=PIN_B6,bits=8) //rcv TXD xmit RXD0050: BSF 03.50051: BCF 06.70052: BCF 03.50053: BCF 06.70054: MOVLW 080055: MOVWF 780056: GOTO 0570057: NOP0058: BSF 78.70059: GOTO 068005A: BCF 78.7005B: RRF 69,F005C: BTFSC 03.0005D: BSF 06.7005E: BTFSS 03.0005F: BCF 06.70060: BSF 78.60061: GOTO 0680062: BCF 78.60063: DECFSZ 78,F0064: GOTO 05B0065: GOTO 0660066: NOP0067: BSF 06.70068: MOVLW 3F0069: MOVWF 04006A: DECFSZ 04,F006B: GOTO 06A006C: NOP006D: BTFSC 78.7006E: GOTO 05A006F: BTFSC 78.60070: GOTO 0620071: RETURN........................................ #CASE // Case sensitive compiler........................................ #define SEND_DELAY 50 // Time between two characters on RS232........................................ #define CSN_SPI PIN_C2 // preassure sensor connection.................... #include "..\MPL115A1.c".................... /*.................... MPL115A1 SDN - +3.3V (always power on).................... MPL115A1 #CS - PIN_C2.................... MPL115A1 DOUT - PIN_C4.................... MPL115A1 DIN - PIN_C5.................... MPL115A1 SCLK - PIN_C3.................... MPL115A1 GND - GND.................... MPL115A1 VDD - +3.3V.................... */............................................................ // SPI mode definitions..................... #define SPI_MODE_0 (SPI_L_TO_H | SPI_XMIT_L_TO_H).................... #define SPI_MODE_1 (SPI_L_TO_H).................... #define SPI_MODE_2 (SPI_H_TO_L).................... #define SPI_MODE_3 (SPI_H_TO_L | SPI_XMIT_L_TO_H)........................................ float a0; // correctiaon coefficients.................... float b1;.................... float b2;.................... float c12;............................................................ void MPL_init().................... {.................... unsigned int8 a0_MSB, a0_LSB;.................... unsigned int8 b1_MSB, b1_LSB;.................... unsigned int8 b2_MSB, b2_LSB;.................... unsigned int8 c12_MSB, c12_LSB;........................................ output_low(CSN_SPI);........................................ spi_write(0x88); // get MSB for a0.................... a0_MSB = spi_read(0x00);.................... spi_write(0x8A); // get LSB for a0.................... a0_LSB = spi_read(0x00);........................................ spi_write(0x8C); // get MSB for b1.................... b1_MSB = spi_read(0x00);.................... spi_write(0x8E); // get LSB for b1.................... b1_LSB = spi_read(0x00);........................................ spi_write(0x90); // get MSB for b2.................... b2_MSB = spi_read(0x00);.................... spi_write(0x92); // get LSB for b2.................... b2_LSB = spi_read(0x00);........................................ spi_write(0x94); // get MSB for c12.................... c12_MSB = spi_read(0x00);.................... spi_write(0x96); // get LSB for c12.................... c12_LSB = spi_read(0x00);........................................ spi_read(0x00);.................... output_high(CSN_SPI);........................................ // translate to floating point number........................................ a0 = ((unsigned int16) a0_MSB << 5) + (a0_LSB >> 3) + (a0_LSB & 0x07)/8.0;.................... b1 = ((((b1_MSB & 0x1F) * 0x100) + b1_LSB) / 8192.0) - 3;.................... b2 = ((((unsigned int16) (b2_MSB - 0x80) << 8) + b2_LSB)/ 16384.0) - 2;.................... c12 =(((c12_MSB * 0x100) + c12_LSB)/16777216.0);.................... }........................................ float MPL_get_pressure().................... {.................... unsigned int8 LSB_data, MSB_data;.................... unsigned int16 ADC_pressure, ADC_temperature;.................... float Pcomp;........................................ output_low(CSN_SPI); //Start temperature and pressure conversion.................... spi_write(0x24);.................... spi_write(0x00);.................... output_high(CSN_SPI);........................................ delay_ms(10);........................................ output_low(CSN_SPI); // get MSB for Pressure.................... spi_write(0x80);.................... MSB_data = spi_read(0x00);.................... spi_write(0x82); // get LSB for Pressure.................... LSB_data = spi_read(0x00);.................... output_high(CSN_SPI);........................................ ADC_pressure = (((unsigned int16) MSB_data << 8) + LSB_data ) >> 6; // conversion of 8bit registers to 16bit variable........................................ output_low(CSN_SPI);.................... spi_write(0x84);.................... MSB_data = spi_read(0x00);.................... spi_write(0x86); // get LSB for Temperature.................... LSB_data = spi_read(0x00);.................... spi_read(0x00);.................... output_high(CSN_SPI);........................................ ADC_temperature = (((unsigned int16) MSB_data << 8) + LSB_data ) >> 6; // conversion of 8bit registers to 16bit variable........................................ Pcomp = (a0 + (b1 + c12 * ADC_temperature) * ADC_pressure + b2 * ADC_temperature ); // compute relative compensated pressure........................................ return (Pcomp * ((115.0 - 50.0)/1023.0) + 50.0); // return absolute pressure.................... }........................................ float MPL_get_temperature().................... {.................... unsigned int8 LSB_data, MSB_data;.................... unsigned int16 ADC_temperature;........................................ output_low(CSN_SPI); //Start temperature and pressure conversion.................... spi_write(0x22);.................... spi_write(0x00);.................... output_high(CSN_SPI);........................................ delay_ms(10);........................................ output_low(CSN_SPI);.................... spi_write(0x84);.................... MSB_data = spi_read(0x00);.................... spi_write(0x86); // get LSB for Temperature.................... LSB_data = spi_read(0x00);.................... spi_read(0x00);.................... output_high(CSN_SPI);........................................ ADC_temperature = (((unsigned int16) MSB_data << 8) + LSB_data ) >> 6; // conversion of 8bit registers to 16bit variable........................................ return ( ((float) ADC_temperature - 498.0)/-5.35) + 27.0; // return temperature in deg C.................... }................................................................................ void welcome(void) // Welcome message.................... {.................... char REV[50]=ID; // Buffer for concatenate of a version string0072: MOVLW 240073: MOVWF 330074: MOVLW 490075: MOVWF 340076: MOVLW 640077: MOVWF 350078: MOVLW 3A0079: MOVWF 36007A: MOVLW 20007B: MOVWF 37007C: MOVLW 6D007D: MOVWF 38007E: MOVLW 61007F: MOVWF 390080: MOVLW 690081: MOVWF 3A0082: MOVLW 6E0083: MOVWF 3B0084: MOVLW 2E0085: MOVWF 3C0086: MOVLW 630087: MOVWF 3D0088: MOVLW 200089: MOVWF 3E008A: MOVLW 32008B: MOVWF 3F008C: MOVLW 38008D: MOVWF 40008E: MOVLW 35008F: MOVWF 410090: MOVLW 380091: MOVWF 420092: MOVLW 200093: MOVWF 430094: MOVLW 320095: MOVWF 440096: MOVLW 300097: MOVWF 450098: MOVLW 310099: MOVWF 46009A: MOVLW 33009B: MOVWF 47009C: MOVLW 2D009D: MOVWF 48009E: MOVLW 30009F: MOVWF 4900A0: MOVLW 3300A1: MOVWF 4A00A2: MOVLW 2D00A3: MOVWF 4B00A4: MOVLW 3200A5: MOVWF 4C00A6: MOVWF 4D00A7: MOVLW 2000A8: MOVWF 4E00A9: MOVLW 3100AA: MOVWF 4F00AB: MOVLW 3600AC: MOVWF 5000AD: MOVLW 3A00AE: MOVWF 5100AF: MOVLW 3000B0: MOVWF 5200B1: MOVLW 3400B2: MOVWF 5300B3: MOVLW 3A00B4: MOVWF 5400B5: MOVLW 3100B6: MOVWF 5500B7: MOVLW 3300B8: MOVWF 5600B9: MOVLW 5A00BA: MOVWF 5700BB: MOVLW 2000BC: MOVWF 5800BD: MOVLW 6B00BE: MOVWF 5900BF: MOVLW 6100C0: MOVWF 5A00C1: MOVLW 6B00C2: MOVWF 5B00C3: MOVLW 6C00C4: MOVWF 5C00C5: MOVLW 6900C6: MOVWF 5D00C7: MOVLW 6B00C8: MOVWF 5E00C9: MOVLW 2000CA: MOVWF 5F00CB: MOVLW 2400CC: MOVWF 6000CD: CLRF 61........................................ if (REV[strlen(REV)-1]=='$') REV[strlen(REV)-1]=0;00CE: CLRF 6600CF: MOVLW 3300D0: MOVWF 6500D1: CALL 03200D2: MOVLW 0100D3: SUBWF 78,W00D4: ADDLW 3300D5: MOVWF 0400D6: BCF 03.700D7: MOVF 00,W00D8: SUBLW 2400D9: BTFSS 03.200DA: GOTO 0E500DB: CLRF 6600DC: MOVLW 3300DD: MOVWF 6500DE: CALL 03200DF: MOVLW 0100E0: SUBWF 78,W00E1: ADDLW 3300E2: MOVWF 0400E3: BCF 03.700E4: CLRF 00........................................ printf("# ver seq temp[mK] hum_temp[mK] hum[%%] ");00E5: MOVLW 0400E6: BSF 03.600E7: MOVWF 0D00E8: MOVLW 0000E9: MOVWF 0F00EA: BCF 03.000EB: MOVLW 2500EC: BCF 03.600ED: MOVWF 65*013C: MOVLW 25013D: MOVWF 69013E: CALL 050013F: MOVLW 5D0140: MOVWF 690141: CALL 0500142: MOVLW 200143: MOVWF 690144: CALL 050.................... printf("bar_temp[mK] pressure[hPa] Anemo[pls/s]check\r\n\r\n");0145: MOVLW 190146: BSF 03.60147: MOVWF 0D0148: MOVLW 000149: MOVWF 0F.................... }*018B: BCF 03.6018C: BCF 0A.3018D: BCF 0A.4018E: GOTO 203 (RETURN)........................................ void main().................... {018F: CLRF 040190: BCF 03.70191: MOVLW 1F0192: ANDWF 03,F0193: MOVLW 710194: BSF 03.50195: MOVWF 0F0196: MOVF 0F,W0197: BCF 06.70198: BCF 03.50199: BSF 06.7019A: BSF 03.5019B: BSF 03.6019C: MOVF 09,W019D: ANDLW C0019E: MOVWF 09019F: BCF 03.601A0: BCF 1F.401A1: BCF 1F.501A2: MOVLW 0001A3: BSF 03.601A4: MOVWF 0801A5: BCF 03.501A6: CLRF 0701A7: CLRF 0801A8: CLRF 09............................................................ setup_oscillator(OSC_8MHZ); // pri prouziti bootloaderu neni treba nastavovat*01AE: MOVLW 7101AF: BSF 03.501B0: MOVWF 0F01B1: MOVF 0F,W.................... setup_wdt(WDT_2304MS);01B2: MOVLW 0901B3: BCF 03.501B4: BSF 03.601B5: MOVWF 0501B6: MOVLW 0F01B7: MOVWF 7701B8: BCF 03.601B9: CLRF 0101BA: MOVLW 8101BB: MOVWF 0401BC: BCF 03.701BD: MOVF 00,W01BE: ANDLW F001BF: IORLW 0701C0: MOVWF 0001C1: CLRWDT01C2: MOVF 00,W01C3: ANDLW F701C4: BTFSC 77.301C5: ANDLW F001C6: IORWF 77,W01C7: MOVWF 00.................... restart_wdt(); //---WDT01C8: CLRWDT.................... setup_adc_ports(NO_ANALOGS|VSS_VDD);01C9: BSF 03.501CA: BSF 03.601CB: MOVF 09,W01CC: ANDLW C001CD: MOVWF 0901CE: BCF 03.601CF: BCF 1F.401D0: BCF 1F.501D1: MOVLW 0001D2: BSF 03.601D3: MOVWF 08.................... setup_adc(ADC_CLOCK_DIV_2);01D4: BCF 03.501D5: BCF 03.601D6: BCF 1F.601D7: BCF 1F.701D8: BSF 03.501D9: BCF 1F.701DA: BCF 03.501DB: BSF 1F.0.................... setup_timer_0(RTCC_EXT_L_TO_H|RTCC_DIV_1);01DC: BSF 03.501DD: MOVF 01,W01DE: ANDLW C701DF: IORLW 2801E0: MOVWF 01.................... // setup_timer_1(T1_EXTERNAL|T1_DIV_BY_1);//|T1_CLK_OUT);.................... setup_timer_1(T1_INTERNAL|T1_DIV_BY_8);01E1: MOVLW 3501E2: BCF 03.501E3: MOVWF 10.................... setup_timer_2(T2_DISABLED,0,1);01E4: MOVLW 0001E5: MOVWF 7801E6: MOVWF 1201E7: MOVLW 0001E8: BSF 03.501E9: MOVWF 12.................... setup_ccp1(CCP_OFF);01EA: BCF 03.501EB: BSF 32.201EC: MOVF 32,W01ED: BSF 03.501EE: MOVWF 0701EF: BCF 03.501F0: CLRF 1701F1: BSF 03.501F2: CLRF 1B01F3: CLRF 1C01F4: MOVLW 0101F5: MOVWF 1D.................... setup_comparator(NC_NC_NC_NC); // This device COMP currently not supported by the PICWizard01F6: BCF 03.501F7: BSF 03.601F8: CLRF 0701F9: CLRF 0801FA: CLRF 09.................... //setup_spi(SPI_MASTER | SPI_MODE_0 | SPI_CLK_DIV_64);.................... output_high(CSN_SPI);01FB: BCF 03.601FC: BCF 32.201FD: MOVF 32,W01FE: BSF 03.501FF: MOVWF 070200: BCF 03.50201: BSF 07.2........................................ welcome(); // welcome print and device indentification0202: GOTO 072............................................................ }....................0203: SLEEPConfiguration Fuses:Word 1: 2CF5 INTRC NOWDT NOPUT MCLR NOPROTECT NOCPD NOBROWNOUT IESO FCMEN NOLVP NODEBUGWord 2: 3FFF NOWRT BORV40