![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
LTC4151: High Voltage I2C Current and Voltage Monitor. More...
LTC4151: High Voltage I2C Current and Voltage Monitor.
The LTC4151 is a high side power monitor that operates over a wide voltage range of 7V to 80V. In default operation mode, the onboard 12-bit ADC continuously measures high side current, input voltage and an external voltage. Data is reported through the I2C interface when polled by a host. The LTC4151 can also perform on-demand measurement in a snapshot mode. The LTC4151 features a dedicated shutdown pin to reduce power consumption. The LTC4151-1/LTC4151-2 feature split I2C data pins to drive opto-isolators. The data out on the LTC4151-1 is inverted while that on the LTC4151-2 is not. 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 MSB LSB 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 D15 D14 D13 D12 D11 D10 D0 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:
http://www.linear.com/product/LTC4151
http://www.linear.com/product/LTC4151#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:
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 LTC4151: High Voltage I2C Current and Voltage Monitor
Definition in file LTC4151.h.
Go to the source code of this file.
Functions | |
int8_t | LTC4151_write (uint8_t i2c_address, uint8_t adc_command, uint8_t code) |
Write one byte to an LTC4151 register. More... | |
int8_t | LTC4151_read_12_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code) |
Reads a 12-bit value from LTC4151. More... | |
float | LTC4151_code_to_sense_current (uint16_t adc_code, float resistor, float LTC4151_sense_lsb) |
Calculates the LTC4151 sense current in Amps given "resistor" value in ohms and "LTC4151_sense_lsb" LSB weight in volts. More... | |
float | LTC4151_code_to_vin_voltage (uint16_t adc_code, float LTC4151_vin_lsb) |
Calculates the LTC4151 V_IN voltage given "LTC_vin_lsb" LSB weight in volts. More... | |
float | LTC4151_code_to_ADIN_voltage (uint16_t adc_code, float LTC4151_adin_lsb) |
Calculates the LTC4151 ADIN voltage in mV given "LTC4151_adin_lsb" LSB weight in mV. More... | |
Macros | |||||||||||||||||||||||||||||||||||||||||||||
I2C_Addresses | |||||||||||||||||||||||||||||||||||||||||||||
Address Choices: To choose an address, comment out all options except the configuration on the demo board.
| |||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_I2C_ADDRESS 0x6F | ||||||||||||||||||||||||||||||||||||||||||||
REGISTERS | |||||||||||||||||||||||||||||||||||||||||||||
Note: Register 0x07 is Reserved.
| |||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_SENSE_MSB_REG 0x00 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_SENSE_LSB_REG 0x01 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_VIN_MSB_REG 0x02 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_VIN_LSB_REG 0x03 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_ADIN_MSB_REG 0x04 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_ADIN_LSB_REG 0x05 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_CONTROL_REG 0x06 | ||||||||||||||||||||||||||||||||||||||||||||
LTC4151 Commands | |||||||||||||||||||||||||||||||||||||||||||||
Bitwise AND with channel register, and write to LTC4151_CONTROL_REG.
| |||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_SENSE_CHANNEL_REG 0x00 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_VIN_CHANNEL_REG 0x20 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_ADIN_CHANNEL_REG 0x40 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_CONTINUOUS_MODE 0x00 | ||||||||||||||||||||||||||||||||||||||||||||
#define | LTC4151_SNAPSHOT_MODE 0x80 | ||||||||||||||||||||||||||||||||||||||||||||
float LTC4151_code_to_ADIN_voltage | ( | uint16_t | adc_code, |
float | LTC4151_adin_lsb | ||
) |
Calculates the LTC4151 ADIN voltage in mV given "LTC4151_adin_lsb" LSB weight in mV.
adc_code | Code read from the adc (from a function such as LTC4151_read_12_bits) |
LTC4151_adin_lsb | ADIN voltage LSB weight. |
Definition at line 117 of file LTC4151.cpp.
float LTC4151_code_to_sense_current | ( | uint16_t | adc_code, |
float | resistor, | ||
float | LTC4151_sense_lsb | ||
) |
Calculates the LTC4151 sense current in Amps given "resistor" value in ohms and "LTC4151_sense_lsb" LSB weight in volts.
adc_code | Code read from the adc (from a function such as LTC4151_read_12_bits) |
resistor | The sense resistor value |
LTC4151_sense_lsb | Current LSB weight. |
Definition at line 100 of file LTC4151.cpp.
float LTC4151_code_to_vin_voltage | ( | uint16_t | adc_code, |
float | LTC4151_vin_lsb | ||
) |
Calculates the LTC4151 V_IN voltage given "LTC_vin_lsb" LSB weight in volts.
adc_code | Code read from the adc (from a function such as LTC4151_read_12_bits) |
LTC4151_vin_lsb | Voltage LSB weight. |
Definition at line 109 of file LTC4151.cpp.
int8_t LTC4151_read_12_bits | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint16_t * | adc_code | ||
) |
Reads a 12-bit value from LTC4151.
i2c_address | I2C address of the LTC4151. Configured by tying the ADR0 and ADR1 pins high or low. See Table 1 of datasheet. |
adc_command | The "command byte" for the LTC4151. |
adc_code | Returns 12-bit value read from the adc |
Definition at line 83 of file LTC4151.cpp.
int8_t LTC4151_write | ( | uint8_t | i2c_address, |
uint8_t | adc_command, | ||
uint8_t | code | ||
) |
Write one byte to an LTC4151 register.
i2c_address | I2C address of the LTC4151. Configured by tying the ADR0 and ADR1 pins high or low. See Table 1 of datasheet. |
adc_command | The "command byte" for the LTC4151. |
code | Value that will be written to the register. |
Definition at line 73 of file LTC4151.cpp.