2 – dac data registers (dacd0-dacd7), 3 – reference pin configuration register (rpcfg), 3 – dac code examples – Maxim Integrated DS4830A Optical Microcontroller User Manual
Page 47: Ds4830a user’s guide

DS4830A User’s Guide
47
6.2.2 – DAC Data Registers (DACD0-DACD7)
Bit
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Name
-
-
-
-
DACDx[11:0]
Reset
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Access
r
r
r
r
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
rw
BIT
NAME
DESCRIPTION
15:12
-
Reserved. The user should write zero to these bits.
11:0
DACDx
*[11:0]
DACDx: These bits set the DACx output voltage according to reference selection
and reference value.
DACx Output voltage (in Volts) = (DAC Count / 4095) * Reference Voltage (in Volts)
*
‘x’ = 0 to 7
6.2.3 – Reference Pin Configuration Register (RPCFG)
Bit
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0
Name
-
-
-
-
-
-
-
-
-
-
-
-
-
-
REFB_CFG REFA_CFG
Reset
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
0
Access
r
r
r
r
r
r
r
r
r
r
r
r
r
r
rw
rw
BIT
NAME
DESCRIPTION
15:2
-
Reserved. The user should not write to these bits.
1
REFB_CFG
REFINB Pin Configuration: Setting this bit to ‘1’ configures the DAC external reference pin
for any DAC4-7 as analog input. PIN 39 is REFINB (Port1.4).
0
REFA_CFG
REFINA Pin Configuration: Setting this bit to ‘1’ configures the DAC external reference pin
for any DAC0-3 as analog input. PIN 31 is REFINA (Port2.6).
6.3 – DAC Code Examples
6.3.1 – DAC0 Enabled with Internal Reference and Output Voltage Configured for 50% (1.25V) of Internal
Reference
RPCFG = 0x0000;
DACCFG = 0x0002; //Only DAC0 enabled and internal reference is selected
DACD0 = 0x0800; //DACD0 is set for 50%
6.3.2 – DAC2 Enabled with External Reference And Output Voltage Configured for 25% of External Reference
at REFINA Pin
RPCFG = 0x0001;
DACCFG = 0x0010; //Only DAC2 enabled and external reference is selected
DACD2 = 0x0400; //DACD2 is set for 25%
6.3.3 – DAC6 Enabled with External Reference and Output Voltage Configured for 25% of External Reference
at REFINB Pin
RPCFG = 0x0002;
DACCFG = 0x1000; //Only DAC6 enabled and external reference is selected
DACD6 = 0x0400; //DACD6 is set for 25%