388
8331B–AVR–03/12
Atmel AVR XMEGA AU
Figure 29-2.
DAC output model
29.7
DAC clock
The DAC is clocked directly from the peripheral clock (clk
PER
), and this puts a limitation on how
fast new data can be clocked into the DAC data registers.
29.8
Low Power mode
To reduce the power consumption in DAC conversions, the DAC may be set in a Low Power
mode. Conversion time will be longer if new conversions are started in this mode. This increases
the DAC conversion time per DAC channel by a factor of two.
29.9
Calibration
For improved accuracy, it is possible to calibrate for gain and offset errors in the DAC.
To get the best calibration result, it is recommended to use the same DAC configuration during
calibration as will be used in the final application. The theoretical transfer function for the DAC
was shown in
. Including gain and offset errors, the DAC output value
can be expressed as:
Equation 29-1.
Calculation of DAC output value
To calibrate for offset error, output the DAC channel's middle code (0x800) and adjust the offset
calibration value until the measured output value is as close as possible to the middle value
(VREF / 2). The formula for the offset calibration is given by the
,
where OCAL is OFFSETCAL and GCAL is GAINCAL.
Equation 29-2.
Offset calibration.
To calibrate for gain error, output the DAC channel's maximum code (0xFFF) and adjust the gain
calibration value until the measured output value is as close as possible to the top value
(VREF x 4095 / 4096). The gain calibration controls the slope of the DAC characteristic by rotat-
ing the transfer function around the middle code. The formula for gain calibration is given by the
.
DAC output
R
channel
R
feedback
DAC voltage
Buffer
DAC out
V
DAC
VREF
DATA
0
xFFF
------------------
ERROR
GAIN
⋅
⎝
⎠
⎛
⎞
⋅
V
OFFSET
+
=
V
OCAL
VREF
2.
OCAL
7
[ ]
1
–
(
)
OCAL
6
[ ]
64
------------------------
OCAL
5
[ ]
128
------------------------
OCAL
4
[ ]
256
------------------------
OCAL
3
[ ]
512
------------------------
OCAL
2
[ ]
1024
------------------------
OCAL
1
[ ]
2048
------------------------
OCAL
0
[ ]
4096
------------------------
+
+
+
+
+
+
⎝
⎠
⎛
⎞
⋅
⋅
=