09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

<strong>RM0090</strong> Digital-to-analog converter (DAC)<br />

Figure 59. DAC conversion (SW trigger enabled) with LFSR wave generation<br />

APB1_CLK<br />

DHR<br />

DOR<br />

SWTRIG<br />

0x00<br />

Note: The DAC trigger must be enabled for noise generation by setting the TENx bit in the<br />

DAC_CR register.<br />

12.3.9 Triangle-wave generation<br />

0xAAA<br />

It is possible to add a small-amplitude triangular waveform on a DC or slowly varying signal.<br />

DAC triangle-wave generation is selected by setting WAVEx[1:0] to “10”. The amplitude is<br />

configured through the MAMPx[3:0] bits in the DAC_CR register. An internal triangle counter<br />

is incremented three APB1 clock cycles after each trigger event. The value of this counter is<br />

then added to the DAC_DHRx register without overflow and the sum is stored into the<br />

DAC_DORx register. The triangle counter is incremented as long as it is less than the<br />

maximum amplitude defined by the MAMPx[3:0] bits. Once the configured amplitude is<br />

reached, the counter is decremented down to 0, then incremented again and so on.<br />

It is possible to reset triangle wave generation by resetting the WAVEx[1:0] bits.<br />

Figure 60. DAC triangle wave generation<br />

MAMPx[3:0] max amplitude<br />

+ DAC_DHRx base value<br />

DAC_DHRx base value<br />

0<br />

Incrementation<br />

Decrementation<br />

0xD55<br />

ai14714<br />

ai14715c<br />

Doc ID 018909 Rev 3 312/1416

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!