4. Set up a DMA transfer from a buffer in RAM to CHxDATA
5. Set CONVMODE to CONTINUOUS
23.3.13 Sine Generation Mode
The VDAC contains an automatic sine-generation mode, which is enabled by setting the SINEMODE bit in VDACn_CTRL. In this mode,
the VDAC data is overridden with a conversion data taken from a sine lookup table. The sine signal is controlled by the PRS line selec-
ted by CH0PRSSEL in VDACn_CH0CTRL. When the line is high, a sine wave will be produced. Each period, starting at 0 degrees, is
made up of 16 samples and the frequency is given by
Figure 23.5 VDAC Sine Generation on page 760
. In case OUTENPRS equals
1, lowering the PRS line selected by CH0PRSSEL will reset the sine output to 0 degrees resulting in a voltage of Vref/2 on the output
channel. In case OUTENPRS equals 0, lowering the PRS line selected by CH0PRSSEL will stop progress of the sine wave at the sam-
ple currently being output (and the sine will therefore not be reset to 0 degrees when raising the PRS line again).
f
sine
= f
HFPERCLK
/ 32 x (PRESC + 1)
Figure 23.5. VDAC Sine Generation
Sine mode is supported only for the fastest configuration of the VDAC in continuous mode. Therefore the CONVMODE bitfield needs to
be set to CONTINUOUS and the SETTLETIME bitfield in VDACn_OPAxTIMER need to be programmed to zero for the used channel(s)
in order to use sine generation mode. The TRIGMODE bitfield needs to be programmed to PRS for any channel used for sine genera-
tion mode. The other trigger modes are not supported.
The SINE wave will be output on channel 0 and therefore requires that this channel is enabled by writing 1 to CH0EN in the
VDACn_CMD register. If DIFF is set in VDACn_CTRL, the sine wave will be output on both channels, but inverted. Note that when
OUTENPRS in VDACn_CTRL is set, the sine output will be reset to 0 degrees when the PRS line selected by CH1PRSSEL is low.
CH1 PRS
DACn_OUT1
DACn_OUT0
Hi-Z
Hi-Z
CH0 PRS
Vref
0
Vref/2
Vref
0
Vref/2
Figure 23.6. VDAC Sine Mode
23.3.14 Interrupt Flags
The VDAC has several interrupt flags, indicating state transitions and error conditions.
In addition to the VDAC interrupt flags the VDAC registers contain interrupt flags for the OPAMP modules. See The OPAMP chapter for
more information on these flags.
23.3.14.1 Conversion Done
The Conversion Done (CHxCD) interrupt flags are set when a conversion is complete. The flags are set after a channel has driven the
output with the new code for the time programmed in SETTLETIME in VDACn_OPAxTIMER.
23.3.14.2 Buffer Level
The Buffer Level (CHxBL) interrupt flags are set when there is space available in CHxDATA. These flags are initially set, get cleared
when CHxDATA is written and set again when the value is used for a conversion.
Reference Manual
VDAC - Digital to Analog Converter
silabs.com
| Building a more connected world.
Rev. 1.1 | 760