Author Topic: PIC32MX using full dynamic range of ADC at 1 volt  (Read 1567 times)

0 Members and 1 Guest are viewing this topic.

Offline satyamfifaTopic starter

  • Regular Contributor
  • *
  • Posts: 65
  • Country: nl
PIC32MX using full dynamic range of ADC at 1 volt
« on: May 25, 2019, 09:03:21 pm »
Hello All,

I am trying to sample a signal of range 0 to 1 volt with PIC32MX460F512L ADC and I want to use full 10-bit dynamic range of the ADC, however according to document DS61143H (PIC32MX3XX/4XXData Sheet) parameter AD07 Absolute Reference Voltage VREFH – VREFL can be a minimum of 2 Volts. Therefore I want to know if it is possible to use full dynamic range of the ADC. I don't think there is any more information in the datasheet. I hope someone can clear this out.

Thanks in advance.

Kind Regards,
Sparsh
 

Offline Dabbot

  • Regular Contributor
  • *
  • Posts: 192
  • Country: au
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #1 on: May 25, 2019, 10:57:13 pm »
Use your favorite op-amp to raise the signal to 0-2V, then introduce that into your ADC.
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3147
  • Country: ca
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #2 on: May 25, 2019, 11:20:46 pm »
Most likely there's no need for this. To achieve 0.1% accuracy you need a voltage reference which is at least 0.1% accurate by itself. I guess yours isn't. The signal you route to ADC must have 0.1% precision too, which is very rare. Further, the ADC will have an offset error (which you probably don't calibrate away), perhaps even some non-linearity. Thus, the chance that your system is capable of achieving 0.1% accuracy is slim. Therefore, the extra digit you want to get doesn't have much meaning.
 

Offline Dabbot

  • Regular Contributor
  • *
  • Posts: 192
  • Country: au
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #3 on: May 25, 2019, 11:29:43 pm »
You have a point, but I think he is just wanting to use the maximum resolution.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #4 on: May 25, 2019, 11:56:14 pm »
You want to reduce the Vref to get more resolution.  Datasheet says don't do that, but doesn't tell you why.  If you look at other PICs that use similar 10 bit ADC modules, you'll find that for those that provide a graph of ADC accuracy vs reference voltage, the error rapidly increases for Vref < 2/3 Vdd_Max so the LSBs become garbage faster than you gain resolution.
 
The following users thanked this post: satyamfifa

Offline satyamfifaTopic starter

  • Regular Contributor
  • *
  • Posts: 65
  • Country: nl
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #5 on: May 26, 2019, 12:15:34 am »
Thanks a lot Ian.m that's exactly what I was looking for, and that's exactly what a datasheet should do explain the tradeoffs so an engineer can make the right decision
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #6 on: May 26, 2019, 10:32:36 am »
Most likely there's no need for this. To achieve 0.1% accuracy you need a voltage reference which is at least 0.1% accurate by itself. I guess yours isn't. The signal you route to ADC must have 0.1% precision too, which is very rare. Further, the ADC will have an offset error (which you probably don't calibrate away), perhaps even some non-linearity. Thus, the chance that your system is capable of achieving 0.1% accuracy is slim. Therefore, the extra digit you want to get doesn't have much meaning.

Resolution and accuracy are separate things.  Often a high resolution is required without any great demands of accuracy, or the absolute accuracy of the reference may be irrelevant in a ratiometric measurement (e.g. a potential divider with a thermistor, powered from the reference).
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3147
  • Country: ca
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #7 on: May 26, 2019, 01:58:15 pm »
Resolution and accuracy are separate things.  Often a high resolution is required without any great demands of accuracy, or the absolute accuracy of the reference may be irrelevant in a ratiometric measurement (e.g. a potential divider with a thermistor, powered from the reference).

Resolution is never needed by itself. Excessive resolution is nothing more than random digits. Even if you do ratiometric measurements (or are not interested in accuracy for some other reason), there are various errors you have to deal with. The sensor (or whatever you measure) will have some internal measurement error. Then there will be transmission error, which you need to minimize. For example, in case of resistor divider, to get 0.1% precision, you need 0.05% resistors, you also need to take into account ADC offset and non-linearity. There's also temperature variations, noise, aging etc. etc.

Once you account for all the errors, you can estimate the resolution you need. Cases where you need something better than 10 bits (0.1%) are rare.
 

Offline satyamfifaTopic starter

  • Regular Contributor
  • *
  • Posts: 65
  • Country: nl
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #8 on: May 26, 2019, 02:29:34 pm »
Resolution and accuracy are separate things.  Often a high resolution is required without any great demands of accuracy, or the absolute accuracy of the reference may be irrelevant in a ratiometric measurement (e.g. a potential divider with a thermistor, powered from the reference).

Yes indeed mikerj, resolution and accuracy are two different things, any many times it is desirable to sample a signal with higher resolution than the accuracy of the signal itself
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #9 on: May 26, 2019, 04:09:30 pm »
Resolution and accuracy are separate things.  Often a high resolution is required without any great demands of accuracy, or the absolute accuracy of the reference may be irrelevant in a ratiometric measurement (e.g. a potential divider with a thermistor, powered from the reference).

Resolution is never needed by itself. Excessive resolution is nothing more than random digits. Even if you do ratiometric measurements (or are not interested in accuracy for some other reason), there are various errors you have to deal with. The sensor (or whatever you measure) will have some internal measurement error. Then there will be transmission error, which you need to minimize. For example, in case of resistor divider, to get 0.1% precision, you need 0.05% resistors, you also need to take into account ADC offset and non-linearity. There's also temperature variations, noise, aging etc. etc.

Once you account for all the errors, you can estimate the resolution you need. Cases where you need something better than 10 bits (0.1%) are rare.


Not really true.  Your resolution requirements are determined by the range you need to work over, and the granularity you need to achieve.  This is disconnected from accuracy,

I routinely work with 16 bit converters, and more recently 18 bit, mainly for controlling temperatures in opto-electronic systems.  Absolute accuracy in this case is not particularly important but we need to be able to make tiny changes in temperature (~1mK) over a fairly wide operating temperature range.  The primary requirement here is that DNL <1 LSB for the DACs and no missing codes for ADCs.  Reference accuracy is pretty irrelevant as it's a ratiometric measurement.
« Last Edit: May 26, 2019, 04:11:22 pm by mikerj »
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3147
  • Country: ca
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #10 on: May 26, 2019, 04:30:56 pm »
I routinely work with 16 bit converters, and more recently 18 bit, mainly for controlling temperatures in opto-electronic systems.  Absolute accuracy in this case is not particularly important but we need to be able to make tiny changes in temperature (~1mK) over a fairly wide operating temperature range.  The primary requirement here is that DNL <1 LSB for the DACs and no missing codes for ADCs.  Reference accuracy is pretty irrelevant as it's a ratiometric measurement.

So, you measure the difference between voltages over a time interval. Of course, since you're measuring the difference the absolute value doesn't affect your measurement, but the drift and noise does. If the drift and noise characteristics of your sensor combined with ADC non-linearity and drift produce the differential error of ~1mK, then it is Ok to use 1mK resolution in your measurements, but it doesn't make any sense to use higher resolution (say 1uK).

However is your measurement, the resolution digits beyond the measurement error are redundant and useless.
 

Offline mikerj

  • Super Contributor
  • ***
  • Posts: 3240
  • Country: gb
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #11 on: May 30, 2019, 11:51:54 am »
However is your measurement, the resolution digits beyond the measurement error are redundant and useless.

"measurement error" is the key term here and the reason why I still can not agree with you.  Measurement error is defined as the difference between a measured quantity and its true value. 

In my case I'm not interested in the "true value" of the quantity I am measuring (i.e. temperature), I simply need to be able to detect very small changes of the value.   My measurement error is at least an order of magnitude greater than my measurement resolution, maybe as much as two orders of magnitude.  The drift is also much higher than the measurement resolution, but is irrelevant since this is cancelled out by an outer control loop using different sensors. 



 

Offline Siwastaja

  • Super Contributor
  • ***
  • Posts: 8179
  • Country: fi
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #12 on: May 30, 2019, 01:00:00 pm »
Additionally, even if you were interested in the actual, correct value, it's trivial and very common to apply calibration and compensation steps, digitally. These steps remove systematic gain and offset errors, sometimes non-linearity and temperature-related drift as well, and only some long-term drift elements remain. This can easily reduce the amount of error by an order of magnitude, if not more.

So, when doing a mental comparison between accuracy and resolution, you need to think about calibrated accuracy (if you are going to calibrate, that is). If you know your raw sensing accuracy is, say, 2% and then decide that logically 8 bits is enough, you don't have enough headroom to improve the data by calibration and run-time compensation.

Not all error is noise. It's often correlated to the signal value (or other measurable factors, such as chip temperature), and whenever it's correlated, it can be corrected, but you need the "wrong" digits to be able to do that.
« Last Edit: May 30, 2019, 01:02:58 pm by Siwastaja »
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3147
  • Country: ca
Re: PIC32MX using full dynamic range of ADC at 1 volt
« Reply #13 on: May 30, 2019, 02:03:57 pm »
However is your measurement, the resolution digits beyond the measurement error are redundant and useless.

"measurement error" is the key term here and the reason why I still can not agree with you.  Measurement error is defined as the difference between a measured quantity and its true value. 

In my case I'm not interested in the "true value" of the quantity I am measuring (i.e. temperature), I simply need to be able to detect very small changes of the value.   My measurement error is at least an order of magnitude greater than my measurement resolution, maybe as much as two orders of magnitude.  The drift is also much higher than the measurement resolution, but is irrelevant since this is cancelled out by an outer control loop using different sensors.

You are not measuring the absolute values, you're measuring differences. What matters to you is the error of the difference, not the error of absolute values. Nonetheless, the error you measure does matter to you, and any digits beyond your error are bogus.

The drift certainly matters. Say, you measure ethalon temperature which never changes. You get readings 357,358,357,357 ... , then you come back in an hour and it reads 364,363,363,364 ... . That's a drift. This data suggests that you have noise about 0.5 units and drift about 7 units. Now, when you do your real measurements, you may detect that after 30 minutes your reading has changed by 4 units. This doesn't indicate that your temperature has changed - the change might as well have been caused by the drift - there's no way to tell.

Additionally, even if you were interested in the actual, correct value, it's trivial and very common to apply calibration and compensation steps, digitally. These steps remove systematic gain and offset errors, sometimes non-linearity and temperature-related drift as well, and only some long-term drift elements remain. This can easily reduce the amount of error by an order of magnitude, if not more.

So, when doing a mental comparison between accuracy and resolution, you need to think about calibrated accuracy (if you are going to calibrate, that is). If you know your raw sensing accuracy is, say, 2% and then decide that logically 8 bits is enough, you don't have enough headroom to improve the data by calibration and run-time compensation.

Not all error is noise. It's often correlated to the signal value (or other measurable factors, such as chip temperature), and whenever it's correlated, it can be corrected, but you need the "wrong" digits to be able to do that.

There are different sources of measurement errors. Some you can calibrate away, others you cannot. No matter what you do, there still be some error left. The digits above this error are "good", the digits beyond the error are "wrong".

Calibration decreases the error. Therefore some of the digits migrate from "wrong" to "good". Nonetheless, the error remains, and all the resolution beyond the error is completely useless.

There's one more case where you may need more digits - if you do calculations, you introduce a rounding error. If your rounding error is high compared to other errors, you may need to add digits to decrease it.
 
The following users thanked this post: xani, Siwastaja


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf