Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board

LTC4261: Negative Voltage Hot Swap Controller with ADC and I2C Monitoring. More...

Detailed Description

LTC4261: Negative Voltage Hot Swap Controller with ADC and I2C Monitoring.

The LTC4261/LTC4261-2 negative voltage Hot SwapTM controller allows a board
to be safely inserted and removed from a live backplane. Using an external
N-channel pass transistor, the board supply voltage can be ramped at an
adjustable rate. The devices feature independently adjustable inrush current
and overcurrent limits to minimize stresses on the pass transistor during
start-up, input step and output short conditions. The LTC4261 defaults
to latch-off while the LTC4261-2 defaults to auto-retry on overcurrent faults.

I2C DATA FORMAT (MSB FIRST):

Data Out:
Byte #1                                    Byte #2                       Byte #3

START  SA6 SA5 SA4 SA3 SA2 SA1 SA0 W SACK  C7  C6 C5 C4 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  C7  C6  C5 C4 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
SAx         : I2C Address
SACK        : I2C Slave Generated Acknowledge (Active Low)
MACK        : I2C Master Generated Acknowledge (Active Low)
MNACK       : I2C Master Generated Not Acknowledge
W           : I2C Write (0)
R           : I2C Read  (1)
Cx          : Command Code
Dx          : Data Bits
X           : Don't care

Example Code:

Read ADIN and Current Values

    ack |= LTC4261_read_10_bits(LTC4261_I2C_Address, LTC4261_SENSE_MSB_REG, &current_code);   // reads current sense ADC
    ack |= LTC4261_read_10_bits(LTC4261_I2C_Address, LTC4261_ADIN_MSB_REG, &adin_code);       // reads ADIN ADC
    ack |= LTC4261_read_10_bits(LTC4261_I2C_Address, LTC4261_ADIN2_MSB_REG, &adin2_code);     // reads ADIN2 ADC

    //convert codes to voltage and current values
    current = LTC4261_code_to_current(current_code, resitor, current_lsb);
    adin_voltage = LTC4261_ADIN_code_to_voltage(adin_code, adin_lsb, resisive_ratio);
    adin2_voltage = LTC4261_ADIN_code_to_voltage(adin2_code, adin_lsb, resisive_ratio);

http://www.linear.com/product/LTC4261

http://www.linear.com/product/LTC4261#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.

Header for LTC4261: Negative Voltage Hot Swap Controllers with ADC and I2C Monitoring

Definition in file LTC4261.h.

Go to the source code of this file.

Functions

int8_t LTC4261_write (uint8_t i2c_address, uint8_t command, uint8_t code)
 Write an 8-bit code to the LTC4261. More...
 
int8_t LTC4261_read (uint8_t i2c_address, uint8_t command, uint8_t *code)
 Reads an 8-bit adc_code from LTC4261. More...
 
int8_t LTC4261_read_10_bits (uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code)
 Reads a 10-bit adc_code from LTC4261. More...
 
int8_t LTC4261_ARA (uint8_t alert_response_address, uint8_t *i2c_address)
 SMBus Alert Response Protocol: Sends an alert response command and releases /ALERT pin. More...
 
float LTC4261_ADIN_code_to_voltage (uint16_t adc_code, float LTC4261_ADIN_lsb, float resistor_divider_ratio)
 Calculate the LTC4261 ADIN voltage. More...
 
float LTC4261_code_to_current (uint16_t adc_code, float resistor, float LTC4261_DELTA_SENSE_lsb)
 Calculate the LTC4261 current with a sense resistor. More...
 

Macros

LTC4261 Address Assignment
#define LTC4261_I2C_Address   0x10
 
#define LTC4261_I2C_ALERT_RESPONSE   0x0C
 
#define LTC4261_I2C_MASS_WRITE   0x3E
 
LTC4261 Register Addresses
#define LTC4261_STATUS_REG   0x00
 
#define LTC4261_FAULT_REG   0x01
 
#define LTC4261_ALERT_REG   0x02
 
#define LTC4261_CONTROL_REG   0x03
 
