The T8 uses calibration constants to convert between the binary, used by hardware, and easier to understand units, typically volts.
Generally, users do not need to think about the calibration constants. The T8 automatically applies the calibration before reporting results. A couple exceptions are stream-mode and when the T8 has been instructed to return binary values. When using stream-mode, the calibration constants will be applied by the LJM driver.
The calibration constants are calculated as part of our new-unit test process. Those constants are then stored in the device's Internal Flash memory. The normal flash interface can be used to read the constants: (Internal Flash). Within flash, the calibration constants begin at memory address 0x687000, or in decimal format d6844416. The structure (location) of each calibration value can be seen in the C code snippet below.
T8 Calibration Values
typedef struct{
float PSlope;
float NSlope;
float Center;
float Offset;
}Cal_Set;
typedef struct{
uint32_t code;
uint32_t reserved[7];
uint32_t ain_type[8]; // 32 Contains type information for AINs.
Cal_Set ain[8][11]; // 64 Calibration data for analog inputs.
Cal_Set temp[8]; // 1472 Calibration data for temp sensors.
Cal_Set VS; // 1600 Calibration data for VS measurement.
Cal_Set IS; // 1616 Calibration data for IS measurement.
Cal_Set dac[2]; // 1632 Calibration data for DACs
float SecOSC_Freq; // 1664
}DeviceCalibrationT8;
The full size of the calibration section is 1668 bytes.
There are distinct sets of positive slope (PSlope), negative slope (NSlope), Center, and Offset values for each measurement.
For a given analog input x:
-
ain[x][0] for range ±11.000
-
ain[x][1] for range ±9.768
-
ain[x][2] for range ±4.884
-
ain[x][3] for range ±2.442
-
ain[x][4] for range ±1.221
-
ain[x][5] for range ±0.611
-
ain[x][6] for range ±0.305
-
ain[x][7] for range ±0.153
-
ain[x][8] for range ±0.076
-
ain[x][9] for range ±0.038
-
ain[x][10] for range ±0.019
Nominal Calibration Values
Analog inputs
Each AIN has 11 Cal_Sets, the nominal values for which are below:
{PSlope, NSlope, Center, Offset},
{2.328872681E-006, -2.328872681E-006, 8388608, -19.536},
{1.164436340E-006, -1.164436340E-006, 8388608, -9.768},
{5.822181702E-007, -5.822181702E-007, 8388608, -4.884},
{2.911090851E-007, -2.911090851E-007, 8388608, -2.442},
{1.455545425E-007, -1.455545425E-007, 8388608, -1.221},
{7.277727127E-008, -7.277727127E-008, 8388608, -0.611},
{3.638863564E-008, -3.638863564E-008, 8388608, -0.305},
{1.819431782E-008, -1.819431782E-008, 8388608, -0.153},
{9.097158909E-009, -9.097158909E-009, 8388608, -0.076},
{4.548579454E-009, -4.548579454E-009, 8388608, -0.038},
{2.274289727E-009, -2.274289727E-009, 8388608, -0.019}
Temperature Sensors
{ -91.503268, 0, 0, 192.156863 };
Analog Outputs
{ 6243.64, 6243.64, 0, 800 };
Interval Converter
Vs { 0, 0, 0, 0 };
Is { 0, 0, 0, 0 };
24-bit Calibration Conversion
All calibration values on the device that are related to binary conversions are stored as 16-bit equivalent values. T8 AIN return 24-bit ADC samples. The 16-bit equivalent AIN calibrations should be scaled to 24-bit values for use. To scale a 16-bit equivalent calibration value with units of bits to a 24-bit value, left shift the value by 8 bits. This is the same as multiplying the 16-bit value by 256.
-
AIN Center calibration values have units of
bits.
24-bit Center Calibration = 16-bit Center Calibration * 256 -
AIN Slope calibration values have units of
volts/bit.
24-bit Slope Calibration = 16-bit Slope Calibration / 256
Example
The nominal (16-bit equivalent) AIN calibrations at ±11V range are as follows:
{2.328872681E-006, -2.328872681E-006, 8388608, -19.536}
The corresponding 24-bit calibrations are as follows:
{9.09715891015625E-009, -9.09715891015625E-009, 2147483648, -19.536}
Say you read AIN0_BINARY using the ±11V range. The logic you would use to convert the binary to volts is as follows (for demonstration purposes only, don’t use this exact code snippet):
if(AIN0_BINARY < DeviceCalibrationT8.ain[0][0])
{
// Negative AIN voltage
volts = (DeviceCalibrationT8.ain[0][0].Center - AIN0_BINARY) * \
DeviceCalibrationT8.ain[0][0].NSlope;
}
else
{
// Positive AIN voltage
volts = (AIN0_BINARY - DeviceCalibrationT8.ain[0][0].Center) * \
DeviceCalibrationT8.ain[0][0].PSlope;
}
The following snippet uses the same logic, but applies the nominal calibrations as outlined above (for demonstration purposes only, don’t use this exact code snippet):
if(AIN0_BINARY < 2147483648)
{
// Negative AIN voltage
volts = (2147483648 - AIN0_BINARY) * \
-9.09715891015625E-009;
}
else
{
// Positive AIN voltage
volts = (AIN0_BINARY - 2147483648) * \
9.09715891015625E-009;
}
Temperature Sensor Calibrations
TEMPERATURE# binary values, which are acquired when streaming TEMPERATURE# registers or reading TEMPERATURE#_BINARY registers, represent the 24-bit temperature sensor voltage measurement acquired from a corresponding ADC. The voltages are acquired using the ±2.4V range on the corresponding AIN ADC. The ADC for AIN0 is used to measure the TEMPERATURE0 sensor voltage, the ADC for AIN1 is used to measure the TEMPERATURE1 sensor voltage, etc.
Stream only: 16-bit binary values are returned from the device when streaming TEMPERATURE# registers. If you stream using LJM, the values are automatically converted to calibrated temperature readings for you. If you wish to convert the binary value to voltage directly, the binary must be scaled to a 24-bit representation by multiplying the 16-bit value by 256.
The temperature sensor calibrations are used to convert temperature sensor voltage to temperature. Only the PSlope and Offset calibration constants are used.
-
Temperature sensor PSlope calibration values have units of
°C/volt. -
Temperature sensor Offset calibration values have units of
°C.
Note that reading the TEMPERATURE# registers via command-response mode communications will automatically return a calibrated temperature value.
Example
To convert TEMPERATURE0_BINARY to voltage, apply the positive value AIN0 calibration for the ±2.4V range. The calibration values in DeviceCalibrationT8 below refer to the 24-bit calibration values:
Temp0Volts = (TEMPERATURE0_BINARY - DeviceCalibrationT8.ain[0][3].Center) * DeviceCalibrationT8.ain[0][3].PSlope
To convert the TEMPERATURE0 sensor voltage to temperature, apply the TEMPERATURE0 calibrations as follows:
Temperature0 (°C) = Temp0Volts * DeviceCalibrationT8.temp[0].PSlope + DeviceCalibrationT8.temp[0].Offset