LTC2991: 14-bit ADC octal I2C voltage, current, and temperature monitor.
The LTC2991 is used to monitor system temperatures, voltages and currents.
Through the I2C serial interface, the eight monitors can individually measure
supply voltages and can be paired for differential measurements of current sense
resistors or temperature sensing transistors. Additional measurements include
internal temperature and internal VCC. The internal 10ppm reference minimizes
the number of supporting components and area required. Selectable address and
configurable functionality give the LTC2991 flexibility to be incorporated in
various systems needing temperature, voltage or current data. The LTC2991 fits
well in systems needing submillivolt voltage resolution, 1% current measurement
and 1 degree Celsius temperature accuracy or any combination of the three.
I2C DATA FORMAT (MSB FIRST);
Data Out:
Byte #1 Byte #2 Byte #3
START SA6 SA5 SA4 SA3 SA2 SA1 SA0 W SACK X X X X C3 C2 C1 C0 SACK D7 D6 D5 D4 D3 D2 D1 D0 SACK STOP
Data In:
Byte #1 Byte #2 Byte #3
START SA6 SA5 SA4 SA3 SA2 SA1 SA0 W SACK X X X X C3 C2 C1 C0 SACK REPEAT START SA6 SA5 SA4 SA3 SA2 SA1 SA0 R SACK
Byte #4 Byte #5
MSB LSB
D15 D14 D13 D12 D11 D10 D9 D8 MACK D7 D6 D5 D4 D3 D2 D1 D0 MNACK STOP
START : I2C Start
REPEAT Start : I2C Repeat Start
STOP : I2C Stop
SACK : I2C Slave Generated Acknowledge (Active Low)
MACK : I2C Master Generated Acknowledge (Active Low)
MNACK : I2C Master Generated Not Acknowledge
SAx : I2C Address
W : I2C Write (0)
R : I2C Read (1)
Cx : Command Code
Dx : Data Bits
X : Don't care
Example Code:
Read single-ended voltage from V1.
// Enable Single-Ended Mode
ack |= LTC2991_register_set_clear_bits(LTC2991_I2C_ADDRESS, LTC2991_CONTROL_V1234_REG, 0x00, LTC2991_V1_V2_DIFFERENTIAL_ENABLE | LTC2991_V1_V2_TEMP_ENABLE);
// Flush one ADC reading in case it is stale. Then, take a new fresh reading.
ack |= LTC2991_adc_read_new_data(LTC2991_I2C_ADDRESS, LTC2991_V1_MSB_REG, &code, &data_valid, LTC2991_TIMEOUT);
voltage = LTC2991_code_to_single_ended_voltage(code, LTC2991_SINGLE_ENDED_lsb); // Converts code to voltage from single-ended lsb
Read current from V3-V4.
resistor = 1; // R_sense across V3-V4 in ohms
// Enable Differential Mode
ack |= LTC2991_register_set_clear_bits(LTC2991_I2C_ADDRESS, LTC2991_CONTROL_V1234_REG, LTC2991_V3_V4_DIFFERENTIAL_ENABLE, LTC2991_V3_V4_TEMP_ENABLE);
// Flush one ADC reading in case it is stale. Then, take a new fresh reading.
ack |= LTC2991_adc_read_new_data(LTC2991_I2C_ADDRESS, LTC2991_V4_MSB_REG, &code, &data_valid, LTC2991_TIMEOUT);
voltage = LTC2991_code_to_differential_voltage(code, LTC2991_DIFFERENTIAL_lsb); // Converts code to voltage from differential lsb
current = voltage / resistor; // Calculates current
Read temperature from diode connected to V7-V8.
// Enable temperature mode.
ack |= LTC2991_register_set_clear_bits(LTC2991_I2C_ADDRESS, LTC2991_CONTROL_V5678_REG, LTC2991_V7_V8_TEMP_ENABLE, 0x00);
// Flush one ADC reading in case it is stale. Then, take a new fresh reading.
ack |= LTC2991_adc_read_new_data(LTC2991_I2C_ADDRESS, LTC2991_V7_MSB_REG, &adc_code, &data_valid, LTC2991_TIMEOUT);
// Converts code to temperature from adc code and temperature lsb
temperature = LTC2991_temperature(adc_code, LTC2991_TEMPERATURE_lsb);
http://www.linear.com/product/LTC2991
http://www.linear.com/product/LTC2991#demoboards
Copyright 2018(c) Analog Devices, Inc.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- The use of this software may or may not infringe the patent rights of one or more patent holders. This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
- Use of the software either in source or binary form, must be run on or directly connected to an Analog Devices Inc. component.
THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Library Header File for LTC2991: 14-bit Octal I2C Voltage, Current, and Temperature Monitor
Definition in file LTC2991.h.
|
int8_t | LTC2991_adc_read (uint8_t i2c_address, uint8_t msb_register_address, int16_t *adc_code, int8_t *data_valid) |
| Reads a 14-bit adc_code from LTC2991. More...
|
|
int8_t | LTC2991_adc_read_timeout (uint8_t i2c_address, uint8_t msb_register_address, int16_t *adc_code, int8_t *data_valid, uint16_t timeout, uint8_t status_bit) |
| Reads a 14-bit adc_code from the LTC2991 but enforces a maximum timeout. More...
|
|
int8_t | LTC2991_adc_read_new_data (uint8_t i2c_address, uint8_t msb_register_address, int16_t *adc_code, int8_t *data_valid, uint16_t timeout) |
| Reads new data (even after a mode change) by flushing old data and waiting for the data_valid bit to be set. More...
|
|
int8_t | LTC2991_register_read (uint8_t i2c_address, uint8_t register_address, uint8_t *register_data) |
| Reads an 8-bit register from the LTC2991 using the standard repeated start format. More...
|
|
int8_t | LTC2991_register_write (uint8_t i2c_address, uint8_t register_address, uint8_t register_data) |
| Write one byte to an LTC2991 register. More...
|
|
int8_t | LTC2991_register_set_clear_bits (uint8_t i2c_address, uint8_t register_address, uint8_t bits_to_set, uint8_t bits_to_clear) |
| Used to set and clear bits in a control register. More...
|
|
float | LTC2991_code_to_single_ended_voltage (int16_t adc_code, float LTC2991_single_ended_lsb) |
| Calculates the LTC2991 single-ended input voltages. More...
|
|
float | LTC2991_code_to_vcc_voltage (int16_t adc_code, float LTC2991_single_ended_lsb) |
| Calculates the LTC2991 Vcc voltage. More...
|
|
float | LTC2991_code_to_differential_voltage (int16_t adc_code, float LTC2991_differential_lsb) |
| Calculates the LTC2991 differential input voltage. More...
|
|
float | LTC2991_temperature (int16_t adc_code, float LTC2991_temperature_lsb, boolean unit) |
| Calculates the LTC2991 temperature. More...
|
|
float | LTC2991_code_to_diode_voltage (int16_t adc_code, float LTC2991_diode_voltage_lsb) |
| Calcultates the LTC2991 diode voltage. More...
|
|
|
|
#define | LTC2991_I2C_ADDRESS 0x48 |
| I2C address of the LTC2991. More...
|
|
#define | LTC2991_I2C_GLOBAL_ADDRESS 0x77 |
| LTC2991 Global I2C Address. More...
|
|
|
#define | LTC2991_STATUS_LOW_REG 0x00 |
| Data_Valid Bits(V1 Through V8) More...
|
|
#define | LTC2991_STATUS_HIGH_REG 0x01 |
| Data_valid bits. More...
|
|
#define | LTC2991_CHANNEL_ENABLE_REG 0x01 |
| Channel Enable, Vcc, T_internal Conversion Status, Trigger. More...
|
|
#define | LTC2991_CONTROL_V1234_REG 0x06 |
| V1, V2, V3, and V4 Control Register. More...
|
|
#define | LTC2991_CONTROL_V5678_REG 0x07 |
| V5, V6, V7, AND V8 Control Register. More...
|
|
#define | LTC2991_CONTROL_PWM_Tinternal_REG 0x08 |
| PWM Threshold and T_internal Control Register. More...
|
|
#define | LTC2991_PWM_THRESHOLD_MSB_REG 0x09 |
| PWM Threshold. More...
|
|
#define | LTC2991_V1_MSB_REG 0x0A |
| V1, or T_R1 T MSB. More...
|
|
#define | LTC2991_V1_LSB_REG 0x0B |
| V1, or T_R1 T LSB. More...
|
|
#define | LTC2991_V2_MSB_REG 0x0C |
| V2, V1-V2, or T_R2 Voltage MSB. More...
|
|
#define | LTC2991_V2_LSB_REG 0x0D |
| V2, V1-V2, or T_R2 Voltage LSB. More...
|
|
#define | LTC2991_V3_MSB_REG 0x0E |
| V3, or T_R2 T MSB. More...
|
|
#define | LTC2991_V3_LSB_REG 0x0F |
| V3, or T_R2 T LSB. More...
|
|
#define | LTC2991_V4_MSB_REG 0x10 |
| V4, V3-V4, or T_R2 Voltage MSB. More...
|
|
#define | LTC2991_V4_LSB_REG 0x11 |
| V4, V3-V4, or T_R2 Voltage LSB. More...
|
|
#define | LTC2991_V5_MSB_REG 0x12 |
| V5, or T_R3 T MSB. More...
|
|
#define | LTC2991_V5_LSB_REG 0x13 |
| V5, or T_R3 T LSB. More...
|
|
#define | LTC2991_V6_MSB_REG 0x14 |
| V6, V5-V6, or T_R3 Voltage MSB. More...
|
|
#define | LTC2991_V6_LSB_REG 0x15 |
| V6, V5-V6, or T_R3 Voltage LSB. More...
|
|
#define | LTC2991_V7_MSB_REG 0x16 |
| V7, or T_R4 T MSB. More...
|
|
#define | LTC2991_V7_LSB_REG 0x17 |
| V7, or T_R4 T LSB. More...
|
|
#define | LTC2991_V8_MSB_REG 0x18 |
| V8, V7-V8, or T_R4 Voltage MSB. More...
|
|
#define | LTC2991_V8_LSB_REG 0x19 |
| V8, V7-V8, or T_R4 Voltage LSB. More...
|
|
#define | LTC2991_T_Internal_MSB_REG 0x1A |
| T_Internal MSB. More...
|
|
#define | LTC2991_T_Internal_LSB_REG 0x1B |
| T_Internal LSB. More...
|
|
#define | LTC2991_Vcc_MSB_REG 0x1C |
| Vcc MSB. More...
|
|
#define | LTC2991_Vcc_LSB_REG 0x1D |
| Vcc LSB. More...
|
|
|
Bitwise OR settings, and write to LTC2991_CHANNEL_ENABLE_REG to configure settings.
Bitwise AND with value read from LTC2991_CHANNEL_ENABLE_REG to determine present setting.
|
#define | LTC2991_V7_V8_TR4_ENABLE 0x80 |
| Enable V7-V8 measurements, including TR4 temperature. More...
|
|
#define | LTC2991_V5_V6_TR3_ENABLE 0x40 |
| Enable V5-V6 measurements, including TR3 temperature. More...
|
|
#define | LTC2991_V3_V4_TR2_ENABLE 0x20 |
| Enable V3-V4 measurements, including TR2 temperature. More...
|
|
#define | LTC2991_V1_V2_TR1_ENABLE 0x10 |
| Enable V1-V2 measurements, including TR1 temperature. More...
|
|
#define | LTC2991_VCC_TINTERNAL_ENABLE 0x08 |
| Enable Vcc internal voltage measurement. More...
|
|
#define | LTC2991_ENABLE_ALL_CHANNELS 0xF8 |
| Use to enable all LTC2991 channels. More...
|
|
#define | LTC2991_BUSY 0x04 |
| LTC2991 Busy Bit. More...
|
|
|
Bitwise OR settings, and write to LTC2991_CONTROL_V1234_REG to configure settings.
Bitwise AND with value read from LTC2991_CONTROL_V1234_REG to determine present setting.
|
#define | LTC2991_V3_V4_FILTER_ENABLE 0x80 |
| Enable filters on V3-V4. More...
|
|
#define | LTC2991_V3_V4_KELVIN_ENABLE 0x40 |
| Enable V3-V4 for Kelvin. More...
|
|
#define | LTC2991_V3_V4_TEMP_ENABLE 0x20 |
| Enable V3-V4 temperature mode. More...
|
|
#define | LTC2991_V3_V4_DIFFERENTIAL_ENABLE 0x10 |
| Enable V3-V4 differential mode. More...
|
|
#define | LTC2991_V1_V2_FILTER_ENABLE 0x08 |
| Enable filters on V1-V2. More...
|
|
#define | LTC2991_V1_V2_KELVIN_ENABLE 0x04 |
| Enable V1-V2 for Kelvin. More...
|
|
#define | LTC2991_V1_V2_TEMP_ENABLE 0x02 |
| Enable V1-V2 temperature mode. More...
|
|
#define | LTC2991_V1_V2_DIFFERENTIAL_ENABLE 0x01 |
| Enable V1-V2 differential mode. More...
|
|
|
Bitwise OR settings, and write to LTC2991_CONTROL_V5678_REG to configure settings.
Bitwise AND with value read from LTC2991_CONTROL_V5678_REG to determine present setting.
|
#define | LTC2991_V7_V8_FILTER_ENABLE 0x80 |
| Enable filters on V7-V8. More...
|
|
#define | LTC2991_V7_V8_KELVIN_ENABLE 0x40 |
| Enable V7-V8 for Kelvin. More...
|
|
#define | LTC2991_V7_V8_TEMP_ENABLE 0x20 |
| Enable V7-V8 temperature mode. More...
|
|
#define | LTC2991_V7_V8_DIFFERENTIAL_ENABLE 0x10 |
| Enable V7-V8 differential mode. More...
|
|
#define | LTC2991_V5_V6_FILTER_ENABLE 0x08 |
| Enable filters on V5-V6. More...
|
|
#define | LTC2991_V5_V6_KELVIN_ENABLE 0x04 |
| Enable V5-V6 for Kelvin. More...
|
|
#define | LTC2991_V5_V6_TEMP_ENABLE 0x02 |
| Enable V5-V6 temperature mode. More...
|
|
#define | LTC2991_V5_V6_DIFFERENTIAL_ENABLE 0x01 |
| Enable V5-V6 differential mode. More...
|
|
|
Bitwise OR settings, and write to LTC2991_CONTROL_PWM_Tinternal_REG to configure settings.
Bitwise AND with value read from LTC2991_CONTROL_PWM_Tinternal_REG to determine present setting.
|
#define | LTC2991_PWM_0 0x80 |
| PWM threshold Least Significant Bit. More...
|
|
#define | LTC2991_PWM_INVERT 0x40 |
| Invert PWM. More...
|
|
#define | LTC2991_PWM_ENABLE 0x20 |
| Enable PWM. More...
|
|
#define | LTC2991_REPEAT_MODE 0x10 |
| Enable Repeated Aquisition Mode. More...
|
|
#define | LTC2991_INT_FILTER_ENABLE 0x08 |
| Enable Internal Temperature Filter. More...
|
|
#define | LTC2991_INT_KELVIN_ENABLE 0x04 |
| Enable internal temperature for Kelvin. More...
|
|