DAC output voltage determination

Thread Starter

Anderson Mwamba

Joined Dec 23, 2013
1
There is an integrated DAC word length N=8 bits and a range of reference voltage 0V....+10v. Determine the value of the output voltage when the input code 170.
 

spinnaker

Joined Oct 29, 2009
7,830
TS - "0V....+10v"

Whatever that means.


And the numbering notation. Is 170 decimal, hexadecimal or octal?

With a 8 bit DAC 170 is probably not hex but one should never assume. ESPECIALLY in engineering.

And if the ref voltage can indeed be 0-10V then your answer is you don't have enough time in your life to calculate because there are an infinite number of answers.

But I am guessing TSmeans 10V as referenced to Ov.
 
Last edited:

EM Fields

Joined Jun 8, 2016
583
Not according to this MCP4901 DAC datasheet from Microchip.
Even in that data sheet, the term in question is in the numerator.

But, there appears to be an inherent error in the equation given in the data sheet in that the denominator is given as decimal 256 for an 8 bit DAC.

Given a reference of 10 volts and a gain of 1, with the input code to the DAC being decimal 255 and the denominator being 256, Vout would be:

\( V_{out} = \frac{10V\times255}{256} \approx 9.96 volts\), which is wrong.

With the denominator at 255, however, we have:

\( V_{out} = \frac{10V\times255}{255} = 10.00 volts\), which is right.
 
Last edited:

bogosort

Joined Sep 24, 2011
696
Even in that data sheet, the term in question is in the numerator.

But, there appears to be an inherent error in the equation given in the data sheet in that the denominator is given as decimal 256 for an 8 bit DAC.

Given a reference of 10 volts and a gain of 1, with the input code to the DAC being decimal 255 and the denominator being 256, Vout would be:

\( V_{out} = \frac{10V\times255}{256} \approx 9.96 volts\), which is wrong.

With the denominator at 255, however, we have:

\( V_{out} = \frac{10V\times255}{255} = 10.00 volts\), which is right.
Your first result is the correct one. An 8-bit DAC has 256 possible output codes. If it's unipolar with a 10V reference, an LSB is worth 10/256. So the minimum output voltage is 0 * LSB = 0V, and the maximum output voltage is 255 * LSB = 9.96 V.
 

OBW0549

Joined Mar 2, 2015
3,566
yeah, from 0 to 255.

the microchip datasheet is wrong.
Oh, good grief. If the Microchip data sheet is wrong, then the data sheets for ALL of the DACs I've ever seen and used in the last 40+ years, from EVERY manufacturer, are also wrong-- because they all say the same thing: the output of an N-bit DAC is the reference voltage (or current, whichever the case) times the input code divided by 2^N, NOT divided by (2^N-1).
 

EM Fields

Joined Jun 8, 2016
583
Your first result is the correct one. An 8-bit DAC has 256 possible output codes. If it's unipolar with a 10V reference, an LSB is worth 10/256. So the minimum output voltage is 0 * LSB = 0V, and the maximum output voltage is 255 * LSB = 9.96 V.
Thanks for the reality check :) You're right, my first result was the correct one. I got chunks and levels confused. Here's the proof:

4 bit R-2R DAC.png
 
Last edited:
Top