PIC32MX using full dynamic range of ADC at 1 volt - Page 1
Forum section: electronics / general

author: satyamfifa
author_rank: Regular Contributor
timestamp: May 25, 2019, 09:03:21 pm
content: 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

author: Dabbot
author_rank: Regular Contributor
timestamp: May 25, 2019, 10:57:13 pm
content: Use your favorite op-amp to raise the signal to 0-2V, then introduce that into your ADC.

author: NorthGuy
author_rank: Super Contributor
timestamp: May 25, 2019, 11:20:46 pm
content: 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.

author: Dabbot
author_rank: Regular Contributor
timestamp: May 25, 2019, 11:29:43 pm
content: You have a point, but I think he is just wanting to use the maximum resolution.

author: Ian.M
author_rank: Super Contributor
timestamp: May 25, 2019, 11:56:14 pm
content: 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.

author: satyamfifa
author_rank: Regular Contributor
timestamp: May 26, 2019, 12:15:34 am
content: 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

author: mikerj
author_rank: Super Contributor
timestamp: May 26, 2019, 10:32:36 am
content: Quote from: NorthGuy on May 25, 2019, 11:20:46 pmResolution 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).

author: NorthGuy
author_rank: Super Contributor
timestamp: May 26, 2019, 01:58:15 pm
content: Quote from: mikerj on May 26, 2019, 10:32:36 amResolution 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.

author: satyamfifa
author_rank: Regular Contributor
timestamp: May 26, 2019, 02:29:34 pm
content: Quote from: mikerj on May 26, 2019, 10:32:36 amYes 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

author: mikerj
author_rank: Super Contributor
timestamp: May 26, 2019, 04:09:30 pm
content: Quote from: NorthGuy on May 26, 2019, 01:58:15 pmNot 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.

author: NorthGuy
author_rank: Super Contributor
timestamp: May 26, 2019, 04:30:56 pm
content: Quote from: mikerj on May 26, 2019, 04:09:30 pmSo, 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.

author: mikerj
author_rank: Super Contributor
timestamp: May 30, 2019, 11:51:54 am
content: Quote from: NorthGuy on May 26, 2019, 04:30:56 pm"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.

author: Siwastaja
author_rank: Super Contributor
timestamp: May 30, 2019, 01:00:00 pm
content: Additionally, even if youwereinterested 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 aboutcalibratedaccuracy (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.

author: NorthGuy
author_rank: Super Contributor
timestamp: May 30, 2019, 02:03:57 pm
content: Quote from: mikerj on May 30, 2019, 11:51:54 amYou 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.Quote from: Siwastaja on May 30, 2019, 01:00:00 pmThere 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.