In theory the comparator should already be off at POR, but for safety sake, add this line at the top of your code
CMCON=7
This kind of weirdness is usually caused by a too high external analog impedance, AND/OR a too short sampling time, or combination of. Make sure your external source is bellow the maximum recommended (<10K if my memory serves me well for this device).
You could still add some PAUSE/PAUSEUS between each ADCIN to see if it's better or worst.
I'll suggest to properly set the ANSEL register and set to digital all unused i/o as well.
BUT the main problem is in red
Code:
lcdout $fe,2,"VOLTAGE..",dec (volt/100),",",dec2 volt,"V"
lcdout $fe,$c0,"TEMP.....",dec (temp/100),",",dec2 volt,"V"
have a look at DIG modifier as well.
Bookmarks