LTC6811

Embed: (wiki syntax)

« Back to documentation index

LTC6811.h File Reference

LTC6811.h File Reference

Go to the source code of this file.

Functions

void LTC6811_diagn ()
uint8_t LTC6811_pladc ()
 Sends the poll adc command.
uint32_t LTC6811_pollAdc ()
 This function will block operation until the ADC has finished it's conversion.
void LTC6811_adcv (uint8_t MD, uint8_t DCP, uint8_t CH)
void LTC6811_adcvax (uint8_t MD, uint8_t DCP)
void LTC6811_cvst (uint8_t MD, uint8_t ST)
void LTC6811_adcvsc (uint8_t MD, uint8_t DCP)
void LTC6811_adol (uint8_t MD, uint8_t DCP)
void LTC6811_adow (uint8_t MD, uint8_t PUP)
void LTC6811_adax (uint8_t MD, uint8_t CHG)
void LTC6811_adaxd (uint8_t MD, uint8_t CHG)
void LTC6811_axst (uint8_t MD, uint8_t ST)
void LTC6811_adstat (uint8_t MD, uint8_t CHST)
void LTC6811_adstatd (uint8_t MD, uint8_t CHST)
void LTC6811_statst (uint8_t MD, uint8_t ST)
uint8_t LTC6811_rdcv (uint8_t reg, uint8_t total_ic, cell_asic ic[])
int8_t LTC6811_rdaux (uint8_t reg, uint8_t nIC, cell_asic ic[])
int8_t LTC6811_rdstat (uint8_t reg, uint8_t total_ic, cell_asic ic[])
void LTC6811_clrcell ()
void LTC6811_clraux ()
void LTC6811_clrstat ()
void LTC6811_clrsctrl ()
void LTC6811_wrcfg (uint8_t nIC, cell_asic ic[])
void LTC6811_wrcfgb (uint8_t nIC, cell_asic ic[])
int8_t LTC6811_rdcfg (uint8_t nIC, cell_asic ic[])
int8_t LTC6811_rdcfgb (uint8_t nIC, cell_asic ic[])
void LTC6811_wrpwm (uint8_t nIC, uint8_t pwmReg, cell_asic ic[])
int8_t LTC6811_rdpwm (uint8_t nIC, uint8_t pwmReg, cell_asic ic[])
void LTC6811_wrsctrl (uint8_t nIC, uint8_t sctrl_reg, cell_asic ic[])
int8_t LTC6811_rdsctrl (uint8_t nIC, uint8_t sctrl_reg, cell_asic ic[])
void LTC6811_stsctrl ()
void LTC6811_wrcomm (uint8_t total_ic, cell_asic ic[])
int8_t LTC6811_rdcomm (uint8_t total_ic, cell_asic ic[])
void LTC6811_stcomm ()
uint16_t LTC6811_st_lookup (uint8_t MD, uint8_t ST)
int16_t LTC6811_run_cell_adc_st (uint8_t adc_reg, uint8_t total_ic, cell_asic ic[])
int16_t LTC6811_run_adc_redundancy_st (uint8_t adc_mode, uint8_t adc_reg, uint8_t total_ic, cell_asic ic[])
void LTC6811_run_openwire (uint8_t total_ic, cell_asic ic[])
uint16_t LTC6811_run_adc_overlap (uint8_t total_ic, cell_asic ic[])
void LTC6811_check_pec (uint8_t total_ic, uint8_t reg, cell_asic ic[])
void LTC6811_reset_crc_count (uint8_t total_ic, cell_asic ic[])
void LTC6811_init_cfg (uint8_t total_ic, cell_asic ic[])
void LTC6811_set_cfgr (uint8_t nIC, cell_asic ic[], bool refon, bool adcopt, bool gpio[5], bool dcc[12])
void LTC6811_set_cfgr_refon (uint8_t nIC, cell_asic ic[], bool refon)
void LTC6811_set_cfgr_adcopt (uint8_t nIC, cell_asic ic[], bool adcopt)
void LTC6811_set_cfgr_gpio (uint8_t nIC, cell_asic ic[], bool gpio[])
void LTC6811_set_cfgr_dis (uint8_t nIC, cell_asic ic[], bool dcc[])
void LTC6811_set_cfgr_uv (uint8_t nIC, cell_asic ic[], uint16_t uv)
void LTC6811_set_cfgr_ov (uint8_t nIC, cell_asic ic[], uint16_t ov)

