Some days ago I posted for help with this, but I think it was overlooked in a post with 2 issues to address. Below is my best effort at configuring a 16F88 ADC (AN0) to operate 10bit with an offset +Vref on AN3. Some unexpected results with a standard ADC setup (a 10K pot gives expected results, but the sensor does not) have me wondering if the sensor (LM34CZ) is damaged. My intent is as here: http://www.rentron.com/PicBasic/LM34.htm, but of course the ADC setup is different for the ’88.

Will someone who knows this chip verify/ correct my configuration?

Thank you.




‘----------------------configure P16F88 fuses
#CONFIG
__config _CONFIG1, _INTRC_IO & _WDT_OFF & _PWRTE_OFF & _MCLR_ON & _BODEN_OFF & _LVP_OFF & _CPD_OFF & _WRT_PROTECT_OFF & _DEBUG_OFF
__config _CONFIG2, _FCMEN_OFF & _IESO_OFF
#ENDCONFIG
‘----------------------configure oscillator for 8M internal
DEFINE OSC 8
OSCCON = %01110000

‘----------------------configure ADC for +Vref on AN3, ADC on AN0
ANSEL= %00001001 'ANALOG OFF, EXCEPT +Vref (AN3) AND AN0
TRISA = %00001001 'PORTA TO MATCH ANSEL
TRISB = %00000000 'PORTB DIGITAL
ADCON1.7 = 0 : ADCON1.6 = 0 : ADCON1.5 = 1 : ADCON1.4 = 0 'LEFT JUSTIFIED : ADCS2 DISABLED : VCFG Vref+ AVSS
ADCON0 = %01011001 'Fosc/8 : AN3 ACTIVE : ADC ON