| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions | Macros | Variables
DC2343A.ino File Reference
Switching Regulators, Battery Chargers, and LED Drivers » LTC3335: Nanopower Buck-Boost DC/DC with Integrated Coulomb Counter

Linear Technology DC934 Demonstration Board. More...

## Detailed Description

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:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- The use of this software may or may not infringe the patent rights of one or more patent holders. This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
- Use of the software either in source or binary form, must be run on or directly connected to an Analog Devices Inc. component.

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...

## Function Documentation

## ◆ loop()

static void loop | ( | void |  | ) |
| static

Repeats Linduino Loop.

Definition at line 162 of file DC2343A.ino.

## ◆ setup()

static void setup | ( | void |  | ) |
| static

Initialize Linduino.

Definition at line 136 of file DC2343A.ino.

## Macro Definition Documentation

## ◆ CURRENT_REFRESH_INTERVAL

#define CURRENT_REFRESH_INTERVAL 5000

Definition at line 96 of file DC2343A.ino.

## ◆ REFRESH_INTERVAL

#define REFRESH_INTERVAL 1000

Definition at line 95 of file DC2343A.ino.

## Variable Documentation

## ◆ alarms

LTC3335_ALARM_TYPE alarms

active alarms read from the LTC3335.

Definition at line 112 of file DC2343A.ino.

## ◆ current

uint16_t current
| static

the current measurement from the LTC3335's counter test mode.

Definition at line 114 of file DC2343A.ino.

## ◆ current_refresh_time_last

uint16_t current_refresh_time_last
| static

Variable to schedule LTC3335 current measurement averaging at CURRENT_REFRESH_INTERVAL.

Definition at line 107 of file DC2343A.ino.

## ◆ data_point_counter

uint32_t data_point_counter
| static

counts the number of datapoints output to terminal screen.

Definition at line 109 of file DC2343A.ino.

## ◆ discharged_capacity

uint32_t discharged_capacity
| 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.

## ◆ refresh_time_last

uint16_t refresh_time_last
| static

Variable to schedule LTC3335 polling and data output at REFRESH_INTERVAL.

Definition at line 106 of file DC2343A.ino.

## ◆ vbat

uint16_t vbat = LTC3335_VBAT_TYP
| static

battery voltage, optimally measured with an adc, set to a constant in this sketch

Definition at line 117 of file DC2343A.ino.