Detailed Description

LTC6811-1: Multicell Battery Monitor

http://www.linear.com/product/LTC6811-1

http://www.linear.com/product/LTC6811-1#demoboards

REVISION HISTORY

Revision:
7139
Date:
2017-06-01 13:55:14 -0700 (Thu, 01 Jun 2017)

Copyright (c) 2015, 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.

Copyright 2017 Linear Technology Corp. (LTC)

Header for LTC6811-1 Multicell Battery Monitor

Definition in file LTC6811.h.


Function Documentation

void LTC6811_adax ( uint8_t  MD,
uint8_t  CHG 
)

Start a GPIO and Vref2 Conversion

Parameters:
MDADC Conversion Mode
CHGSets which GPIO channels are converted

Definition at line 167 of file LTC6811.cpp.

void LTC6811_adaxd ( uint8_t  MD,
uint8_t  CHG 
)

Start an GPIO Redundancy test

Parameters:
MDADC Conversion Mode
CHGSets which GPIO channels are converted

Definition at line 176 of file LTC6811.cpp.

void LTC6811_adcv ( uint8_t  MD,
uint8_t  DCP,
uint8_t  CH 
)

Starts cell voltage conversion

Parameters:
MDADC Conversion Mode
DCPControls if Discharge is permitted during conversion
CHSets which Cell channels are converted

Definition at line 91 of file LTC6811.cpp.

void LTC6811_adcvax ( uint8_t  MD,
uint8_t  DCP 
)

Starts cell voltage and GPIO 1&2 conversion

Parameters:
MDADC Conversion Mode
DCPControls if Discharge is permitted during conversion

Definition at line 110 of file LTC6811.cpp.

void LTC6811_adcvsc ( uint8_t  MD,
uint8_t  DCP 
)

Starts cell voltage and SOC conversion

Parameters:
MDADC Conversion Mode
DCPControls if Discharge is permitted during conversion

Definition at line 101 of file LTC6811.cpp.

void LTC6811_adol ( uint8_t  MD,
uint8_t  DCP 
)

Starts cell voltage overlap conversion

Parameters:
MDADC Conversion Mode
DCPDischarge permitted during conversion

Definition at line 119 of file LTC6811.cpp.

void LTC6811_adow ( uint8_t  MD,
uint8_t  PUP 
)

Start an open wire Conversion

Parameters:
MDADC Conversion Mode
PUPControls if Discharge is permitted during conversion

Definition at line 204 of file LTC6811.cpp.

void LTC6811_adstat ( uint8_t  MD,
uint8_t  CHST 
)

Start a Status ADC Conversion

Parameters:
MDADC Conversion Mode
CHSTSets which Stat channels are converted

Definition at line 185 of file LTC6811.cpp.

void LTC6811_adstatd ( uint8_t  MD,
uint8_t  CHST 
)

Start a Status register redundancy test Conversion

Parameters:
MDADC Mode
CHSTSets which Status channels are converted

Definition at line 194 of file LTC6811.cpp.

void LTC6811_axst ( uint8_t  MD,
uint8_t  ST 
)

Start an Auxiliary Register Self Test Conversion

Parameters:
MDADC Conversion Mode
STSets if self test 1 or 2 is run

Definition at line 137 of file LTC6811.cpp.

void LTC6811_check_pec ( uint8_t  total_ic,
uint8_t  reg,
cell_asic  ic[] 
)

Helper Function that counts overall PEC errors and register/IC PEC errors

Definition at line 460 of file LTC6811.cpp.

void LTC6811_clraux (  )

Clears the LTC6811 Auxiliary registers

Definition at line 270 of file LTC6811.cpp.

void LTC6811_clrcell (  )

Clears the LTC6811 cell voltage registers

Definition at line 260 of file LTC6811.cpp.

void LTC6811_clrsctrl (  )

Clears the LTC6811 Sctrl registers

Definition at line 291 of file LTC6811.cpp.

void LTC6811_clrstat (  )

Clears the LTC6811 Stat registers

Definition at line 281 of file LTC6811.cpp.

void LTC6811_cvst ( uint8_t  MD,
uint8_t  ST 
)

Starts cell voltage self test conversion

Parameters:
MDADC Conversion Mode
STSelf Test Mode

Definition at line 128 of file LTC6811.cpp.

void LTC6811_diagn (  )

Starts the Mux Decoder diagnostic self test

