![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
DC1812A-A LTC2943: Multicell Battery Gas Gauge with Temperature, Voltage and Current Measurement. More...
DC1812A-A LTC2943: Multicell Battery Gas Gauge with Temperature, Voltage and Current Measurement.
DC1812A-C LTC2943-1: Multicell Battery Gas Gauge with Temperature, Voltage and Current Measurement
Setup: Apply a voltage source to the V_BATT terminal and a load at the V_CHRG/LD terminal. Refer to the Demo Manual Guide for a detailed setup description. Ensure that JP1 is set to AL# position. Explanation of Commands: 1 - Automatic Mode - Scans Voltage, Current, Temperature and charge every 60ms. Scanning interval has been increased to 1s for ease of reading on the Serial Prompt. Displays an alert if it is set in the status register at the time of scan. 2 - Scan Mode - Scans Voltage, Current, Temperature and charge every 10s. Displays an alert if it is set in the status register at the time of scan. 3 - Manual Mode - Provides a SnapShot of the Voltage, Current, Temperature and Accumulated Charge. After the initial SnapShot, the part goes into sleep mode where it only counts charge. Displays an alert if it is set in the status register at the time of scan. 4 - Sleep Mode - The ADC portion of the LTC2943 is shutdown. In this mode only charge is accumulated. 5 - Shutdown Mode - The LTC2943 goes into low power mode. 6 - Settings - Allows user to set alert thresholds, set prescalar, set AL#/CC# pin mode and change the temperature and charge units. NOTES Setup: Set the terminal baud rate to 115200 and select the newline terminator. Requires a power supply. Refer to demo manual DC1812A-A. USER INPUT DATA FORMAT: decimal : 1024 hex : 0x400 octal : 02000 (leading 0 "zero") binary : B10000000000 float : 1024.0
http://www.linear.com/product/LTC2943 http://www.linear.com/product/LTC2943-1
http://www.linear.com/product/LTC2943#demoboards http://www.linear.com/product/LTC2943-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.
Definition in file DC1812AA.ino.
Go to the source code of this file.
Functions | |
static void | print_title () |
Print the title block. More... | |
static void | print_prompt () |
Print the Prompt. More... | |
static void | store_alert_settings () |
static int8_t | restore_alert_settings () |
static void | setup () |
Initialize Linduino. More... | |
static void | loop () |
Repeats Linduino loop. More... | |
static int8_t | menu_1_automatic_mode (int8_t mAh_or_Coulombs, int8_t celcius_or_kelvin, uint16_t prescalar_mode, uint16_t prescalarValue, uint16_t alcc_mode) |
Automatic Mode. More... | |
static int8_t | menu_2_scan_mode (int8_t mAh_or_Coulombs, int8_t celcius_or_kelvin, uint16_t prescalar_mode, uint16_t prescalarValue, uint16_t alcc_mode) |
Scan Mode. More... | |
static int8_t | menu_3_manual_mode (int8_t mAh_or_Coulombs, int8_t celcius_or_kelvin, uint16_t prescalar_mode, uint16_t prescalarValue, uint16_t alcc_mode) |
Manual Mode. More... | |
static int8_t | menu_4_sleep_mode (int8_t mAh_or_Coulombs, uint16_t prescalar_mode, uint16_t prescalarValue, uint16_t alcc_mode) |
Sleep Mode. More... | |
static int8_t | menu_5_shutdown_mode () |
Shutdown Mode. More... | |
static int8_t | menu_6_settings (uint8_t *mAh_or_Coulombs, uint8_t *celcius_or_kelvin, uint16_t *prescalar_mode, uint16_t *prescalarValue, uint16_t *alcc_mode) |
Settings Menu. More... | |
static int8_t | menu_6_settings_menu_1_set_alert_thresholds () |
Alert Threshold Menu. More... | |
static int8_t | menu_6_alert_menu_1_set_charge_thresholds () |
Set Charge Threshold Function. More... | |
static int8_t | menu_6_alert_menu_2_set_voltage_thresholds () |
Set Voltage Thresholds. More... | |
static int8_t | menu_6_alert_menu_3_set_current_thresholds () |
Set Current Thresholds. More... | |
static int8_t | menu_6_alert_menu_4_set_temperature_thresholds () |
Set Temperature Thresholds. More... | |
static int8_t | menu_6_settings_menu_2_set_prescalar_values (uint16_t *prescalar_mode, uint16_t *prescalarValue) |
Prescalar Menu. More... | |
static uint8_t | menu_6_alert_menu_3_set_allcc_state (uint16_t *alcc_mode) |
AL#/CC# Pin Mode Menu. More... | |
static uint8_t | menu_6_alert_menu_4_set_units (uint8_t *mAh_or_Coulombs, uint8_t *celcius_or_kelvin) |
Set Charge and Temperature Units Menu. More... | |
bool | isBitSet (uint8_t value, uint8_t position) |
Checks to see if a bit in a certain position is set. More... | |
static void | checkAlerts (uint8_t status_code) |
Check Alerts Function - Checks to see if an alert has been set in the status register. If an alert has been set, it prints out the appropriate message. More... | |
Macros | |
#define | AUTOMATIC_MODE_DISPLAY_DELAY 1000 |
The delay between readings in automatic mode. More... | |
#define | SCAN_MODE_DISPLAY_DELAY 10000 |
The delay between readings in scan mode. More... | |
Variables | |
const float | resistor = .100 |
resistor value on demo board More... | |
const char | ack_error [] = "Error: No Acknowledge. Check I2C Address." |
Error message. More... | |
static int8_t | demo_board_connected |
Set to 1 if the board is connected. More... | |
static uint8_t | alert_code = 0 |
Value stored or read from ALERT register. More... | |
|
static |
Check Alerts Function - Checks to see if an alert has been set in the status register. If an alert has been set, it prints out the appropriate message.
Definition at line 936 of file DC1812AA.ino.
bool isBitSet | ( | uint8_t | value, |
uint8_t | position | ||
) |
Checks to see if a bit in a certain position is set.
Definition at line 930 of file DC1812AA.ino.
|
static |
Repeats Linduino loop.
Definition at line 152 of file DC1812AA.ino.
|
static |
Automatic Mode.
Definition at line 227 of file DC1812AA.ino.
|
static |
Scan Mode.
Definition at line 307 of file DC1812AA.ino.
|
static |
Manual Mode.
Definition at line 388 of file DC1812AA.ino.
|
static |
Sleep Mode.
Definition at line 481 of file DC1812AA.ino.
|
static |
Shutdown Mode.
Definition at line 542 of file DC1812AA.ino.
|
static |
Set Charge Threshold Function.
Definition at line 648 of file DC1812AA.ino.
|
static |
Set Voltage Thresholds.
Definition at line 672 of file DC1812AA.ino.
|
static |
AL#/CC# Pin Mode Menu.
Definition at line 833 of file DC1812AA.ino.
|
static |
Set Current Thresholds.
Definition at line 700 of file DC1812AA.ino.
|
static |
Set Temperature Thresholds.
Definition at line 729 of file DC1812AA.ino.
|
static |
Set Charge and Temperature Units Menu.
Definition at line 878 of file DC1812AA.ino.
|
static |
Settings Menu.
Definition at line 551 of file DC1812AA.ino.
|
static |
Alert Threshold Menu.
Definition at line 602 of file DC1812AA.ino.
|
static |
Prescalar Menu.
Definition at line 760 of file DC1812AA.ino.
|
static |
Print the Prompt.
Definition at line 215 of file DC1812AA.ino.
|
static |
Print the title block.
Definition at line 202 of file DC1812AA.ino.
|
static |
|
static |
Initialize Linduino.
Definition at line 127 of file DC1812AA.ino.
|
static |
#define AUTOMATIC_MODE_DISPLAY_DELAY 1000 |
The delay between readings in automatic mode.
Definition at line 111 of file DC1812AA.ino.
#define SCAN_MODE_DISPLAY_DELAY 10000 |
The delay between readings in scan mode.
Definition at line 112 of file DC1812AA.ino.
const char ack_error[] = "Error: No Acknowledge. Check I2C Address." |
Error message.
Definition at line 118 of file DC1812AA.ino.
|
static |
Value stored or read from ALERT register.
Shared between loop() and restore_alert_settings()
Definition at line 124 of file DC1812AA.ino.
|
static |
Set to 1 if the board is connected.
Definition at line 123 of file DC1812AA.ino.
const float resistor = .100 |
resistor value on demo board
Definition at line 115 of file DC1812AA.ino.