UG-1634
Rev. 0 | Page 8 of 15
EXAMPLE SEQUENCE
This section demonstrates how to configure the
a selected function. The
data sheet must be consulted
when programming the device.
Force Voltage Measure Current Example
This example is used to configure the
in voltage
output mode, sourcing 11 V across the Channel A screw terminals.
This example also measures the corresponding current through
the R
SENSE
resistor using the on-chip, analog-to-digital converter
(ADC). The ADC measurement is completed using a conversion
rate of 20 SPS with 50 Hz and 60 Hz rejection enabled. See Table 2
for the full list of commands.
A suitable load must be placed across the screw terminals. Refer
to the
data sheet for more information.
To complete the register write steps shown in Table 2 using the
GUI, take the following steps:
1.
In the
Configure
tab, use the dropdown menus to select
Actuators
and
Voltage Output
.
2.
In the
Advanced Settings
panel, set the
DAC Code
slider
to 8191 (11 V).
3.
Click
Apply
. This executes all writes required to configure
the device and to enable ADC conversions in the default
mode. This configuration allows the
to measure
voltage across the R
SENSE
resistor in the 0 V to 2.5 V range at
a 20 SPS conversion rate.
4.
Click the
View Results
tab to view the ADC results.
See Figure 10 for the corresponding script.
Table 2. Force Voltage Measure Current Instruction Set
Instruction Instruction
Description
W/R
1
Register Name
and Address
Data Notes
1 Configure
Channel
A
in
voltage output mode
W CH_FUNC_SETUPA,
Address 0x01
0x0001
2
Write full-scale code to
DAC_A to generate 11 V
W DAC_CODEA,
Address 0x16
0x1FFFF LDAC pin voltage = 0 V to allow outputs to be updated instantly.
3
Measure 11 V across
Channel A screw terminals
N/A
2
N/A
2
N/A
2
Use handheld meter to verify voltage.
4
Enable ADC to convert and
measure current through
R
SENSE
resistor
W ADC_CONV_CTRL,
Address 0x23
0x0201
When the write in Instruction 1 is executed, the ADC automatically
configures to measure voltage across the R
SENSE
resistor in a 0 V to
2.5 V range.
5 Read
ADC
results R
ADC_RESULTA,
Address 0x26
6
Calculate current through
R
SENSE
resistor using the
equation available in the
data sheet
N/A
2
N/A
2
N/A
2
_
65535
MIN
RSENSE
SENSE
AD CODE
V
Voltage Range
I
R
where:
I
RSENSE
is the current through the R
SENSE
resistor.
V
MIN
is −2.5 V, the minimum voltage is in the −2.5 V to 2.5 V range.
The voltage range is 5 V.
7
Stop ADC conversions
W
ADC_CONV_CTRL,
Address 0x23
0x0000
8
Program DAC_A to zero scale
W
DAC_CODEA,
Address 0x16
0x0000
Cleanup of DAC code and channel configuration is recommended
before reprogramming the device.
9
Reset Channel A to
high-Z mode
W CH_FUNC_SETUPA,
Address 0x01
0x0000
1
W is write and R is read.
2
N/A is not applicable.