Running this command will start the Mux Decoder Diagnostic Self Test This test takes roughly 1mS to complete. The MUXFAIL bit will be updated, the bit will be set to 1 for a failure and 0 if the test has been passed.

Definition at line 297 of file LTC6811.cpp.

void LTC6811_init_cfg ( uint8_t  total_ic,
cell_asic  ic[] 
)

Helper Function to initialize the CFGR data structures

Definition at line 472 of file LTC6811.cpp.

uint8_t LTC6811_pladc (  )

Sends the poll adc command.

Returns:
1 byte read back after a pladc command. If the byte is not 0xFF ADC conversion has completed

Definition at line 155 of file LTC6811.cpp.

uint32_t LTC6811_pollAdc (  )

This function will block operation until the ADC has finished it's conversion.

Returns:
the approximate time it took for the ADC function to complete.

Definition at line 161 of file LTC6811.cpp.

int8_t LTC6811_rdaux ( uint8_t  reg,
uint8_t  nIC,
cell_asic  ic[] 
)

Reads and parses the LTC6811 auxiliary registers.

Returns:
int8_t, PEC Status 0: No PEC error detected -1: PEC error detected, retry read
Parameters:
regcontrols which GPIO voltage register is read back
nICthe number of ICs in the daisy chain
icA two dimensional array of the parsed gpio voltage codes

Definition at line 229 of file LTC6811.cpp.

int8_t LTC6811_rdcfg ( uint8_t  nIC,
cell_asic  ic[] 
)

Reads configuration registers of a LTC6811 daisy chain

Returns:
int8_t, PEC Status. 0: Data read back has matching PEC -1: Data read back has incorrect PEC
Parameters:
nICnumber of ICs in the daisy chain
ica two dimensional array that the function stores the read configuration data

Definition at line 318 of file LTC6811.cpp.

int8_t LTC6811_rdcfgb ( uint8_t  nIC,
cell_asic  ic[] 
)
Parameters:
nICnumber of ICs in the daisy chain
ica two dimensional array that the function stores the read configuration data
int8_t LTC6811_rdcomm ( uint8_t  total_ic,
cell_asic  ic[] 
)

Reads comm registers of a LTC6811 daisy chain

Returns:
int8_t, PEC Status.

0: Data read back has matching PEC

-1: Data read back has incorrect PEC

Parameters:
total_icnumber of ICs in the daisy chain
icTwo dimensional array that the function stores the read comm data.

Definition at line 365 of file LTC6811.cpp.

uint8_t LTC6811_rdcv ( uint8_t  reg,
uint8_t  total_ic,
cell_asic  ic[] 
)

Reads and parses the LTC6811 cell voltage registers.

Returns:
int8_t, PEC Status. 0: No PEC error detected -1: PEC error detected, retry read
Parameters:
regcontrols which cell voltage register is read back.
total_icthe number of ICs in the daisy chain(-1 only)
icarray of the parsed cell codes from lowest to highest.

Definition at line 213 of file LTC6811.cpp.

int8_t LTC6811_rdpwm ( uint8_t  nIC,
uint8_t  pwmReg,
cell_asic  ic[] 
)

Reads pwm registers of a LTC6811 daisy chain

Parameters:
nICnumber of ICs in the daisy chain
ica two dimensional array that the function stores the read pwm data

Definition at line 342 of file LTC6811.cpp.

int8_t LTC6811_rdsctrl ( uint8_t  nIC,
uint8_t  sctrl_reg,
cell_asic  ic[] 
)

Reads sctrl registers of a LTC6811 daisy chain

Returns:
int8_t, PEC Status. 0: Data read back has matching PEC -1: Data read back has incorrect PEC
Parameters:
nICnumber of ICs in the daisy chain
ica two dimensional array that the function stores the read pwm data
int8_t LTC6811_rdstat ( uint8_t  reg,
uint8_t  total_ic,
cell_asic  ic[] 
)

Reads and parses the LTC6811 stat registers.

Returns:
int8_t, PEC Status 0: No PEC error detected -1: PEC error detected, retry read

Definition at line 245 of file LTC6811.cpp.

void LTC6811_reset_crc_count ( uint8_t  total_ic,
cell_asic  ic[] 
)

Helper Function that resets the PEC error counters

Definition at line 466 of file LTC6811.cpp.

uint16_t LTC6811_run_adc_overlap ( uint8_t  total_ic,
cell_asic  ic[] 
)

Helper Function that runs the ADC Overlap test

