
DocID024597 Rev 5
623/1830
RM0351
Digital-to-analog converter (DAC)
647
To disable the output buffer, the MODEx[2:0] bits in DAC_MCR register should be:
•
010: DAC is connected to the external pin
•
011: DAC is connected to on-chip peripherals
Sample and Hold mode
In sample and Hold mode, the DAC core converts data on a triggered conversion, then,
holds the converted voltage on a capacitor. When not converting, the DAC cores and buffer
are completely turned off between samples and the DAC output is tri-stated, therefore
reducing the overall power consumption. A new stabilization period (
T
stab-BON
or
T
stab-BOFF
depending on buffer state) is needed before each new conversion.
In this mode, the DAC core and all corresponding logic and registers are driven by the low-
speed clock (LSI: Low Speed Internal oscillator) in addition to the APB bus clock, allowing to
use the DAC channels in deep low power modes such as Stop mode.
The sample/hold mode operations can be divided into 3 phases:
1.
Sample phase: the sample/hold element is charged to the desired voltage. The
charging time depends on capacitor value (internal or external, selected by the user).
The sampling time is configured with the TSAMx[9:0] bits in DAC_SHSRx register.
During the write of the TSAMx[9:0] bits; the BWSTx bit in DAC_SR register is set to 1 to
synchronize between both clocks domains (APB and low speed clock) and allowing the
software to change the value of sample phase during the DAC channel operation
2. Hold phase: the DAC output channel is tri-stated, the DAC core and the buffer are
turned off, to reduce the current consumption. The hold time is configured with the
THOLDx[9:0] bits in DAC_SHHR register
3. Refresh phase: the refresh time is configured with the TREFx[7:0] bits in DAC_SHRR
register
The timings for the three phases above are in units of LSI clocks. As example, to configure
a Sample time of 350µs, Hold time of 2ms and Refresh time of 100µs assuming LSI ~32KHz
is selected:
12 cycles are required for sample phase: SAMx[9:0] = 11, 62 cycles are required for hold
phase: THOLDx[9:0] = 62, and 4 cycles are required for refresh period: TREFx[7:0] = 4.
In this example, the power consumption is reduced by almost a factor of 15 versus Normal
modes.
The Formulas to compute the right sample and refresh timings are described in the table
below, the Hold time depends on the leakage current.
Table 123. Sample and refresh timings
Buffer
State
t
sampling (1)(3)
t
refresh (2)(3)
Enable
T
stab-BON
+ (10*R
BON
*C
load
)
T
stab-BON
+ (R
BON
*C
load
)*ln(2*N
lsb
)
Disable
T
stab-BOFF
+ (10*R
BOFF
*C
load
)
T
stab-BOFF
+ (R
BOFF
*C
load
)*ln(2*N
lsb
)