29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

RM0008<br />

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

Figure 48.<br />

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

APB1_CLK<br />

DHR<br />

0x00<br />

DOR<br />

0xAAA<br />

0xD55<br />

SWTRIG<br />

ai14714<br />

Note:<br />

DAC trigger must be enabled for noise generation, by setting the TENx bit in the DAC_CR<br />

register.<br />

12.3.9 Triangle-wave generation<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 <strong>and</strong> the sum is stored into the<br />

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

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

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

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

Figure 49.<br />

DAC triangle wave generation<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Doc ID 13902 Rev 9 239/995

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

Saved successfully!

Ooh no, something went wrong!