32MZ EF ADC measurement Issue
Uuugh! This ADC is ugly.
So, I have two voltages going to two different pins. One is set to ADC1, one is set to ADC7.
I am using scanning.
I am getting quite different voltages via the ADC results, even though I have measured the voltages on the pins with a 5 digit voltmeter and they are near as identical. For example, 2.4999 and 2.4998 yet the ADC shows 2.501 (okay!) and 2.599 - that is almost a 100mv different!
What have I tried? every which way the ADC can be configured in 12bit mode, slowing down TAD/SAMC to slowest possible etc etc, all with identical results. I have even changed the chip.
All voltages are driven directly from an opamp elsewhere on the board. SO why are these reading so different?
Actually I am using 8 analog inputs and these differences are everywhere.
Now I truly hope I have done something wrong, or missed something - but I have this horrible (yet regular) feeling that my microchip is not quite as it should be.
While I am on the subject - where is the documentation on the calibration registers? there is nothing in the datasheet other than a small note at the end of the list of registers:
" 3 Before enabling the ADC, the user application must initialize the ADC calibration values by copying them from the factory-programmed DEVADCx Flash registers into the corresponding ADCxCFG registers"
Perhaps this is the problem? The calibration configuration is wrong. I have tried with and without this and get wildly different results, alas they are all very wrong (and still offset).
The examples etc do not even mention these registers.
Thoughts? Somebody please tell me I am an idiot! (roll on the replies with 'idiot' in them...)