
GD32L23x User Manual
235
The output buffer, which is turned on by default, can be turned off by setting the DBOFF bits
in the DAC_CTL0 register.
14.3.3.
DAC data configuration
The 12-bit DAC holding data (OUT_DH) can be configured by writing any one of the
OUT_R12DH, OUT_L12DH and OUT_R8DH registers. When the data is loaded by
OUT_R8DH register, only the MSB 8 bits are configurable, the LSB 4 bits are fored to 0.
14.3.4.
DAC trigger
The DAC external trigger is enabled by setting the DTEN bits in the DAC_CTL0 register. The
DAC external triggers are selected by the DTSEL bits in the DAC_CTL0 register, which is
Table 14-2. External triggers of DAC
Table 14-2. External triggers of DAC
DTSEL[2:0]
Trigger Source
Trigger Type
000
TIMER1_TRGO
Internal on-chip signal
001
TIMER2_TRGO
010
reserved
011
reserved
100
TIMER6_TRGO
101
TIMER5_TRGO
110
EXTI9
External signal
111
SWTRIG
Software trigger
The TIMERx_TRGO signals are generated from the timers, while the software trigger can be
generated by setting the SWTR bits in the DAC_SWT register.
14.3.5.
DAC conversion
If the external trigger is enabled by setting the DTEN bit in DAC_CTL0 register, the DAC
holding data is transferred to the DAC output data (OUT_DO) register when the selected
trigger event happened. When the external trigger is disabled, the transfer is performed
automatically.
When the DAC holding data (OUT_DH) is loaded into the OUT_DO register, after the time
t
SETTLING
, the analog output is valid, and the value of t
SETTLING
is related to the power supply
voltage and the analog output load.
14.3.6.
DAC noise wave
There are two methods of adding noise wave to the DAC output data: LFSR noise wave mode
and Triangle wave mode. The noise wave mode can be selected by the DWM bits in the
DAC_CTL0 register. The amplitude of the noise can be configured by the DAC noise wave