Quote Originally Posted by asifiqbal View Post
thermitor value is 10k, and i am loading datasheet also,the problem is that value of thermistor does not change with same proportion with every c degree
You are, precisely, correct; however, the curve of resistance values is very close to a logarithmic curve and this may be precise enough - provided you can easily implement a log function. I do not know of a method to do this, so it may be that one of the other two methods, or Alain's suggestion of using LOOKDOWN2, may be better for your purpose - or perhaps you someone in the forum will know of a way. Or, it may be that this method is not accurate enough for your purpose.

The point is that always there are these types of issues to solve and these choices to make. If you are trying to minimize resources used, then one answer may be better, if you are optimizing for accuracy another approach may meet your need... there is no "best" way and no "perfect" answer. Look at the three general methods I have suggested, weight their relative merit in your application - does the PIC you're using have EEPROM? How much? Are you using it for something else or is it available for this task? It is clear from your OP that you have put a great deal of work into making this work - it is with the greatest of respect for this effort that I offer you these choices rather than dictate how I would complete MY project.

All that said...

If I was to do this and I had determined that my EEPROM was available, and I needed the accuracy of precise, stored values, then I would write the corresponding TEMPERATURE value to the EEPROM location of each ADC reading. If the ADC reading for -20 Celsius is 26 and the reading for -19 is 27... DATA @ 26, -20, -19; I would continue in this manner (duplicating temperature readings where necessary to maintain the pattern). Then, I would read the DATA location of the ADC value, like so:

ADCIN 1, ADC
READ ADC, TEMP

I would then write a subroutine to display the information:

Gosub DISPLAY_LCD

and wrap the subroutine in a label and return:

DISPLAY_LCD:
lcdout $fe,$80, "SENSOR ",dec3 t
lcdout $FE,$C0, "TEMPRATURE: ", DEC TEMP, 223, " C" 'ASCII 223 is DEGREE SYMBOL
RETURN

and then put all this in a loop, so that it displayed continuously every second:

MAIN:
ADCIN 1, ADC
READ ADC, TEMP
Gosub DISPLAY_LCD
PAUSE 1000
GOTO MAIN

DISPLAY_LCD:
lcdout $fe,$80, "SENSOR ",dec3 t
lcdout $FE,$C0, "TEMPRATURE: ", DEC TEMP, 223, " C" 'ASCII 223 is DEGREE SYMBOL
RETURN

DATA @ 26, -20, -19...

END

I'd then go back and add some more code to handle out of range values...

MAIN:
ADCIN 1, ADC
READ ADC, TEMP
IF ADC < 26 then GOTO MAIN 'LEAVE DISPLAY ALONE IF ITS TOO COLD - JUST KEEP READING
IF ADC > 25 and ADC < 196 THEN Gosub DISPLAY_LCD 'FOR NORMAL VALUES
IF ADC > 195 GOSUB DISPLAY_HOT 'FOR OVER RANGE
PAUSE 1000
GOTO MAIN

DISPLAY_LCD:
lcdout $fe,$80, "SENSOR ",dec3 t
lcdout $FE,$C0, "TEMPRATURE: ", DEC TEMP, 223, " C" 'ASCII 223 is DEGREE SYMBOL
RETURN

DISPLAY_HOT:
lcdout $fe,$80, "SENSOR ",dec3 t
lcdout $FE,$C0, "HOLY COW IS IT HOT IN HERE OR WHAT?"
RETURN

DATA @ 26, -20, -19...

END

Last, I think I'd double check my negative values to make sure they display correctly, then determine how to fix them.