![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
DC1812A-B LTC2944: Multicell Battery Gas Gauge with Temperature, Voltage and Current Measurement. More...
DC1812A-B LTC2944: 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 LTC2944 is shutdown. In this mode only charge is accumulated. 5 - Shutdown Mode - The LTC2944 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-B. USER INPUT DATA FORMAT: decimal : 1024 hex : 0x400 octal : 02000 (leading 0 "zero") binary : B10000000000 float : 1024.0
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 DC1812A-B.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 925 of file DC1812A-B.ino.
bool isBitSet | ( | uint8_t | value, |
uint8_t | position | ||
) |
Checks to see if a bit in a certain position is set.
Definition at line 919 of file DC1812A-B.ino.
|
static |
Repeats Linduino loop.
Definition at line 141 of file DC1812A-B.ino.
|
static |
Automatic Mode.
Definition at line 216 of file DC1812A-B.ino.
|
static |
Scan Mode.
Definition at line 296 of file DC1812A-B.ino.
|
static |
Manual Mode.
Definition at line 377 of file DC1812A-B.ino.
|
static |
Sleep Mode.
Definition at line 470 of file DC1812A-B.ino.
|
static |
Shutdown Mode.
Definition at line 531 of file DC1812A-B.ino.
|
static |
Set Charge Threshold Function.
Definition at line 637 of file DC1812A-B.ino.
|
static |
Set Voltage Thresholds.
Definition at line 661 of file DC1812A-B.ino.
|
static |
AL#/CC# Pin Mode Menu.
Definition at line 822 of file DC1812A-B.ino.
|
static |
Set Current Thresholds.
Definition at line 689 of file DC1812A-B.ino.
|
static |
Set Temperature Thresholds.
Definition at line 718 of file DC1812A-B.ino.
|
static |
Set Charge and Temperature Units Menu.
Definition at line 867 of file DC1812A-B.ino.
|
static |
Settings Menu.
Definition at line 540 of file DC1812A-B.ino.
|
static |
Alert Threshold Menu.
Definition at line 591 of file DC1812A-B.ino.
|
static |
Prescalar Menu.
Definition at line 749 of file DC1812A-B.ino.
|
static |
Print the Prompt.
Definition at line 204 of file DC1812A-B.ino.
|
static |
Print the title block.
Definition at line 191 of file DC1812A-B.ino.
|
static |
|
static |
Initialize Linduino.
Definition at line 116 of file DC1812A-B.ino.
|
static |
#define AUTOMATIC_MODE_DISPLAY_DELAY 1000 |
The delay between readings in automatic mode.
Definition at line 102 of file DC1812A-B.ino.
#define SCAN_MODE_DISPLAY_DELAY 10000 |
The delay between readings in scan mode.
Definition at line 103 of file DC1812A-B.ino.
const char ack_error[] = "Error: No Acknowledge. Check I2C Address." |
Error message.
Definition at line 107 of file DC1812A-B.ino.
|
static |
Value stored or read from ALERT register.
Shared between loop() and restore_alert_settings()
Definition at line 113 of file DC1812A-B.ino.
|
static |
Set to 1 if the board is connected.
Definition at line 112 of file DC1812A-B.ino.
const float resistor = .100 |
resistor value on demo board
Definition at line 104 of file DC1812A-B.ino.