![ARTERY AT32F435 Series Reference Manual Download Page 389](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592389.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 389
Rev 2.03
DMA underflow
When the DAC DMA request is enabled, an overflow occurs if a second external trigger arrives before
the acknowledgement for the first external trigger is received. In this case, no new external trigger is
handled, or no new DMA request is issued, and the DxDMAUDRF bit in the DAC_SR register is set,
reporting the error condition. An interrupt is generated if its corresponding DxDMAUDRIEN bit in the
DAC_CTRL register is set.
The software clears the DxDMAUDRF bit by writing 1. The DxDMAEN bit should be cleared in the
DAC_CTRL register before re-starting a DMA transfer and re-initializing DMA and DAC.
Input/output configuration
The digital inputs are linearly converted to analog voltage outputs by the DAC, and it is between 0
and V
REF+.
The analog DAC module is supplied by VDDA. The positive analog reference voltage
input falls between 2.0 V and VDDA. To avoid parasitic interruption and excessive consumption,
the PA4 or PA5 should be configured to analog input.
DAC output = V
REF+
x (DxODT[11: 0]/4095)
19.4 Functional overview
19.4.1 Trigger events
If the DxTRGEN bit in the DAC_CTRL register is set, the DAC conversion can then be triggered by an
external event (timer counter, external interrupt line) or by software. The DxTRGSEL[2: 0] is used to
select trigger sources.
Table 19-1 Trigger source selection
Source
DxTRGSEL [2:0]
Description
TMR6_TRGOUT
000
On-chip signals
TMR8_TRGOUT
001
TMR7_TRGOUT
010
TMR5_TRGOUT
011
TMR2_TRGOUT
100
TMR4_TRGOUT
101
EXINT_9
110
External signals
DxSWTRG
111
Software trigger
When the DxTRGEN bit is set, the data stored into the HDRx register is transferred into the DAC_DxODT
register each time a DAC detects an active trigger event,. If the software trigger is selected, the
DxSWTRG flag is cleared by hardware after writing 1. The DAC output becomes active after a period of
time once the data is loaded into the DAC_DxODT register.
When the DxTRGEN bit is cleared, each data written to the data register is immediately transferred into
the DAC_DxODT register without the need of a trigger event.
19.4.2 Noise/Triangular-wave generation
The DAC can output a variable-amplitude pseudo noise and a triangular wave, which is done by the
LENinear Feedback Shift Register and triangle wave generator respectively. The DAC variable-
amplitude pseudo noise generation is selected by setting DxNM[1:0]=01 in the LFSR, while the DAC
triangular-wave generation is selected by setting the DxNM[1:0]=1x.
LFSR logic
The preloaded value in the LFSR is 0xAAA. This register is updated after each trigger event based on a
specific calculation algorithm.