I connect PA3 to GND and try measure on my FEZ Portal rev B
var analog = AdcController.FromName(SC20260.Adc.Controller3.Id).OpenChannel(SC20260.Adc.Controller3.PF9);
var m = 3300.0 / Math.Pow(2, analog.Controller.ResolutionInBits); // 3300.0/65536
while (true)
{
var val = analog.ReadValue();
double d = val * m;
Debug.WriteLine("An-> val=" + val.ToString() + " d=" + d.ToString());
Thread.Sleep(300);
}
The ADC’s reference is the same 3.3V used to power the module. Not the best solution when you want a more stable ADC. It was the same on the old G120 and I ended up with a digital filter applied to the sensor reading (thermocouple)
There is a ferrite bead between the ADC REF and 3.3V but that alone is not enough for a stable reference.
The only time this really works is when you use the same ref to power your external sensor and works great with resistance bridges such as mV output pressure transducers.
If you need a more stable reading, your only real option is an external ADC with a stable REF. I think there are some Click options for this. The MCP3428 that I use for 4-20mA sensing duties gives a ver nice stable reading but is only good to 2.048V without external scaling.
You still need a stable REF to get a stable reading and it also depends on the input loading too but connecting unused inputs to the ground via a pulldown is still a good idea.