![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
Linear Technology DC14968B-B Demonstration Board. More...
Linear Technology DC14968B-B Demonstration Board.
LTC2942: Battery Gas Gauge with Temperature, Voltage Measurement
Linear Technology DC14968B-A Demonstration Board. LTC2941: Battery Gas Gauge with I2C Interface
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, 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 - Manual Voltage Mode - Provides a SnapShot of the Voltage, 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. 3 - Manual Temperature Mode - Provides a SnapShot of the 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 LTC2942 is shutdown. In this mode only charge is accumulated. 5 - Shutdown Mode - The LTC2942 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. For use with LTC2941 ignore calls to temperature and voltage as these are not present in LTC2941. All of the functionality of LTC2941 is supported except Control Register B[7:6] USER INPUT DATA FORMAT: decimal : 1024 hex : 0x400 octal : 02000 (leading 0 "zero") binary : B10000000000 float : 1024.0
http://www.linear.com/product/LTC2942 http://www.linear.com/product/LTC2941
http://www.linear.com/product/LTC2942#demoboards http://www.linear.com/product/LTC2941#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 DC1496BB.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_manual_voltage_mode (int8_t mAh_or_Coulombs, int8_t celcius_or_kelvin, uint16_t prescalar_mode, uint16_t prescalarValue, uint16_t alcc_mode) |
Manual Voltage Mode. More... | |
static int8_t | menu_3_manual_temperature_mode (int8_t mAh_or_Coulombs, int8_t celcius_or_kelvin, uint16_t prescalar_mode, uint16_t prescalarValue, uint16_t alcc_mode) |
Manual Voltage 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_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 888 of file DC1496BB.ino.
bool isBitSet | ( | uint8_t | value, |
uint8_t | position | ||
) |
Checks to see if a bit in a certain position is set.
Definition at line 882 of file DC1496BB.ino.
|
static |
Repeats Linduino loop.
Definition at line 153 of file DC1496BB.ino.
|
static |
Automatic Mode.
Definition at line 228 of file DC1496BB.ino.
|
static |
Manual Voltage Mode.
Definition at line 314 of file DC1496BB.ino.
|
static |
Manual Voltage Mode.
Definition at line 384 of file DC1496BB.ino.
|
static |
Sleep Mode.
Definition at line 460 of file DC1496BB.ino.
|
static |
Shutdown Mode.
Definition at line 518 of file DC1496BB.ino.
|
static |
Set Charge Threshold Function.
Definition at line 620 of file DC1496BB.ino.
|
static |
Set Voltage Thresholds.
Definition at line 644 of file DC1496BB.ino.
|
static |
AL#/CC# Pin Mode Menu.
Definition at line 785 of file DC1496BB.ino.
|
static |
Set Temperature Thresholds.
Definition at line 675 of file DC1496BB.ino.
|
static |
Set Charge and Temperature Units Menu.
Definition at line 830 of file DC1496BB.ino.
|
static |
Settings Menu.
Definition at line 527 of file DC1496BB.ino.
|
static |
Alert Threshold Menu.
Definition at line 578 of file DC1496BB.ino.
|
static |
Prescalar Menu.
Definition at line 707 of file DC1496BB.ino.
|
static |
Print the Prompt.
Definition at line 216 of file DC1496BB.ino.
|
static |
Print the title block.
Definition at line 203 of file DC1496BB.ino.
|
static |
|
static |
Initialize Linduino.
Definition at line 128 of file DC1496BB.ino.
|
static |
#define AUTOMATIC_MODE_DISPLAY_DELAY 1000 |
The delay between readings in automatic mode.
Definition at line 114 of file DC1496BB.ino.
#define SCAN_MODE_DISPLAY_DELAY 10000 |
The delay between readings in scan mode.
Definition at line 115 of file DC1496BB.ino.
const char ack_error[] = "Error: No Acknowledge. Check I2C Address." |
Error message.
Definition at line 119 of file DC1496BB.ino.
|
static |
Value stored or read from ALERT register.
Shared between loop() and restore_alert_settings()
Definition at line 125 of file DC1496BB.ino.
|
static |
Set to 1 if the board is connected.
Definition at line 124 of file DC1496BB.ino.
const float resistor = .100 |
resistor value on demo board
Definition at line 116 of file DC1496BB.ino.