![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
DC1894B LTC6804-1: Battery stack monitor. More...
DC1894B LTC6804-1: Battery stack monitor.
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 D1894B. Menu Entry 1: Write Configuration Writes the configuration register of the LTC6804s on the stack. This command can be used to turn on the reference and shorten ADC conversion Times. Menu Entry 2: Read Configuration Reads the configuration register of the LTC6804, the read configuration can differ from the written configuration. The GPIO pins will reflect the state of the pin Menu Entry 3: Start Cell voltage conversion Starts a LTC6804 cell channel adc conversion. Menu Entry 4: Read cell voltages Reads the LTC6804 cell voltage registers and prints the results to the serial port. Menu Entry 5: Start Auxiliary voltage conversion Starts a LTC6804 GPIO channel adc conversion. Menu Entry 6: Read Auxiliary voltages Reads the LTC6804 axiliary registers and prints the GPIO voltages to the serial port. Menu Entry 7: Start cell voltage measurement loop The command will continuously measure the LTC6804 cell voltages and print the results to the serial port. The loop can be exited by sending the MCU a 'm' character over the serial link. USER INPUT DATA FORMAT: decimal : 1024 hex : 0x400 octal : 02000 (leading 0) binary : B10000000000 float : 1024.0
http://www.linear.com/product/LTC6804-1
http://www.linear.com/product/LTC6804-1#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.
Copyright 2013 Linear Technology Corp. (LTC)
Definition in file DC1894.ino.
Go to the source code of this file.
Functions | |
static void | setup () |
More... | |
static void | loop () |
More... | |
static void | run_command (uint32_t cmd) |
More... | |
static void | init_cfg () |
More... | |
static void | print_menu () |
More... | |
static void | print_cells () |
More... | |
static void | print_aux () |
More... | |
static void | print_config () |
More... | |
static void | print_rxconfig () |
More... | |
static void | serial_print_hex (uint8_t data) |
Variables | |
const uint8_t | TOTAL_IC = 1 |
number of ICs in the daisy chain More... | |
static uint16_t | cell_codes [TOTAL_IC][12] |
The cell codes will be stored in the cell_codes[][12] array in the following format: More... | |
static uint16_t | aux_codes [TOTAL_IC][6] |
The GPIO codes will be stored in the aux_codes[][6] array in the following format: More... | |
static uint8_t | tx_cfg [TOTAL_IC][6] |
The tx_cfg[][6] stores the LTC6804 configuration data that is going to be written to the LTC6804 ICs on the daisy chain. More... | |
static uint8_t | rx_cfg [TOTAL_IC][8] |
the rx_cfg[][8] array stores the data that is read back from a LTC6804-1 daisy chain. More... | |
|
static |
|
static |
|
static |
Prints GPIO voltage codes and Vref2 voltage code onto the serial port
Definition at line 358 of file DC1894.ino.
|
static |
|
static |
Prints the configuration data that is going to be written to the LTC6804 to the serial port.
Definition at line 384 of file DC1894.ino.
|
static |
|
static |
Prints the configuration data that was read back from the LTC6804 to the serial port.
Definition at line 420 of file DC1894.ino.
|
static |
executes the user inputted command
Menu Entry 1: Write Configuration
Writes the configuration register of the LTC6804. This command can be used to turn on the reference and increase the speed of the ADC conversions.
Menu Entry 2: Read Configuration
Reads the configuration register of the LTC6804, the read configuration can differ from the written configuration. The GPIO pins will reflect the state of the pin
Menu Entry 3: Start Cell voltage conversion
Starts a LTC6804 cell channel adc conversion.
Menu Entry 4: Read cell voltages Reads the LTC6804 cell voltage registers and prints the results to the serial port.
Menu Entry 5: Start Auxiliary voltage conversion Starts a LTC6804 GPIO channel adc conversion.
Menu Entry 6: Read Auxiliary voltages6118 Reads the LTC6804 axiliary registers and prints the GPIO voltages to the serial port.
Menu Entry 7: Start cell voltage measurement loop The command will continuously measure the LTC6804 cell voltages and print the results to the serial port. The loop can be exited by sending the MCU a 'm' character over the serial link.
Definition at line 204 of file DC1894.ino.
|
static |
Definition at line 448 of file DC1894.ino.
|
static |
|
static |
The GPIO codes will be stored in the aux_codes[][6] array in the following format:
aux_codes[0][0] | aux_codes[0][1] | aux_codes[0][2] | aux_codes[0][3] | aux_codes[0][4] | aux_codes[0][5] | aux_codes[1][0] | aux_codes[1][1] | ..... |
---|---|---|---|---|---|---|---|---|
IC1 GPIO1 | IC1 GPIO2 | IC1 GPIO3 | IC1 GPIO4 | IC1 GPIO5 | IC1 Vref2 | IC2 GPIO1 | IC2 GPIO2 | ..... |
Definition at line 117 of file DC1894.ino.
|
static |
The cell codes will be stored in the cell_codes[][12] array in the following format:
cell_codes[0][0] | cell_codes[0][1] | cell_codes[0][2] | ..... | cell_codes[0][11] | cell_codes[1][0] | cell_codes[1][1] | ..... |
---|---|---|---|---|---|---|---|
IC1 Cell 1 | IC1 Cell 2 | IC1 Cell 3 | ..... | IC1 Cell 12 | IC2 Cell 1 | IC2 Cell 2 | ..... |
Definition at line 108 of file DC1894.ino.
|
static |
the rx_cfg[][8] array stores the data that is read back from a LTC6804-1 daisy chain.
The configuration data for each IC is stored in blocks of 8 bytes. Below is an table illustrating the array organization:
rx_config[0][0] | rx_config[0][1] | rx_config[0][2] | rx_config[0][3] | rx_config[0][4] | rx_config[0][5] | rx_config[0][6] | rx_config[0][7] | rx_config[1][0] | rx_config[1][1] | ..... |
---|---|---|---|---|---|---|---|---|---|---|
IC1 CFGR0 | IC1 CFGR1 | IC1 CFGR2 | IC1 CFGR3 | IC1 CFGR4 | IC1 CFGR5 | IC1 PEC High | IC1 PEC Low | IC2 CFGR0 | IC2 CFGR1 | ..... |
Definition at line 138 of file DC1894.ino.
const uint8_t TOTAL_IC = 1 |
number of ICs in the daisy chain
Definition at line 100 of file DC1894.ino.
|
static |
The tx_cfg[][6] stores the LTC6804 configuration data that is going to be written to the LTC6804 ICs on the daisy chain.
The LTC6804 configuration data that will be written should be stored in blocks of 6 bytes. The array should have the following format:
tx_cfg[0][0] | tx_cfg[0][1] | tx_cfg[0][2] | tx_cfg[0][3] | tx_cfg[0][4] | tx_cfg[0][5] | tx_cfg[1][0] | tx_cfg[1][1] | tx_cfg[1][2] | ..... |
---|---|---|---|---|---|---|---|---|---|
IC1 CFGR0 | IC1 CFGR1 | IC1 CFGR2 | IC1 CFGR3 | IC1 CFGR4 | IC1 CFGR5 | IC2 CFGR0 | IC2 CFGR1 | IC2 CFGR2 | ..... |
Definition at line 126 of file DC1894.ino.