Definition at line 419 of file LTC6811.cpp.

int16_t LTC6811_run_adc_redundancy_st ( uint8_t  adc_mode,
uint8_t  adc_reg,
uint8_t  total_ic,
cell_asic  ic[] 
)

Helper function that runs the ADC Digital Redudancy commands and checks output for errors

Definition at line 407 of file LTC6811.cpp.

int16_t LTC6811_run_cell_adc_st ( uint8_t  adc_reg,
uint8_t  total_ic,
cell_asic  ic[] 
)

Helper function that runs the ADC Self Tests

Definition at line 399 of file LTC6811.cpp.

void LTC6811_run_openwire ( uint8_t  total_ic,
cell_asic  ic[] 
)

Helper function that runs the datasheet open wire algorithm

Definition at line 414 of file LTC6811.cpp.

void LTC6811_set_cfgr ( uint8_t  nIC,
cell_asic  ic[],
bool  refon,
bool  adcopt,
bool  gpio[5],
bool  dcc[12] 
)

Helper function to set appropriate bits in CFGR register based on bit function

Definition at line 477 of file LTC6811.cpp.

void LTC6811_set_cfgr_adcopt ( uint8_t  nIC,
cell_asic  ic[],
bool  adcopt 
)

Helper function to turn the ADCOPT bit HIGH or LOW

Definition at line 490 of file LTC6811.cpp.

void LTC6811_set_cfgr_dis ( uint8_t  nIC,
cell_asic  ic[],
bool  dcc[] 
)

Helper function to turn the DCC bits HIGH or LOW

void LTC6811_set_cfgr_gpio ( uint8_t  nIC,
cell_asic  ic[],
bool  gpio[] 
)

Helper function to turn the GPIO bits HIGH or LOW

void LTC6811_set_cfgr_ov ( uint8_t  nIC,
cell_asic  ic[],
uint16_t  ov 
)

Helper function to set ov field in CFGRA register

Definition at line 510 of file LTC6811.cpp.

void LTC6811_set_cfgr_refon ( uint8_t  nIC,
cell_asic  ic[],
bool  refon 
)

Helper function to turn the refon bit HIGH or LOW

Definition at line 485 of file LTC6811.cpp.

void LTC6811_set_cfgr_uv ( uint8_t  nIC,
cell_asic  ic[],
uint16_t  uv 
)

Helper function to set uv field in CFGRA register

Definition at line 505 of file LTC6811.cpp.

uint16_t LTC6811_st_lookup ( uint8_t  MD,
uint8_t  ST 
)
Returns:
returns the register data pattern for a given ADC MD and Self test
Parameters:
MDADC Conversion Mode
STSelf test number
void LTC6811_statst ( uint8_t  MD,
uint8_t  ST 
)

Start a Status Register Self Test Conversion

Parameters:
MDADC Conversion Mode
STSets if self test 1 or 2 is run

Definition at line 146 of file LTC6811.cpp.

void LTC6811_stcomm (  )

issues a stcomm command and clocks data out of the COMM register

Definition at line 377 of file LTC6811.cpp.

void LTC6811_stsctrl (  )

Start Sctrl data communication This command will start the sctrl pulse communication over the spins

void LTC6811_wrcfg ( uint8_t  nIC,
cell_asic  ic[] 
)

Write the LTC6811 configuration register

Parameters:
nICThe number of ICs being written
ica two dimensional array of the configuration data that will be written

Definition at line 307 of file LTC6811.cpp.

void LTC6811_wrcfgb ( uint8_t  nIC,
cell_asic  ic[] 
)
Parameters:
nICThe number of ICs being written
ica two dimensional array of the configuration data that will be written
void LTC6811_wrcomm ( uint8_t  total_ic,
cell_asic  ic[] 
)

Write the LTC6811 COMM register

Parameters:
total_icNumber of ICs in the daisy chain
icA two dimensional array of the comm data that will be written

Definition at line 355 of file LTC6811.cpp.

void LTC6811_wrpwm ( uint8_t  nIC,
uint8_t  pwmReg,
cell_asic  ic[] 
)

Write the LTC6811 PWM register

Parameters:
nICnumber of ICs in the daisy chain

Definition at line 330 of file LTC6811.cpp.

void LTC6811_wrsctrl ( uint8_t  nIC,
uint8_t  sctrl_reg,
cell_asic  ic[] 
)

Write the LTC6811 Sctrl register

Parameters:
nICnumber of ICs in the daisy chain