I am currently reading an AD595 thermocouple amplifier with a PC12F675 and everything works great! I now want to read below 32F or 0C. I have added a negative power supply to allow the negative readings from the AD595. I have also added a voltage divider to the ground reference to scale all readings by say 55mv +/-. I am using GPIO.0 and GPIO.1 to monitor both then in my code I subtract the virtual ground from the AD595 reading.
How do I handle the following in PBP for when I go below 0?
loop:
for sample = 1 to 20 ' 20 Samples then produce results
ADCON0.1 = 1
notdone:
IF ADCON0.1 = 1 Then notdone
adval.highbyte = ADRESH
adval.lowbyte = ADRESL
samples = samples + adval
next sample
adval = samples / 20
ADCIN 1, virtual_ground
if ((adval - virtual_ground) < 0) then
' Not Sure how to handle this
else
' Not Sure how to handle this
endif
Thanks for any help!
Scott
Bookmarks