Analog Output Programming
VCM-DAS-3 Reference Manual
31
Analog Output Programming
Analog output voltages can be programmed either directly or with the use of a driver. This
section describes how to modify analog output voltages directly.
VCM-DAS-3 analog outputs have a resolution of 12 bits. Data is written to the board in 8-bit
bytes, so two bytes must be used to write a single analog output value. These bytes are referred to
as the least significant byte (LSB) and the most significant byte (MSB).
When modifying analog outputs, one or multiple channels can be updated simultaneously. For
this reason, the update operation is separate from the data write operation.
To change an analog output on one or more channels:
1.
Write the channel number to the DACSEL register at I/O port 0x302.
2.
Write the LSB to the DACLO register at I/O port 0x300.
3.
Write the MSB to the DACHI register at I/O port 0x301.
4.
Repeat steps 1-3 for each channel to be changed.
5.
Finally, update all channels simultaneously by reading the DACLO register.
E
XTERNAL
T
RIGGER
U
PDATE
An external trigger is enabled by setting the TRIGEN bit in the EXTRIG register at I/O port
0x303. When the external trigger is enabled, digital I/O line C0 will update all DACs
simultaneously when it is brought low. This can be done either by an external signal, when C0 is
in input mode, or in software, when C0 is in output mode. If using an external trigger, make sure
that the lower half of Port C is in input mode.
When the trigger signal is low, DACs are updated as soon as new data is written to them. When
the trigger signal is high, the DAC voltage outputs remain fixed, unless updated in software.
L
OAD
DAC
O
PERATION
The Load DAC (LDAC) operation provides a method for updating a single DAC channel. To
perform the LDAC operation, write Ah to the CTRL field of the ENCTRL register at I/O port
0x30A, combined with the channel number in the SEL field of the same register.
To change an analog output a single channel using the LDAC operation:
1.
Write the channel number to the DACSEL register at I/O port 0x302.
2.
Write the LSB to the DACLO register at I/O port 0x300.
3.
Write the MSB to the DACHI register at I/O port 0x301.
4.
Perform the LDAC operation for the selected channel.