Brody Kellish / ltc2991_lib

Dependents:   ece495_firmware

Fork of ltc2991_test by Logan Rooper

Embed: (wiki syntax)

« Back to documentation index

LTC2991.h File Reference

LTC2991.h File Reference

Go to the source code of this file.

Variables

const float LTC2991_SINGLE_ENDED_lsb = 3.05176E-04
 Typical single-ended LSB weight in volts.
const float LTC2991_DIFFERENTIAL_lsb = 1.90735E-05
 Typical differential LSB weight in volts.
const float LTC2991_VCC_lsb = 3.05176E-04
 Typical VCC LSB weight in volts.
const float LTC2991_TEMPERATURE_lsb = 0.0625
 Typical temperature LSB weight in degrees Celsius (and Kelvin).
const float LTC2991_DIODE_VOLTAGE_lsb = 3.815E-05
 Typical remote diode LSB weight in volts.

Detailed Description

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

REVISION HISTORY

Revision:
3659
Date:
2015-07-01 10:19:20 -0700 (Wed, 01 Jul 2015)

Copyright (c) 2013, Linear Technology Corp.(LTC) All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. 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.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Linear Technology Corp.

The Linear Technology Linduino is not affiliated with the official Arduino team. However, the Linduino is only possible because of the Arduino team's commitment to the open-source community. Please, visit http://www.arduino.cc and http://store.arduino.cc , and consider a purchase that will help fund their ongoing work.

Library Header File for LTC2991: 14-bit Octal I2C Voltage, Current, and Temperature Monitor

Definition in file LTC2991.h.


Variable Documentation

const float LTC2991_DIFFERENTIAL_lsb = 1.90735E-05

Typical differential LSB weight in volts.

Definition at line 142 of file LTC2991.h.

const float LTC2991_DIODE_VOLTAGE_lsb = 3.815E-05

Typical remote diode LSB weight in volts.

Used to readback diode voltage when in temperature measurement mode.

Definition at line 150 of file LTC2991.h.

const float LTC2991_SINGLE_ENDED_lsb = 3.05176E-04

Typical single-ended LSB weight in volts.

Definition at line 140 of file LTC2991.h.

const float LTC2991_TEMPERATURE_lsb = 0.0625

Typical temperature LSB weight in degrees Celsius (and Kelvin).

Used for internal temperature as well as remote diode temperature measurements.

Definition at line 147 of file LTC2991.h.

const float LTC2991_VCC_lsb = 3.05176E-04

Typical VCC LSB weight in volts.

Definition at line 144 of file LTC2991.h.