Hi,
Very good point Poul-Henning, very good point.
The mux is there, we don't need the resolution far out, and with only a
little though code-wise and hardware wise we get the best of resolution
and range where we need it.
Cheers,
Magnus
On 06/10/2017 09:06 PM, Poul-Henning Kamp wrote:
--------
In message <[email protected]>, Bob kb8tq writes:
The “limited range” part of it is why the op-amp makes so much
sense. If the ADC can “see” +/-10C that’s way more than will ever be useful.
Most uC's have a pile of mux'ed ADC inputs, so do all of the above:
AI0 = Full range
AI1 = +/- 10C
AI2 = +/- 2C
A big upside to this is that you will not need to invent heuristics
for clamped inputs in your PI(D) controller, something which is a bit
harder than most people realize.
Assuming a 10-bit ADC, the code will look something like this:
double
get_temp(void)
{
T = read_AI2();
if (T > 50 && T < 975) {
T += T2_offset;
T *= T2_scale;
return (T);
}
T = read_AI1();
if (T > 50 && T < 975) {
T += T1_offset;
T *= T1_scale;
return (T);
}
T = read_AI0();
if (T > 50 && T < 975) {
T += T0_offset;
T *= T0_scale;
return (T);
}
abort("You have problems...");
}
_______________________________________________
time-nuts mailing list -- [email protected]
To unsubscribe, go to https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts
and follow the instructions there.