Diamond Systems RUBY-MM-1612 user manual 10. D/A Code Computation

Page 14

10.D/A CODE COMPUTATION

Two different methods are used to compute the 12-bit D/A code used for analog output operations. For unipolar output ranges (positive voltages only), straight binary coding is used.

For bipolar output ranges (both positive and negative voltages), offset binary coding is used.

For any output range, the resolution is equal to the maximum possible range of output voltages divided by the maximum number of possible steps. For a 12-bit D/A converter as is used on the Ruby-MM-1612, the

maximum number of steps is 212 = 4096 (the actual output codes range from 0 to 4095, which is the full range of possible 12-bit binary numbers). Thus the resolution is equal to 1/4096 times the full-scale range. This is the smallest possible change in the output and corresponds to a change of 1 in the output code. Because of this fact the resolution is often referred to as the value of 1 LSB, or 1 least significant bit.

Straight Binary Coding (for unipolar output ranges)

This is the simplest form of binary coding. The output voltage is given by:

Output Voltage = (Output Code / 4096) x Full-Scale Voltage

Example:

Output code = 1024, full-scale voltage = 5V

 

Output voltage = (1024 / 4096) x 5 = .25 x 5 = 1.250V

Conversely, the output code for a desired output voltage is given by:

Output Code = (Desired Output Voltage / Full-Scale Voltage) x 4096

Example:

Desired output voltage = 0.485V, Full-scale voltage = 2.5V

 

Output Code = (0.485 / 2.5) x 4096 = 0.194 x 4096 = 795 (rounded up)

The relationship between D/A resolution and Full-scale voltage is:

1 LSB = 1/4096 x Full-Scale Voltage

Example: Full-scale voltage = 5V; 1 LSB = 5V / 4096 = 1.22mV

Here is a brief overview of the relationship between output code and output voltage:

Output Code

Explanation

Output Voltage for 0-5V Range

0

0V

0V

1

1 LSB

.0024V (2.44mV)

2048

1/2 positive full scale

2.5V

4095

Positive full scale - 1 LSB

4.9988V

Note: In order to generate an output voltage of positive full scale, you would have to output a code of 4096 (4096 / 4096 x full-scale = full-scale). However, 4096 is a 13-bit number which cannot be reproduced on a 12-bit D/A converter. The highest number that can be output is 4095, which is 4096 - 1. This results in a maximum output voltage of full scale minus 1 LSB for any analog output range. This phenomenon is true for all D/A and A/D converters.

Copyright 2001 Diamond Systems Corp.

Ruby-MM-1612 User Manual V1.1 P. 14

Image 14 Contents
RUBY-MM-1612 Table of Contents Description Signal Name Definition O Header PinoutBase Address Board ConfigurationBase Address Configuration Header J5 Position Hex Decimal On-Board Reference Full-Scale Voltage Selection Analog Output Range ConfigurationAdjustable Reference Voltage Full-Scale VoltageAnalog Output Configuration Header J4 Range RUBY-MM-1612 Board Drawing Base + Write Function Read Function Reset informationRuby-MM-1612 I/O Map Base + 0, Write DAC LSB register Base + 0 or 1, Read Update DACsRegister Definitions Base + 1, Write DAC MSB registerBase + 3, Write External trigger register 82C55 Register Map Configuration Register82C55 Digital I/O Chip Operation DefinitionsFull Scale Analog Output Ranges and ResolutionFull Scale 1LSB 10. D/A Code Computation Output Code Explanation Output Voltage for ±5V Range Offset Binary Coding for bipolar output rangesLSB = 1/2048 x Full-Scale Voltage To generate an analog output on one or more channels HOW to Generate AN Analog OutputHardware Update Command Examples Single channel output Two channel outputCalibration Procedure Specifications MiscellaneousDescription FeaturesOrdering Information PinoutsFunctional Diagram 82C55A Pin DescriptionRead/Write and Control Logic 82C55A Functional DescriptionData Bus Buffer Group a and Group B ControlsOperational Description Mode Selection82C55A Ports A, B, and CInterrupt Control Functions Single Bit Set/Reset Feature FigureOperating Modes Inte Flip-Flop DefinitionMode 0 Configurations Mode 0 Basic InputMode 0 Basic Output Control Word #4 Control Word #8 IBF Input Buffer Full F/F Input Control Signal DefinitionSTB Strobe Input Output Control Signal Definition Intr Interrupt RequestOutput Operations Mode 2 Strobed Bi-Directional Bus I/OBi-Directional Bus I/O Control Signal Definition Input OperationsMode Control Word Mode 2 Combinations Special Mode Combination Considerations Current Drive CapabilityApplications of the 82C55A Reading Port C Status Figures 15