![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
Linear Technology DC934 Demonstration Board. More...
Linear Technology DC934 Demonstration Board.
LTC3335: Nanopower Buck-Boost DC/DC with Integrated Coulomb Counter
This sketch demonstrates the LTC3335 using the DC2343A demo board. The data read from the data board is displayed on a serial terminal using 115200 baud, and newline terminations for data input. Code will build for configuration specified in LTC3335_Config.h. 1. The selected output voltage is specified by LTC3335_OUTPUT_VOLTAGE. 2. The LTC3335 prescaler will be chosen appropriately for the battery capacity specified by LTC3335_CAPACITY. 3. The LTC3335 alarm will be chosen appropriately for the value specified by LTC3335_ALARM_CAPACITY. 4. The coulomb count and battery current measurement will be scaled accordingly to the LTC3335 prescaler selected by LTC3335_CAPACITY and the LTC3335_IPEAK_CONFIGURATION, setting. 5. Set LTC3335_USE_CURRENT_MEASUREMENT if you wish to use the LTC3335 battery current measurement. 6. Set LTC3335_USE_SOFTWARE_CORRECTION if you wish to use correction of the LTC3335 coulomb count and battery current measurement. A value of LTC3335_VBAT_TYP must be specified for this sketch as it can not measure the actual battery voltage, and must assume a constant value. Applications reusing this code would improve performance if the actual battery voltage was measured and used for the correction functions. See the DC2343A schematic for a circuit which measures the battery voltage with >10nA of average current drawn from the battery.
To use the Linduino with the DC2343A, the PIC16 on the DC2343A must be disconnected by removing the DC2343-ASSY1 PCB from JP5:
A cable must then be constructed to connect the Linduino to the DC2343A as shown:
http://www.linear.com/product/LTC3335
http://www.linear.com/product/LTC3335#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 DC2343A.ino.
Go to the source code of this file.
Functions | |
static void | setup () |
Initialize Linduino. More... | |
static void | loop () |
Repeats Linduino Loop. More... | |
Macros | |
#define | REFRESH_INTERVAL 1000 |
#define | CURRENT_REFRESH_INTERVAL 5000 |
Variables | |
static uint16_t | refresh_time_last |
Variable to schedule LTC3335 polling and data output at REFRESH_INTERVAL. More... | |
static uint16_t | current_refresh_time_last |
Variable to schedule LTC3335 current measurement averaging at CURRENT_REFRESH_INTERVAL. More... | |
static uint32_t | data_point_counter |
counts the number of datapoints output to terminal screen. More... | |
static uint32_t | discharged_capacity |
in mAs, the discharged capacity calculated from the LTC3335 accumulator and More... | |
LTC3335_ALARM_TYPE | alarms |
active alarms read from the LTC3335. More... | |
static uint16_t | current |
the current measurement from the LTC3335's counter test mode. More... | |
static uint16_t | vbat = LTC3335_VBAT_TYP |
battery voltage, optimally measured with an adc, set to a constant in this sketch More... | |
|
static |
Repeats Linduino Loop.
Definition at line 162 of file DC2343A.ino.
|
static |
Initialize Linduino.
Definition at line 136 of file DC2343A.ino.
#define CURRENT_REFRESH_INTERVAL 5000 |
Definition at line 96 of file DC2343A.ino.
#define REFRESH_INTERVAL 1000 |
Definition at line 95 of file DC2343A.ino.
LTC3335_ALARM_TYPE alarms |
active alarms read from the LTC3335.
Definition at line 112 of file DC2343A.ino.
|
static |
the current measurement from the LTC3335's counter test mode.
Definition at line 114 of file DC2343A.ino.
|
static |
Variable to schedule LTC3335 current measurement averaging at CURRENT_REFRESH_INTERVAL.
Definition at line 107 of file DC2343A.ino.
|
static |
counts the number of datapoints output to terminal screen.
Definition at line 109 of file DC2343A.ino.
|
static |
in mAs, the discharged capacity calculated from the LTC3335 accumulator and
quiescent losses (if software correction is enabled).
Definition at line 110 of file DC2343A.ino.
|
static |
Variable to schedule LTC3335 polling and data output at REFRESH_INTERVAL.
Definition at line 106 of file DC2343A.ino.
|
static |
battery voltage, optimally measured with an adc, set to a constant in this sketch
Definition at line 117 of file DC2343A.ino.