View previous topic :: View next topic |
Author |
Message |
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19503
|
|
Posted: Sun May 01, 2022 2:39 am |
|
|
It depends on what voltage you have the FVR set to, and how accurate
you want the reading to be?.
The ADC on this chip is unusual in only requiring 1.8v as the minimum
reference. Most PIC's require something closer to 2.5v. Now I'd expect
it to be fine if you were running with 4.096 from the FVR. However
at 2.048v, you are relatively close to the minimum voltage allowed, and
typically the FVR will fluctuate as the load changes. Now the ADC does
draw varying current on the reference through the reading, so the DNL
of the ADC is rising. Hence they cannot guarantee that all codes will be
reported. Now, the FVR is only warranted as +/-4% accurate. So you can
only really rely on about 5bit accuracy using this. If you are trying to get
a 10bit result, you need to be using a better reference than this.
If you limit the ADC to 8bit I'd not expect the results to be too bad. Beyond
this you are asking more than the hardware can deliver. |
|
|
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
|
Posted: Sun May 01, 2022 6:59 am |
|
|
Sorry to ask, but what does it mean:
From the Errata:
Code: | "Using the FVR as the positive voltage reference for the ADC can cause an increase in missing codes" |
|
|
|
temtronic
Joined: 01 Jul 2010 Posts: 9222 Location: Greensville,Ontario
|
|
Posted: Sun May 01, 2022 7:07 am |
|
|
'missing codes' probably means missing ADC bits, so bad ADC readings.
Say the ADC is set for 10 bit mode....the PIC may not control/read the ADC and you might get say 5 or 6 valid bits,rest are garbage.
Others will know for sure, but that's my thinking... |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19503
|
|
Posted: Sun May 01, 2022 9:41 am |
|
|
Not quite.
Basically the 'idea' is that if an ADC is running correctly, it should always
step sequentially 'up' as the voltage increases. This is automatically the
case if the DNL error <1 LSB. If there are missing codes, what happens
is that as the voltage increases, you can get sequences like:
0000000000
0000000010
0000000011
0000000101
With the ADC stepping up more than one count as the voltage increases.
Now the PIC ADC's are normally warranted to have no missing codes.
What is happening here is when this Vref is used, missing codes can
appear.
This has happened in the past on some other PIC ADC's in this
circumstance.
It occurs because the load drawn on the Vref does step fractionally as
the successive approximations are done, and if the Vref is not well
stabilised you can then get slight steps as the bits are generated.
Now as I said the point it that given the low accuracy of this Vref (it
is less good than many supply chips manage), you really should not
be looking to get more than about 5 bits of accuracy from the ADC.
Use only this, and there will be no missing codes. In fact (based on the
earlier chips that had the same problem), I'd expect the problem
not to appear if you stick to 8bit operation. It tends to be a single
count 'missed' as you move forwards one count, with a higher bit
changing.
Also be aware that simple averaging _will_ 'hide' missing codes. |
|
|
hmmpic
Joined: 09 Mar 2010 Posts: 314 Location: Denmark
|
|
Posted: Sun May 01, 2022 1:02 pm |
|
|
Have been thinking so much on that Errata, but don't understand what Microchip was trying to tell.
Thanks for the nice explanation! i understand it now:) |
|
|
|