Analog-to-Digital Input Ranges and Resolution

Overview

Poseidon uses a 16-bit A/D converter. This means that the analog input voltage can be measured to the precision of a 16-bit binary number. The maximum value of a 16-bit binary number is 216 - 1, or 65535, so the full range of numerical values that you can get from a Poseidon analog input channel is 0 - 65535.

The smallest change in input voltage that can be detected is 1/(216), or 1/65536, of the full-scale input range. This smallest change results in an increase or decrease of one in the A/D code, and is referred to as one Least Significant Bit (1 LSB).

Unipolar and Bipolar Inputs

Poseidon can measure both unipolar (positive only) and bipolar (positive and negative) analog voltages. The full-scale input voltage range depends on the Gain, Range, and Polarity bit settings in the Analog Configuration Register at Base+11. In front of the A/D converter is a programmable gain amplifier that multiplies the input signal before it reaches the A/D. This gain circuit has the effect of scaling the input voltage range to match the A/D converter for better resolution. In general, you should select the highest gain you can that will allow the A/D converter to read the full range of voltages over which your input signals will vary. If the gain is too high, the A/D converter will clip at either the high end or low end, and you will not be able to read the full range of voltages on your input signals.

Input Ranges and Resolutions

The table below lists the full-scale input range for each valid analog input configuration. The parameters Polarity, Range and Gain are combined to create the value “Code”, which is the value that you must write to the analog configuration register at Base+11 to get the input range shown. A total of nine different input ranges are possible. Note that the range programming codes 4, 5, 6 and 7 are invalid and that range codes 9 – 11 are equivalent to range codes 0 – 2.

Polarity Range Gain Code Input Range Resolution (1 LSB)
Bipolar 5V 1 0 ± 5V 153mV
Bipolar 5V 2 1 ± 2.5V 76mV
Bipolar 5V 4 2 ± 1.25V 38mV
Bipolar 5V 8 3 ± 0.625V 19mV
Unipolar 5V 1 4 Invalid Setting
Unipolar 5V 2 5 Invalid Setting
Unipolar 5V 4 6 Invalid Setting
Unipolar 5V 8 7 Invalid Setting
Bipolar 10V 1 8 ± 10V 305mV
Bipolar 10V 2 9 ± 5V 153mV
Bipolar 10V 4 10 ± 2.5V 76mV
Bipolar 10V 8 11 ± 1.25V 38mV
Unipolar 10V 1 12 0-10V 153mV
Unipolar 10V 2 13 0-5V 76mV
Unipolar 10V 4 14 0-2.5V 38mV
Unipolar 10V 8 15 0-1.25V 19mV

A/D Conversion Formulas

The 16-bit value returned by the A/D converter is always a twos complement number ranging from -32768 to 32767, regardless of the input range. This is because the input range of the A/D is fixed at ±10V. The input signal is actually magnified and shifted to match this range before it reaches the A/D. For example, for an input range of 0-10V, the signal is first shifted down by 5V to ±5V and then amplified by two to become ±10V.

Therefore, two different formulas are needed to convert the A/D value back to a voltage, one for bipolar ranges, and one for unipolar ranges.

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 code / 32768 * Full-scale input range

Example:

Given, Input range is ±5V and A/D code is 17761.

Therefore,

Input voltage = 17761 / 32768 * 5V = 2.710V.

For a bipolar input range,

1 LSB = 1/32768 * Full-scale voltage.

The table, below, shows the relationship between A/D code and input voltage for a bipolar input range (VFS = Full scale input voltage).

A/D Code Input Voltage Symbolic Formula Input Voltage for ±5V Range
-32768 -VFS -5.0000V
-32767 -VFS + 1 LSB -4.9998V
... ... ...
-1 -1 LSB -0.00015V
0 0 0.0000V
1 +1 LSB 0.00015V
... ... ...
32767 VFS - 1 LSB 4.9998V

Conversion Formula for Unipolar Input Ranges

Input voltage = (A/D code + 32768) / 65536 * Full-scale input range

Example:

Given, Input range is 0-10V and A/D code is 17761.

Therefore,

Input voltage = (17761 + 32768) / 65536 * 10V = 7.7103V.

For a unipolar input range, 1 LSB = 1/65536 * Full-scale voltage.

The following table illustrates 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-10V Range
-32768 0V 0.0000V
-32767 1 LSB (VFS / 65536) 0.153mV
... ... ...
-1 VFS / 2 - 1 LSB 4.99985V
0 VFS / 2 5.0000V
1 VFS / 2 + 1 LSB 5.00015V
... ... ...
32767 VFS - 1 LSB 9.9998V