#define LTC4261_SENSE_MSB_REG   0x04
 
#define LTC4261_SENSE_LSB_REG   0x05
 
#define LTC4261_ADIN2_MSB_REG   0x06
 
#define LTC4261_ADIN2_LSB_REG   0x07
 
#define LTC4261_ADIN_MSB_REG   0x08
 
#define LTC4261_ADIN_LSB_REG   0x09
 
Command Codes
#define LTC4261_PGIO_POWER_GOODX   0x00
 
#define LTC4261_PGIO_POWER_GOOD   0x80
 
#define LTC4261_PGIO_GENERAL_PURPOSE_OUTPUT   0x40
 
#define LTC4261_PGIO_GENERAL_PURPOSE_INPUT   0xC0
 
#define LTC4261_TEST_MODE_ENABLE   0x20
 
#define LTC4261_TEST_MODE_DISABLE   0xDF
 
#define LTC4261_POWER_BAD_AUTO_RETRY_ENABLE   0x10
 
#define LTC4261_POWER_BAD_AUTO_RETRY_DISABLE   0xEF
 
#define LTC4261_FET_ON   0x08
 
#define LTC4261_FET_OFF   0xF7
 
#define LTC4261_OVERCURRENT_AUTO_RETRY_ENABLE   0x04
 
#define LTC4261_OVERCURRENT_AUTO_RETRY_DISABLE   0xFB
 
#define LTC4261_UNDERVOLTAGE_AUTO_RETRY_ENABLE   0x02
 
#define LTC4261_UNDERVOLTAGE_AUTO_RETRY_DISABLE   0xFD
 
#define LTC4261_OVERVOLTAGE_AUTO_RETRY_ENABLE   0x01
 
#define LTC4261_OVERVOLTAGE_AUTO_RETRY_DISABLE   0xFE
 
Fault Codes
#define LTC4261_EXTERNAL_FAULT   0x80
 
#define LTC4261_PGIO_INPUT_HIGH   0x40
 
#define LTC4261_FET_SHORT_FAULT   0x20
 
#define LTC4261_EN_STATE_CHANGE   0x10
 
#define LTC4261_POWER_BAD_FAULT   0x08
 
#define LTC4261_OVERCURRENT_FAULT   0x04
 
#define LTC4261_UNDERVOLTAGE_FAULT   0x02
 
#define LTC4261_OVERVOLTAGE_FAULT   0x01
 
Alert Codes
#define LTC4261_EXTERNAL_FAULT_ENABLE   0x80
 
#define LTC4261_EXTERNAL_FAULT_DISABLE   0x7F
 
#define LTC4261_PGIO_OUTPUT_ENABLE   0x40
 
#define LTC4261_PGIO_OUTPUT_DISABLE   0xBF
 
#define LTC4261_FET_SHORT_ENABLE   0x20
 
#define LTC4261_FET_SHORT_DISABLE   0xDF
 
#define LTC4261_EN_STATE_ENABLE   0x10
 
#define LTC4261_EN_STATE_DISABLE   0xEF
 
#define LTC4261_POWER_BAD_ENABLE   0x08
 
#define LTC4261_POWER_BAD_DISABLE   0xF7
 
#define LTC4261_OVERCURRENT_ENABLE   0x04
 
#define LTC4261_OVERCURRENT_DISABLE   0xFB
 
#define LTC4261_UNDERVOLTAGE_ENABLE   0x02
 
#define LTC4261_UNDERVOLTAGE_DISABLE   0xFD
 
#define LTC4261_OVERVOLTAGE_ENABLE   0x01
 
#define LTC4261_OVERVOLTAGE_DISABLE   0xFE
 

Function Documentation

◆ LTC4261_ADIN_code_to_voltage()

float LTC4261_ADIN_code_to_voltage ( uint16_t  adc_code,
float  LTC4261_ADIN_lsb,
float  resistor_divider_ratio 
)

Calculate the LTC4261 ADIN voltage.

