SME
Embedded Systems · Problem type
A DAC’s output voltage
Use this for “An 8-bit DAC with a 5 V reference gets the code 200. What voltage comes out?”
Chart
8
bits:
256
codes,
0
to
255;
1
LSB
=
5
V
256
=
19.53
mV
Code 200 gives 200 × 19.53 mV = 3.906 V
Zoomed to codes 193 to 208 of 0 to 255
This is an example. Type your own values to start a new problem.
Vₒᵤₜ (V)
=
×
Vref (V)
2
LSB
Step size
calculated
Formulas
LSB
=
Vref
2
n
0.01953
=
5
2
8
Vₒᵤₜ
=
D
×
Vref
2
n
3.9063
=
200
×
5
2
8
Formulas are worked in V. The step-by-step shows the conversions.
Assumptions
•
Each code step adds 1 LSB = Vref ÷ 2ⁿ, so Vₒᵤₜ = D × Vref ÷ 2ⁿ.
•
D runs from 0 to 2ⁿ − 1: the top code gives Vref less one LSB, never Vref itself.
•
The output holds each level until the code changes, so it moves as a staircase.
Step-by-step
WE KNOW
n = 8, Vref = 5 V, D = 200
FIND
step size (LSB), output voltage (Vₒᵤₜ)
Step 1 · Find step size (LSB)
Use LSB = Vref ÷ 2ⁿ
n
bits
make
2ⁿ
codes,
so
the
reference
is
cut
into
2ⁿ
equal
steps.
LSB
=
5
2
8
LSB
=
5
256
LSB = 0.01953 V
Step 2 · Find output voltage (Vₒᵤₜ)
Use Vₒᵤₜ = D × Vref ÷ 2ⁿ
The code’s share of all 2ⁿ codes is the output’s share of the reference.
Vₒᵤₜ
=
200
×
5
2
8
Vₒᵤₜ
=
200
×
5
256
Vₒᵤₜ
=
1,000
256
Vₒᵤₜ = 3.9063 V
Step 3 · Convert the answers
Change each answer back to the unit you chose.
LSB = 0.01953 V = 19.5313 mV (1 V = 1000 mV)
Check
Put the numbers back in. Both sides should match.
0.01953
=
5
2
8
✓
3.9063
=
200
×
5
2
8
✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.
Related lessons
Microcontrollers
Main lesson
An LED’s resistor on a pin
Use this for “A 3.3 V pin drives an LED with a 2 V drop at 10 mA. What resistor goes in series?”
A divider down to 3.3 V
Use this for “A 5 V signal reaches a 3.3 V pin through 2.2 kΩ over 3.3 kΩ. What voltage does the pin see?”
Setting and clearing a register bit
Use this for “An 8-bit register holds 0x41. Set bit 3, then clear bit 6. What does it hold?”