![ARTERY AT32F435 Series Скачать руководство пользователя страница 390](http://html1.mh-extra.com/html/artery/at32f435-series/at32f435-series_reference-manual_2977592390.webp)
AT32F435/437
Series Reference Manual
2022.11.11
Page 390
Rev 2.03
Figure 19-2 LFSR register calculation algorithm
11
X
12
10
9
6
8
7
5
4
3
0
2
1
NOR
12
X
6
X 4
X
X
0
XOR
The DxNBSEL [3: 0] bit in the DAC_CTRL register is set to mark partially or totally the LFSR data. The
resulting value is then added up to the DHRx value without overflow and this value is loaded into the
DAC_DxODT register. It is possible to disable LFSR function and reset LFSR wave generation algorithm
by setting DxNM[1: 0]=00.
Triangular wave logic
The DAC triangular-wave generation is selected by setting DxNM[1: 0]=1x. The amplitude is configured
through the DxNBSEL [3: 0] bit in the DAC_CTRL register. An internal triangular-wave counter is
incremented at each trigger event. Once the maximum amplitude programmed in the DxNBSEL [3: 0] is
reached, the value of this counter is decremented down to 0, then incremented again, and so on.
Meanwhile, the value of this counter is then added up to the DHRx register without overflow and the
resulting value is loaded into the DAC_DxODT register. It is possible to disable/reset the triangular-wave
generation by setting DxNM[1: 0]=00.
Figure 19-3
Triangular-wave generation
Increase
DHRx Vaule
DxNBSEL[3:0]
+DHRx
0
Decrease
19.4.3 DAC data alignment
The DAC supports a single DAC and dual DA mode. The data format is dependent on the selected
configuration mode.
Single DAC data format:
8-bit right alignment: load data into the DAC_DxDTH8R [7:0]
12-bit left alignment: load data into the DAC_DxDTH12L [15: 4]
12-bit right alignment: load data in the DAC_DxDTH12R [11: 0]
Dual DAC data format: