Diamond Systems 16-Channel 12-Bit Analog Output PC/104 Module Computer Hardware User Manual


 
Copyright 2001 Diamond Systems Corp. Ruby-MM-1612 User Manual V1.1 P. 17
Examples
Single channel output
Assume channels 0 - 7 are configured for 0-5V. To set channel 0 to 3V, do the following:
D/A code is 3V / 5V x 4096 = 2458 (value is rounded to nearest integer)
LSB = 2458 AND 255 = 154
MSB = (2458 AND 3840) / 256 = 9
Step 1. Write 154 to base + 0 (LSB register).
Step 2. Write 0 to base + 2 (Channel register).
Step 3. Write 9 to base + 1 (MSB register). The value 2458 is written to DAC 0.
Step 4. Read from base + 0. DAC 0 now outputs 3.000V.
Two channel output
Assume channels 0 - 7 are configured for 0-5V. To set channel 0 to 3.8V and channel 3 to 1.5V, do the
following:
D/A code for channel 0 = 3.8 / 5 x 4096 = 3113
LSB = 3113 AND 255 = 41
MSB = (3113 AND 3840) / 256 = 12
D/A code for channel 1 = 1.5 / 5 x 4096 = 1229
LSB = 1229 AND 255 = 205
MSB = (1229 AND 3840) / 256 = 4
Step 1. Write 41 to base + 0 (LSB register).
Step 2. Write 0 to base + 2 (Channel register).
Step 3. Write 12 to base + 1 (MSB register). The value 3113 is written to DAC 0.
Step 4. Write 205 to base + 0 (LSB register).
Step 5. Write 0 to base + 2 (Channel register).
Step 6. Write 4 to base + 1 (MSB register). The value 1229 is written to DAC 1.
Step 7. Read from base + 0. DAC 0 and DAC3 are both updated to their new output voltages. All
other channels remain at their existing output voltages.