Okay, I've rectified the code for use the 10-bit ADC. Now I get more accurate temperature measurement.
I've also modified the temperature formula (the bin->voltage conversion is now "integrated" within), so I don't need anymore the bin->voltage calculation effetued by the PIC.
Code:
define OSC 20
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 10
DEFINE LCD_DREG PORTC
DEFINE LCD_RSREG PORTC
DEFINE LCD_EREG PORTC
DEFINE LCD_EBIT 5
tb0 VAR WORD
tb1 VAR WORD
tb2 VAR WORD
tb3 VAR WORD
tb3=100
TRISA=%11111111
ADCON1=%10000010
PAUSE 4000
lp:
ADCIN 1,tb0
tb1=tb0-16170
tb1=tb1*tb3
tb2=Div32 634
tb0=tb2/100
tb1=tb2//100
PAUSE 100
Lcdout $fe,$c0,"IGBT t.: ",DEC (tb0 DIG 1),DEC (tb0 DIG 0),".",DEC (tb1 DIG 1),"°C"
goto lp
Bookmarks