
On the S12compact, the ADC is an optional component (not inclu-
ded in the standard version).
D/A-Converter (DAC)
The 16-bit D/A-Converter (IC12) is a DAC8532 from Burr Brown.
This device contains two output channels (VOUTA, VOUTB), which
can be set either simultaneously or individually.
The reference voltage (4.096V) is deliverd by IC10 (see ADC
description).
The load resistance at the output(s) should be at least 2kOhm. At
power-up, the output registers of the DAC are reset, thus delivering 0V.
The DAC is controlled via SPI0. /SPICS1 serves as chip select
signal for the DAC.
The analog outputs VOUTA and VOUTB are available at connec-
tor X4.
The following listing shows a software example for the DAC:
//-----------------------------------------------------------------------------
// Note: CPHA=0, CPOL=0 required
//
void putDAC8532(UINT8 channel, UINT16 value) {
// set up SPI mode
SPI0CR1 = BM_SPE | BM_MSTR | BM_CPHA; // CPOL=0 CPHA=1
// send command
PTH = S12CO_SPICS1; // enable /CS1
if((channel & 1) == 0)
xferSPI0(0x10); // load & set DACA
else
xferSPI0(0x24); // load & set DACB
// send data
xferSPI0(value >> 8); // send bits 15..8
xferSPI0(value); // send bits 7..0
PTH = S12CO_SPICSH; // disable /CS1
}
//-----------------------------------------------------------------------------
On the S12compact, the DAC is an optional component (not inclu-
ded in the standard version).
S12compact
30