
DocID024597 Rev 5
621/1830
RM0351
Digital-to-analog converter (DAC)
647
Figure 141. DAC LFSR register calculation algorithm
The LFSR value, that may be masked partially or totally by means of the MAMPx[3:0] bits in
the DAC_CR register, is added up to the DAC_DHRx contents without overflow and this
value is then transferred into the DAC_DORx register.
If LFSR is 0x0000, a ‘1 is injected into it (antilock-up mechanism).
It is possible to reset LFSR wave generation by resetting the WAVEx[1:0] bits.
Figure 142. DAC conversion (SW trigger enabled) with LFSR wave generation
Note:
The DAC trigger must be enabled for noise generation by setting the TENx bit in the
DAC_CR register.
19.3.9 Triangle-wave
generation
It is possible to add a small-amplitude triangular waveform on a DC or slowly varying signal.
DAC triangle-wave generation is selected by setting WAVEx[1:0] to “10”. The amplitude is
configured through the MAMPx[3:0] bits in the DAC_CR register. An internal triangle counter
is incremented three APB1 clock cycles after each trigger event. The value of this counter is
then added to the DAC_DHRx register without overflow and the sum is transferred into the
DAC_DORx register. The triangle counter is incremented as long as it is less than the
125
;
;
;
;
;
;25
DLF
$3%B&/.
[
[$$$
'+5
'25
DLE
['
6:75,*