Quote Originally Posted by mackrackit View Post
Never trust a sim.
Try it in real life and come back.
In real life with the same code:


Quote Originally Posted by Acetronics View Post
see any difference between Tb0 value @ line 1 and Tb0 Value @ line 5 ???

really no ?

Alain
My updated code :

Code:
define OSC 20
DEFINE ADC_BITS 10
DEFINE ADC_SAMPLEUS 10
DEFINE LCD_DREG PORTC
DEFINE LCD_RSREG PORTC
DEFINE LCD_EREG PORTC
DEFINE LCD_EBIT 5 

ntc VAR WORD
tb0 VAR WORD
tb1 VAR WORD
tb2 VAR WORD

TRISA=%11111111     
ADCON1=%10000010   

PAUSE 4000

lp:

ADCIN 1,ntc
tb0=ntc
if tb0>=16170 then
tb1=tb0-16170 
ELSE 
tb0=0
ENDIF
tb1=tb1*100                                      
tb2=Div32 634
tb0=tb2/100   
tb1=tb2//100    
           
PAUSE 100

Lcdout $fe,$c0,"ITS: ",DEC (tb0 DIG 1),DEC (tb0 DIG 0),".",DEC (tb1 DIG 1),"°C"

goto lp
I was surprised because the previous code worked good.