![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
Analog Devices DC2259A Demonstration Board. More...
Analog Devices DC2259A Demonstration Board.
LTC6811: Multicell Battery Monitors
*NOTES * Setup: * Set the terminal baud rate to 115200 and select the newline terminator. * Ensure all jumpers on the demo board are installed in their default positions from the factory. * Refer to Demo Manual. * *USER INPUT DATA FORMAT: * decimal : 1024 * hex : 0x400 * octal : 02000 (leading 0) * binary : B10000000000 * float : 1024.0 *
https://www.analog.com/en/products/ltc6811-1.html https://www.analog.com/en/design-center/evaluation-hardware-and-software/evaluation-boards-kits/dc2259a.html
Copyright 2019(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.
Definition in file DC2259.ino.
Go to the source code of this file.
Functions | |
static void | measurement_loop (uint8_t datalog_en) |
More... | |
static void | print_menu (void) |
More... | |
static void | print_wrconfig (void) |
More... | |
static void | print_rxconfig (void) |
More... | |
static void | print_cells (uint8_t datalog_en) |
More... | |
static void | print_aux (uint8_t datalog_en) |
More... | |
static void | print_stat (void) |
More... | |
static void | print_sumofcells (void) |
More... | |
static void | check_mux_fail (void) |
More... | |
static void | print_selftest_errors (uint8_t adc_reg,int8_t error) |
More... | |
static void | print_overlap_results (int8_t error) |
More... | |
static void | print_digital_redundancy_errors (uint8_t adc_reg,int8_t error) |
More... | |
static void | print_open_wires (void) |
static void | print_pec_error_count (void) |
More... | |
static int8_t | select_s_pin (void) |
More... | |
static void | print_wrpwm (void) |
More... | |
static void | print_rxpwm (void) |
More... | |
static void | print_wrsctrl (void) |
More... | |
static void | print_rxsctrl (void) |
More... | |
static void | print_wrcomm (void) |
More... | |
static void | print_rxcomm (void) |
More... | |
static void | print_conv_time (uint32_t conv_time) |
More... | |
static void | check_error (int error) |
More... | |
static void | serial_print_text (char data[]) |
More... | |
static void | serial_print_hex (uint8_t data) |
More... | |
char | read_hex (void) |
More... | |
char | get_char (void) |
More... | |
static void | setup () |
More... | |
static void | loop () |
More... | |
static void | run_command (uint32_t cmd) |
More... | |
Macros | |
#define | ENABLED 1 |
#define | DISABLED 0 |
#define | DATALOG_ENABLED 1 |
#define | DATALOG_DISABLED 0 |
Variables | |
const uint8_t | TOTAL_IC = 2 |
Number of ICs in the daisy chain. More... | |
const uint8_t | ADC_OPT = ADC_OPT_DISABLED |
ADC Mode option bit. More... | |
const uint8_t | ADC_CONVERSION_MODE = MD_7KHZ_3KHZ |
ADC Mode. More... | |
const uint8_t | ADC_DCP = DCP_ENABLED |
Discharge Permitted. More... | |
const uint8_t | CELL_CH_TO_CONVERT = CELL_CH_ALL |
Channel Selection for ADC conversion. More... | |
const uint8_t | AUX_CH_TO_CONVERT = AUX_CH_ALL |
Channel Selection for ADC conversion. More... | |
const uint8_t | STAT_CH_TO_CONVERT = STAT_CH_ALL |
Channel Selection for ADC conversion. More... | |
const uint8_t | SEL_ALL_REG = REG_ALL |
Register Selection. More... | |
const uint8_t | SEL_REG_A = REG_1 |
Register Selection. More... | |
const uint8_t | SEL_REG_B = REG_2 |
Register Selection. More... | |
const uint16_t | MEASUREMENT_LOOP_TIME = 500 |
Loop Time in milliseconds(ms) More... | |
const uint16_t | OV_THRESHOLD = 41000 |
Over voltage threshold ADC Code. More... | |
const uint16_t | UV_THRESHOLD = 30000 |
Under voltage threshold ADC Code. More... | |
const uint8_t | WRITE_CONFIG = DISABLED |
This is to ENABLED or DISABLED writing into to configuration registers in a continuous loop. More... | |
const uint8_t | READ_CONFIG = DISABLED |
This is to ENABLED or DISABLED reading the configuration registers in a continuous loop. More... | |
const uint8_t | MEASURE_CELL = ENABLED |
This is to ENABLED or DISABLED measuring the cell voltages in a continuous loop. More... | |
const uint8_t | MEASURE_AUX = DISABLED |
This is to ENABLED or DISABLED reading the auxiliary registers in a continuous loop. More... | |
const uint8_t | MEASURE_STAT = DISABLED |
This is to ENABLED or DISABLED reading the status registers in a continuous loop. More... | |
const uint8_t | PRINT_PEC = DISABLED |
This is to ENABLED or DISABLED printing the PEC Error Count in a continuous loop. More... | |
cell_asic | BMS_IC [TOTAL_IC] |
Global Battery Variable. More... | |
bool | REFON = true |
Reference Powered Up Bit. More... | |
bool | ADCOPT = false |
ADC Mode option bit. More... | |
bool | GPIOBITS_A [5] = {false,false,true,true,true} |
GPIO Pin Control // Gpio 1,2,3,4,5. More... | |
static uint16_t | UV =UV_THRESHOLD |
Under-voltage Comparison Voltage. More... | |
static uint16_t | OV =OV_THRESHOLD |
Over-voltage Comparison Voltage. More... | |
bool | DCCBITS_A [12] = {false,false,false,false,false,false,false,false,false,false,false,false} |
Discharge cell switch //Dcc 1,2,3,4,5,6,7,8,9,10,11,12. More... | |
bool | DCTOBITS [4] = {true, false, true, false} |
Discharge time value // Dcto 0,1,2,3 // Programed for 4 min. More... | |
char | hex_digits [16] |
More... | |
char | hex_to_byte_buffer [5] |
More... | |
char | byte_to_hex_buffer [3] |
More... | |
|
static |
Function to check error flag and print PEC error message
Definition at line 1249 of file DC2259.ino.
|
static |
Function to check the MUX fail bit in the Status Register
Definition at line 950 of file DC2259.ino.
char get_char | ( | void | ) |
|
static |
|
static |
For writing/reading configuration data or measuring cell voltages or reading aux register or reading status register in a continuous loop
Definition at line 660 of file DC2259.ino.
|
static |
Prints GPIO voltage codes and Vref2 voltage code onto the serial port
Definition at line 845 of file DC2259.ino.
|
static |
|
static |
|
static |
Prints Errors Detected during Digital Redundancy test
Definition at line 1000 of file DC2259.ino.
|
static |
|
static |
Definition at line 1019 of file DC2259.ino.
|
static |
|
static |
Prints the PEC errors detected to the serial port
Definition at line 1043 of file DC2259.ino.
|
static |
Prints comm register data that was read back from the LTC6811 to the serial port.
Definition at line 1211 of file DC2259.ino.
|
static |
Prints the configuration data that was read back from the LTC6811 to the serial port.
Definition at line 786 of file DC2259.ino.
|
static |
Prints the PWM configuration data that was read back from the LTC6811 to the serial port.
Definition at line 1102 of file DC2259.ino.
|
static |
Prints s control register data that was read back from the LTC6811 to the serial port.
Definition at line 1156 of file DC2259.ino.
|
static |
|
static |
Prints Status voltage codes and Vref2 voltage code onto the serial port
Definition at line 890 of file DC2259.ino.
|
static |
Prints Status voltage codes for SOC onto the serial port
Definition at line 932 of file DC2259.ino.
|
static |
Prints comm register data to the serial port
Definition at line 1182 of file DC2259.ino.
|
static |
Prints the configuration data that is going to be written to the LTC6811 to the serial port.
Definition at line 758 of file DC2259.ino.
|
static |
Prints PWM the configuration data that is going to be written to the LTC6811 to the serial port.
Definition at line 1074 of file DC2259.ino.
|
static |
Prints S control register data to the serial port
Definition at line 1126 of file DC2259.ino.
char read_hex | ( | void | ) |
Read 2 hex characters from the serial buffer and convert them to a byte
Definition at line 1309 of file DC2259.ino.
|
static |
|
static |
|
static |
|
static |
|
static |
#define DATALOG_DISABLED 0 |
Definition at line 87 of file DC2259.ino.
#define DATALOG_ENABLED 1 |
Definition at line 86 of file DC2259.ino.
#define DISABLED 0 |
Definition at line 85 of file DC2259.ino.
#define ENABLED 1 |
Definition at line 84 of file DC2259.ino.
const uint8_t ADC_CONVERSION_MODE = MD_7KHZ_3KHZ |
ADC Mode.
Definition at line 126 of file DC2259.ino.
const uint8_t ADC_DCP = DCP_ENABLED |
Discharge Permitted.
Definition at line 127 of file DC2259.ino.
const uint8_t ADC_OPT = ADC_OPT_DISABLED |
ADC Mode option bit.
Definition at line 125 of file DC2259.ino.
bool ADCOPT = false |
ADC Mode option bit.
Definition at line 165 of file DC2259.ino.
const uint8_t AUX_CH_TO_CONVERT = AUX_CH_ALL |
Channel Selection for ADC conversion.
Definition at line 129 of file DC2259.ino.
Global Battery Variable.
Definition at line 158 of file DC2259.ino.
char byte_to_hex_buffer[3] |
Buffer for ASCII hex to byte conversion
Definition at line 1300 of file DC2259.ino.
const uint8_t CELL_CH_TO_CONVERT = CELL_CH_ALL |
Channel Selection for ADC conversion.
Definition at line 128 of file DC2259.ino.
bool DCCBITS_A[12] = {false,false,false,false,false,false,false,false,false,false,false,false} |
Discharge cell switch //Dcc 1,2,3,4,5,6,7,8,9,10,11,12.
Definition at line 169 of file DC2259.ino.
bool DCTOBITS[4] = {true, false, true, false} |
Discharge time value // Dcto 0,1,2,3 // Programed for 4 min.
Definition at line 170 of file DC2259.ino.
bool GPIOBITS_A[5] = {false,false,true,true,true} |
GPIO Pin Control // Gpio 1,2,3,4,5.
Definition at line 166 of file DC2259.ino.
char hex_digits[16] |
Hex conversion constants
Definition at line 1284 of file DC2259.ino.
char hex_to_byte_buffer[5] |
Global Variables
Definition at line 1292 of file DC2259.ino.
const uint8_t MEASURE_AUX = DISABLED |
This is to ENABLED or DISABLED reading the auxiliary registers in a continuous loop.
Definition at line 145 of file DC2259.ino.
const uint8_t MEASURE_CELL = ENABLED |
This is to ENABLED or DISABLED measuring the cell voltages in a continuous loop.
Definition at line 144 of file DC2259.ino.
const uint8_t MEASURE_STAT = DISABLED |
This is to ENABLED or DISABLED reading the status registers in a continuous loop.
Definition at line 146 of file DC2259.ino.
const uint16_t MEASUREMENT_LOOP_TIME = 500 |
Loop Time in milliseconds(ms)
Definition at line 135 of file DC2259.ino.
|
static |
Over-voltage Comparison Voltage.
Definition at line 168 of file DC2259.ino.
const uint16_t OV_THRESHOLD = 41000 |
const uint8_t PRINT_PEC = DISABLED |
This is to ENABLED or DISABLED printing the PEC Error Count in a continuous loop.
Definition at line 147 of file DC2259.ino.
const uint8_t READ_CONFIG = DISABLED |
This is to ENABLED or DISABLED reading the configuration registers in a continuous loop.
Definition at line 143 of file DC2259.ino.
bool REFON = true |
Reference Powered Up Bit.
Definition at line 164 of file DC2259.ino.
const uint8_t SEL_ALL_REG = REG_ALL |
Register Selection.
Definition at line 131 of file DC2259.ino.
const uint8_t SEL_REG_A = REG_1 |
Register Selection.
Definition at line 132 of file DC2259.ino.
const uint8_t SEL_REG_B = REG_2 |
Register Selection.
Definition at line 133 of file DC2259.ino.
const uint8_t STAT_CH_TO_CONVERT = STAT_CH_ALL |
Channel Selection for ADC conversion.
Definition at line 130 of file DC2259.ino.
const uint8_t TOTAL_IC = 2 |
Number of ICs in the daisy chain.
Definition at line 122 of file DC2259.ino.
|
static |
Under-voltage Comparison Voltage.
Definition at line 167 of file DC2259.ino.
const uint16_t UV_THRESHOLD = 30000 |
const uint8_t WRITE_CONFIG = DISABLED |
This is to ENABLED or DISABLED writing into to configuration registers in a continuous loop.
Definition at line 142 of file DC2259.ino.