Diamond Power Products MM-48-AT user manual Input voltage = A/D value / 32768 * Full-scale voltage

Page 30

8.6 Convert the numerical data to a meaningful value

Once you have the A/D code, you need to convert it to a meaningful value. The first step is to convert it back to the actual measured voltage. Afterwards you may need to convert the voltage to some other engineering units (for example, the voltage may come from a temperature sensor, and then you would need to convert the voltage to the corresponding temperature according to the temperature sensor’s characteristics).

Since there are a large number of possible input devices, this secondary step is not included here; only conversion to input voltage is described.

It is possible to combine both transformations into a single formula for computing efficiency. To convert the A/D value to the corresponding input voltage, use the following formulas:

Conversion Formula for Bipolar Input Ranges

Input voltage = A/D value / 32768 * Full-scale voltage

Example: Input range is ±10V and A/D value is 17761:

Input voltage = 17761 / 32768 * 10V = 5.420V

For a bipolar input range, 1 LSB = 1/32768 * Full-scale voltage. For the +/-10V range, 1 LSB = 305µV, and for the +/-5V range, 1 LSB = 153µV.

Here is an illustration of the relationship between A/D code and input voltage for a bipolar input range (VFS = Full scale input voltage, 10V or 5V):

A/D Code

Input voltage symbolic formula

Input voltage for ±10V range

-32768

-VFS

-10.0000V

-32767

-VFS+ 1 LSB

-9.9997V

. . .

. . .

. . .

-1

-1 LSB

-0.00032V

0

0

0.0000V

1

+1 LSB

0.00032V

. . .

. . .

. . .

32767

VFS - 1 LSB

9.9997V

Conversion Formula for Unipolar Input Range

Input voltage = (A/D value + 32768) / 65536 * Full-scale voltage

Example: Input range is 0-5V and A/D value is 17761:

Input voltage = (17761 + 32768) / 65536 * 5V = 3.855V

For a unipolar input range of 0-5V, 1 LSB = 1/65536 * 5V = 76µV.

Here is an illustration of the relationship between A/D code and input voltage for a unipolar input range (VFS = Full scale input voltage):

A/D Code

Input voltage symbolic formula

Input voltage for 0-5V range

-32768

0V

0.0000V

-32767

1 LSB (VFS / 65536)

0.000076V

. . .

. . .

. . .

-1

VFS / 2 - 1 LSB

2.4999V

0

VFS / 2

2.5000V

1

VFS / 2 + 1 LSB

2.5001V

. . .

. . .

. . .

32767

VFS - 1 LSB

4.9999V

Diamond-MM-48-AT User Manual V1.01

Page 30

Image 30
Contents DIAMOND-MM-48-AT Table of Contents Description DIAMOND-MM-48-AT Board Drawing Signal Name Definition O Header Pinout and PIN DescriptionJ3 Analog and Digital I/O Signal Name Definition Relay output contacts J4 Relays and OptocouplersOptoisolated input contacts Base Address Jumper Position Hex Decimal Board ConfigurationBase Address Interrupt Level SelectionOptocoupler Polarity ReservedAnalog Input Range Overview Base + Write Function Read FunctionLSB MSB DA7 DA6 DA5 DA4 DA3 DA2 DA1 DA0 Register Map Bit AssignmentsWrite operations Read operationsDefinitions Register DefinitionsBase + Write Base + ReadAD9 AD8 Base + Read/Write A/D Channel RegisterHIGH3 HIGH2 HIGH1 HIGH0 LOW3 LOW2 LOW1 LOW0 RELAY7 RELAY6 RELAY5 RELAY4 RELAY3 RELAY2 RELAY1 RELAY0 Base + Read/Write Digital I/O Configuration RegisterBase + Read/Write Relay Control Port DIR3 DIR2 DIR1 DIR0DEDGE3 DEDGE2 DEDGE1 DEDGE0 DIO3 DIO2 DIO1 DIO0 DIO3 DIO2 DIO1 DIO0Base + Read Digital I/O Data and Edge Status OEN3 OEN2 OEN1 OEN0 POL3 POL2 POL1 POL0Base + Write Channel and Control Register Daupdt DACH2 DACH1 DACH0OEDGE3 OEDGE2 OEDGE1 OEDGE0 OPTO3 OPTO2 OPTO1 OPTO0 Base + Write Command Register Dapre Daprld Reset Fiforst AdstartBase + Read Status Register POL ADCH3 ADCH2 ADCH1 ADCH0Base + Write Configuration Register CKSEL1 CKFRQ1 CKFRQ0 Scnint Clken ClkselBase + Read Configuration & Status Register Adbusy Dabusy CKSEL1 CKFRQ1 CKFRQ0 Scnint Clken ClkselBase + Read Fifo Status Register Base + Write Fifo Control RegisterFifoth Fifoen Scanen OVF Fifoth Fifoen ScanenBase + Write Interrupt Control Register Clrt Clrd Clro Clra Tinte Dinte Ointe AinteBase + Read Interrupt Status Register Tint Dint Oint Aint Tinte Dinte Ointe AinteBase + Read/Write Counter/Timer D7 Base + Read/Write Counter/Timer D15Base + Read/Write Counter/Timer D23 Base + Write Counter/Timer Control Register Ctrno Latch Gtdis Gten Ctdis Cten Load CLRCtrno Base + Read/Write Eeprom / TrimDAC Data Register Base + Read/Write Eeprom / TrimDAC Address RegisterBase + Read Calibration Status Register Base + Write Eeprom Access Key RegisterBase + Write Calibration Control Register Base + Read Fpga Revision CodeInput Ranges Analog Input Ranges and ResolutionResolution Single Ended and Differential InputsPerforming AN A/D Conversion Trigger an A/D conversion on the current channel LSB = readbase MSB = readbase+1 Data = MSB * 256 + LSBInput voltage = A/D value / 32768 * Full-scale voltage Clken Clksel D SCAN, FIFO, and Interrupt OperationTrigger Conversion or ScanFifoen Fifoth Scanen Fifo OperationInterrupt Operation Fifoen =Guidelines for Selecting Fifo Use Fifoen and Fifoth Operation TableAinte Fifoen Scanen Analog Output Overview Generating AN Analog Output 12.2 A/D calibration Autocalibration OperationReference Voltages 12.3 D/A CalibrationDigital I/O Operation Procedure for enabling interrupts on selected edges Optocoupler OperationEdge detection assumes OENn = 1 to enable edge detection Polarity and logic readbackRelay Operation COUNTER/TIMER Operation Counter 0 A/D Sample ControlCounter 1 Counting/Totalizing Functions Command Sequences CounterCounter Outpbase+15,0x01 Outpbase+15,0x81 Specifications AutocalibrationGeneral