Returns
Returns the ADIN Voltage in Volts
Parameters
adc_codeThe ADC value
LTC4261_ADIN_lsbADIN lsb weight
resistor_divider_ratiothe ratio that the voltages have been divided down

Definition at line 110 of file LTC4261.cpp.

◆ LTC4261_ARA()

int8_t LTC4261_ARA ( uint8_t  alert_response_address,
uint8_t *  i2c_address 
)

SMBus Alert Response Protocol: Sends an alert response command and releases /ALERT pin.

LTC4261 responds with its address

Returns
The function returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
alert_response_addressthe Alert Response Address on the I2C bus
i2c_addressthe address of the alert source

Definition at line 102 of file LTC4261.cpp.

◆ LTC4261_code_to_current()

float LTC4261_code_to_current ( uint16_t  adc_code,
float  resistor,
float  LTC4261_DELTA_SENSE_lsb 
)

Calculate the LTC4261 current with a sense resistor.

Returns
The LTC4261 sense current
Parameters
adc_codeThe ADC value
resistorThe resistor value
LTC4261_DELTA_SENSE_lsbDelta sense lsb weight

Definition at line 119 of file LTC4261.cpp.

◆ LTC4261_read()

int8_t LTC4261_read ( uint8_t  i2c_address,
uint8_t  command,
uint8_t *  code 
)

Reads an 8-bit adc_code from LTC4261.

Returns
The function returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressI2C Address for the LTC4261
commandThe "command byte" for the LTC4261 that corresponds to register address
codeValue that will be read from the register

Definition at line 82 of file LTC4261.cpp.

◆ LTC4261_read_10_bits()

int8_t LTC4261_read_10_bits ( uint8_t  i2c_address,
uint8_t  adc_command,
uint16_t *  adc_code 
)

Reads a 10-bit adc_code from LTC4261.

Returns
The function returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressI2C Address for the LTC4261
adc_commandThe "command byte" for the LTC4261 that corresponds to register address
adc_codeValue that will be read from the register.

Definition at line 91 of file LTC4261.cpp.

◆ LTC4261_write()

int8_t LTC4261_write ( uint8_t  i2c_address,
uint8_t  command,
uint8_t  code 
)

Write an 8-bit code to the LTC4261.

Returns
The function returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
Parameters
i2c_addressI2C Address for the LTC4261
commandThe "command byte" for the LTC4261 that corresponds to register address
codeValue that will be written to the register

Definition at line 73 of file LTC4261.cpp.

Macro Definition Documentation

◆ LTC4261_ADIN2_LSB_REG

#define LTC4261_ADIN2_LSB_REG   0x07

Definition at line 131 of file LTC4261.h.

◆ LTC4261_ADIN2_MSB_REG

#define LTC4261_ADIN2_MSB_REG   0x06

Definition at line 130 of file LTC4261.h.

◆ LTC4261_ADIN_LSB_REG

#define LTC4261_ADIN_LSB_REG   0x09

Definition at line 133 of file LTC4261.h.

◆ LTC4261_ADIN_MSB_REG

#define LTC4261_ADIN_MSB_REG   0x08

Definition at line 132 of file LTC4261.h.

◆ LTC4261_ALERT_REG

#define LTC4261_ALERT_REG   0x02

Definition at line 126 of file LTC4261.h.

◆ LTC4261_CONTROL_REG

#define LTC4261_CONTROL_REG   0x03

Definition at line 127 of file LTC4261.h.

◆ LTC4261_EN_STATE_CHANGE

#define LTC4261_EN_STATE_CHANGE   0x10

Definition at line 167 of file LTC4261.h.

◆ LTC4261_EN_STATE_DISABLE

#define LTC4261_EN_STATE_DISABLE   0xEF

Definition at line 183 of file LTC4261.h.

◆ LTC4261_EN_STATE_ENABLE

#define LTC4261_EN_STATE_ENABLE   0x10

Definition at line 182 of file LTC4261.h.

◆ LTC4261_EXTERNAL_FAULT

#define LTC4261_EXTERNAL_FAULT   0x80

