Using DACs - MCP4725 - Feedback required on my calculations please. - Page 1
Forum section: electronics / projects

author: Varys
author_rank: Newbie
timestamp: August 21, 2014, 10:24:04 am
content: I`m mostly writing this topic to alert other designers about this.I was using the MCP4725, thinking that a 12bit DAC would be good enough accuracy and resolution for my project. I wasn't aware however that these DAC's can easily have more than 5% output variances between each IC.So if you hook up a 3volts or 3000mV reference voltage to this DAC you would theoretically expect that writing an decimal value of 4000 would give you the analog value output of 2930,4mV1.However in practice I measured values between 2880mV and 2975mV == +- 2%. (Measurements taken over 75 devices that I assembled.). Please note the +- sign, it does NOT mean approximately, but it means, for e.g. +-2%, it can go down by 2% and go up by 2% better said, it has an absolute error of 4%.Which was to much variance to be acceptable for my project. Since I had no way to do a redesign, I had to do a device specific calibration using a DVM and store the calibration into the uP Flash memory. A 2 point calibration @100decimals and @4000 decimals did take away a lot of the error, but it was not enough for our project. I ended up doing a tree point calibration; @100,@2000 and @4000 decimals and extrapolate from there the correct output.Because of this, I researched what specification I should look for, to minimize these output variances. These are the most important parts to watch for if you needaccuracy:Gain error, Offset error, Integral nonlinearity error (acronym INL) and Differential nonlinearity error(acronym DNL). I found this paper from TI (Texas Instruments) very helpful for my understanding:http://www.ti.com/lit/an/slaa013/slaa013.pdfNow I will start doing some calculations, and hope to receive feedback about it. I want to know if I do the calculations right.MCP4725 - 12 bit resolutionPowering from 3.0 volts ==> Each LSB equals: 3volts divided by 12bit(4095) = 0.73mV for each LSBSpecs from datasheet:INL Error +-14.5 LSB MAX ==> 29.00 LSB per part variation MAX ==> 29LSB equ 24.25mVDNL Error +-0.75 LSB MAX ==> 1.50 LSB per part variation MAX ==> 1.50LSB equ 1.01mVOffset error 0.75% of FSR ==> FSR = 3.0Volts, 0.75% from 3 volts = 22.5mVGain Error +-2% MAX of FSR ==> FSR = 3.0Volts, 4% from 3 volts = 120mVWith this information I made this plot, is it correct?And also one in percentages:1This is calculated by 3000mV dividing by 12bit (=4095), and then multiplying the result by 4000.2Please also note that these MCP4725 DAC's are not specified beyond the 100..4000 range (they make an really small footnote about this in the datasheet that the specs are not valid beyond this region). Luckily for me, I used the DAC exclusively around 200...3500 decimals.

author: dannyf
author_rank: Super Contributor
timestamp: August 21, 2014, 11:23:35 am
content: QuoteTwo completely different concepts: accuracy vs. resolution.Your calculation is directionally correct: it assumes those error terms are additive -> worst case scenario. In reality, they may offset each other, at least partially. But from a design perspective, it is prudent to assume no offset.

author: Varys
author_rank: Newbie
timestamp: August 21, 2014, 01:45:45 pm
content: Quote from: dannyf on August 21, 2014, 11:23:35 amThank you very much for your highly valued feedback.In the meantime I compared several DAC's. Selected from their price starting from cheapest to the more expensive ones.Would you all please look into it and feedback me for mistakes or anything?Quote

author: Neilm
author_rank: Super Contributor
timestamp: August 21, 2014, 06:54:20 pm
content: Are you taking the accuracy of the reference into your consideration? I had an application a few years ago where the noise and variation on the reference caused significant issues with the performance of the unit

author: Varys
author_rank: Newbie
timestamp: August 22, 2014, 07:06:07 am
content: Quote from: Neilm on August 21, 2014, 06:54:20 pmThanks for your reply.Good one that you mention it, seen that the DAC is just as accurate as the reference voltage is.I selected  reference for this project, it costs only 0.66 euro @10pc. It has min/max output voltage range respectively 2.988 3.012 for the 3v reference. Meaning that the output voltage has a tolerance of 0,0004%.I design for 10 to 50 degrees, delta of 40 degrees, with 65ppm this is 2600ppm. 1ppm = 3uV so multiplying this by 2600 gives me 7.8mV absolute change. Right? If so, this adds another 0.26% to the output voltage range. Also I take into consideration the output noise for freq. below 10hz, which is specified at 35uV p-p.

author: dannyf
author_rank: Super Contributor
timestamp: August 22, 2014, 11:03:01 am
content: One way for you to achieve higher accuracy than the worst case scenario from the datasheet is to re-calibrate the output: you can let the chip output a series of values and measure the values with a meter. After that, you can adjust the output in software so that the "correct" value is shown on the output.

author: diyaudio
author_rank: Frequent Contributor
timestamp: August 22, 2014, 11:26:28 am
content: Quote from: Varys on August 21, 2014, 10:24:04 amFew months back I came across gerrysweeney blog and seems he had the same issues with a MCP4822 DAChttp://gerrysweeney.com/fully-programmable-modular-bench-power-supply-part-7/

author: David Hess
author_rank: Super Contributor
timestamp: August 22, 2014, 03:47:16 pm
content: One of the first things I do when evaluating converters is check the integral non-linearity.An INL of up to +/- 14.5 counts rounds up to 32 counts so 5 bits are lost from the original 12 making it a 7 bit DAC which is a lot more consistent with the offset and gain errors.A lot of that may be calibrated out if you want to spend the effort but the best you can expect to do is less than 11 bits because the DAC is not monotonic and I would halve that again making 10 bits the maximum performance I would expect under the best conditions.