Ok this whole MAX_ADC thig has been bugging me for a long time, and I think I have figured out why the values were causing all the probes to show temperatures when it was set to 2^n-1.
At 10bits the resolution per bit is 5mV. This means that the power supply could droop up to 5mV without being detected and worked properly.
However as we add more accuracy and the voltage resolution goes to 610uV (for 13bits), it will detect this droop and report it as a very low temperature. My 5V rail is closer to 4.96V not 5.0V. So by changing MAX_ADC to 2^n - 2^(n-10) this gives us back the 5mV or tolerance.
To check this assumption I looked at the NADC table and do see that the temperature I was seeing on the disconnected probes was in the 2-3mV range. Right around what I'm seeing with my DVM report for Vdd.
If we changed the probe circuit to have the 10k resistor connected to ground, and the probe connect from 5V to the 10k resistor, and changed the R calculation to match it would fix the issue because ground doesn't bounce around that much. I don't think it will give us any more accuracy, because the power supply droop is still there, but at least I understand now what was happening.
At least that is my thinking as of this AM
dave
At 10bits the resolution per bit is 5mV. This means that the power supply could droop up to 5mV without being detected and worked properly.
However as we add more accuracy and the voltage resolution goes to 610uV (for 13bits), it will detect this droop and report it as a very low temperature. My 5V rail is closer to 4.96V not 5.0V. So by changing MAX_ADC to 2^n - 2^(n-10) this gives us back the 5mV or tolerance.
To check this assumption I looked at the NADC table and do see that the temperature I was seeing on the disconnected probes was in the 2-3mV range. Right around what I'm seeing with my DVM report for Vdd.
If we changed the probe circuit to have the 10k resistor connected to ground, and the probe connect from 5V to the 10k resistor, and changed the R calculation to match it would fix the issue because ground doesn't bounce around that much. I don't think it will give us any more accuracy, because the power supply droop is still there, but at least I understand now what was happening.
At least that is my thinking as of this AM
dave