Definition at line 164 of file LTC4261.h.

◆ LTC4261_EXTERNAL_FAULT_DISABLE

#define LTC4261_EXTERNAL_FAULT_DISABLE   0x7F

Definition at line 177 of file LTC4261.h.

◆ LTC4261_EXTERNAL_FAULT_ENABLE

#define LTC4261_EXTERNAL_FAULT_ENABLE   0x80

Definition at line 176 of file LTC4261.h.

◆ LTC4261_FAULT_REG

#define LTC4261_FAULT_REG   0x01

Definition at line 125 of file LTC4261.h.

◆ LTC4261_FET_OFF

#define LTC4261_FET_OFF   0xF7

Definition at line 150 of file LTC4261.h.

◆ LTC4261_FET_ON

#define LTC4261_FET_ON   0x08

Definition at line 149 of file LTC4261.h.

◆ LTC4261_FET_SHORT_DISABLE

#define LTC4261_FET_SHORT_DISABLE   0xDF

Definition at line 181 of file LTC4261.h.

◆ LTC4261_FET_SHORT_ENABLE

#define LTC4261_FET_SHORT_ENABLE   0x20

Definition at line 180 of file LTC4261.h.

◆ LTC4261_FET_SHORT_FAULT

#define LTC4261_FET_SHORT_FAULT   0x20

Definition at line 166 of file LTC4261.h.

◆ LTC4261_I2C_Address

#define LTC4261_I2C_Address   0x10

Definition at line 109 of file LTC4261.h.

◆ LTC4261_I2C_ALERT_RESPONSE

#define LTC4261_I2C_ALERT_RESPONSE   0x0C

Definition at line 117 of file LTC4261.h.

◆ LTC4261_I2C_MASS_WRITE

#define LTC4261_I2C_MASS_WRITE   0x3E

Definition at line 118 of file LTC4261.h.

◆ LTC4261_OVERCURRENT_AUTO_RETRY_DISABLE

#define LTC4261_OVERCURRENT_AUTO_RETRY_DISABLE   0xFB

Definition at line 153 of file LTC4261.h.

◆ LTC4261_OVERCURRENT_AUTO_RETRY_ENABLE

#define LTC4261_OVERCURRENT_AUTO_RETRY_ENABLE   0x04

Definition at line 152 of file LTC4261.h.

◆ LTC4261_OVERCURRENT_DISABLE

#define LTC4261_OVERCURRENT_DISABLE   0xFB

Definition at line 187 of file LTC4261.h.

◆ LTC4261_OVERCURRENT_ENABLE

#define LTC4261_OVERCURRENT_ENABLE   0x04

Definition at line 186 of file LTC4261.h.

◆ LTC4261_OVERCURRENT_FAULT

#define LTC4261_OVERCURRENT_FAULT   0x04

Definition at line 169 of file LTC4261.h.

◆ LTC4261_OVERVOLTAGE_AUTO_RETRY_DISABLE

#define LTC4261_OVERVOLTAGE_AUTO_RETRY_DISABLE   0xFE

Definition at line 159 of file LTC4261.h.

◆ LTC4261_OVERVOLTAGE_AUTO_RETRY_ENABLE

#define LTC4261_OVERVOLTAGE_AUTO_RETRY_ENABLE   0x01

Definition at line 158 of file LTC4261.h.

◆ LTC4261_OVERVOLTAGE_DISABLE

#define LTC4261_OVERVOLTAGE_DISABLE   0xFE

Definition at line 191 of file LTC4261.h.

◆ LTC4261_OVERVOLTAGE_ENABLE

#define LTC4261_OVERVOLTAGE_ENABLE   0x01

Definition at line 190 of file LTC4261.h.

◆ LTC4261_OVERVOLTAGE_FAULT

#define LTC4261_OVERVOLTAGE_FAULT   0x01

Definition at line 171 of file LTC4261.h.

◆ LTC4261_PGIO_GENERAL_PURPOSE_INPUT

#define LTC4261_PGIO_GENERAL_PURPOSE_INPUT   0xC0

