Datasheet

2010 Microchip Technology Inc. DS22249A-page 31
MCP4802/4812/4822
6.9 Building Programmable Current
Source
Example 6-6 shows an example of building a
programmable current source using a voltage follower.
The current sensor (sensor resistor) is used to convert
the DAC voltage output into a digitally-selectable
current source.
Adding the resistor network from Example 6-2 would
be advantageous in this application. The smaller
R
SENSE
is, the less power dissipated across it.
However, this also reduces the resolution that the
current can be controlled with. The voltage divider, or
“window”, DAC configuration would allow the range to
be reduced, thus increasing resolution around the
range of interest. When working with very small sensor
voltages, plan on eliminating the amplifier’s offset error
by storing the DAC’s setting under known sensor
conditions.
EXAMPLE 6-6: DIGITALLY-CONTROLLED CURRENT SOURCE
DAC
R
SENSE
I
b
Load
I
L
V
DD
SPI
3-wire
V
CC
+
V
CC
V
OUT
I
L
V
OUT
R
sense
---------------
1+
-------------
=
I
b
I
L
----=
Common-Emitter Current Gainwhere
V
DD
or V
REF
(a) Single Output DAC:
MCP4801
MCP4811
MCP4821
(b) Dual Output DAC:
MCP4802
MCP4812
MCP4822
G = Gain selection (1x or 2x)
D
n
= Digital value of DAC (0-255) for MCP4801/MCP4802
= Digital value of DAC (0-1023) for MCP4811/MCP4812
= Digital value of DAC (0-4095) for MCP4821/MCP4822
N = DAC bit resolution