Definition at line 141 of file LTC4261.h.

◆ LTC4261_PGIO_GENERAL_PURPOSE_OUTPUT

#define LTC4261_PGIO_GENERAL_PURPOSE_OUTPUT   0x40

Definition at line 140 of file LTC4261.h.

◆ LTC4261_PGIO_INPUT_HIGH

#define LTC4261_PGIO_INPUT_HIGH   0x40

Definition at line 165 of file LTC4261.h.

◆ LTC4261_PGIO_OUTPUT_DISABLE

#define LTC4261_PGIO_OUTPUT_DISABLE   0xBF

Definition at line 179 of file LTC4261.h.

◆ LTC4261_PGIO_OUTPUT_ENABLE

#define LTC4261_PGIO_OUTPUT_ENABLE   0x40

Definition at line 178 of file LTC4261.h.

◆ LTC4261_PGIO_POWER_GOOD

#define LTC4261_PGIO_POWER_GOOD   0x80

Definition at line 139 of file LTC4261.h.

◆ LTC4261_PGIO_POWER_GOODX

#define LTC4261_PGIO_POWER_GOODX   0x00

Definition at line 138 of file LTC4261.h.

◆ LTC4261_POWER_BAD_AUTO_RETRY_DISABLE

#define LTC4261_POWER_BAD_AUTO_RETRY_DISABLE   0xEF

Definition at line 147 of file LTC4261.h.

◆ LTC4261_POWER_BAD_AUTO_RETRY_ENABLE

#define LTC4261_POWER_BAD_AUTO_RETRY_ENABLE   0x10

Definition at line 146 of file LTC4261.h.

◆ LTC4261_POWER_BAD_DISABLE

#define LTC4261_POWER_BAD_DISABLE   0xF7

Definition at line 185 of file LTC4261.h.

◆ LTC4261_POWER_BAD_ENABLE

#define LTC4261_POWER_BAD_ENABLE   0x08

Definition at line 184 of file LTC4261.h.

◆ LTC4261_POWER_BAD_FAULT

#define LTC4261_POWER_BAD_FAULT   0x08

Definition at line 168 of file LTC4261.h.

◆ LTC4261_SENSE_LSB_REG

#define LTC4261_SENSE_LSB_REG   0x05

Definition at line 129 of file LTC4261.h.

◆ LTC4261_SENSE_MSB_REG

#define LTC4261_SENSE_MSB_REG   0x04

Definition at line 128 of file LTC4261.h.

◆ LTC4261_STATUS_REG

#define LTC4261_STATUS_REG   0x00

Definition at line 124 of file LTC4261.h.

◆ LTC4261_TEST_MODE_DISABLE

#define LTC4261_TEST_MODE_DISABLE   0xDF

Definition at line 144 of file LTC4261.h.

◆ LTC4261_TEST_MODE_ENABLE

#define LTC4261_TEST_MODE_ENABLE   0x20

Definition at line 143 of file LTC4261.h.

◆ LTC4261_UNDERVOLTAGE_AUTO_RETRY_DISABLE

#define LTC4261_UNDERVOLTAGE_AUTO_RETRY_DISABLE   0xFD

Definition at line 156 of file LTC4261.h.

◆ LTC4261_UNDERVOLTAGE_AUTO_RETRY_ENABLE

#define LTC4261_UNDERVOLTAGE_AUTO_RETRY_ENABLE   0x02

Definition at line 155 of file LTC4261.h.

◆ LTC4261_UNDERVOLTAGE_DISABLE

#define LTC4261_UNDERVOLTAGE_DISABLE   0xFD

Definition at line 189 of file LTC4261.h.

◆ LTC4261_UNDERVOLTAGE_ENABLE

#define LTC4261_UNDERVOLTAGE_ENABLE   0x02

Definition at line 188 of file LTC4261.h.

◆ LTC4261_UNDERVOLTAGE_FAULT

#define LTC4261_UNDERVOLTAGE_FAULT   0x02

Definition at line 170 of file LTC4261.h.