| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions | Macros | Variables
DC2839A.ino File Reference
Power Monitors and Coulomb Counters » LTC6115: High-Voltage High Side Current and Voltage Sense

Analog Devices DC2839A Demonstration Board. More...

## Detailed Description

Analog Devices DC2839A Demonstration Board.

LTC6115: High Voltage High Side Current and Voltage Sense.

    NOTES
      Setup:
       Set the terminal baud rate to 115200 and select the newline terminator. Equipment
       required is a voltage source (preferably low-noise) and a precision voltmeter.
       Ensure all jumpers on the demo board are installed in their default positions
       from the factory. Refer to Demo Manual for LTC6115.

      How to test:
       The voltage source should be connected to input AIN+/AIN-. Ensure the
       input is within its specified absolute input voltage range. (It is easiest
       to tie the voltage source negative terminal to COM.) Ensure the voltage
       source is set within the range of 0V to +5.00V.

    USER INPUT DATA FORMAT:
     decimal : 1024
     hex     : 0x400
     octal   : 02000  (leading 0 "zero")
     binary  : B10000000000
     float   : 1024.0

https://www.analog.com/en/products/ltc6115.html

Copyright (c) 2018, Analog Devices Inc. (ADI) All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. 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.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 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.

The views and conclusions contained in the software and documentation are those of the authors and should not be interpreted as representing official policies, either expressed or implied, of Analog Devices Inc.

The Analog Devices Linduino is not affiliated with the official Arduino team. However, the Linduino is only possible because of the Arduino team's commitment to the open-source community. Please, visit http://www.arduino.cc and http://store.arduino.cc , and consider a purchase that will help fund their ongoing work.

Definition in file DC2839A.ino.

Go to the source code of this file.

## Functions
static void | print_title ()
| Prints the title block when program first starts. More...
static void | print_prompt ()
| Prints main menu. More...
static void | setup ()
| Initialize Linduino. More...
static void | loop ()
| Repeats Linduino loop. More...
static float | menu_1_convert_read ()
| Read channel. More...
static void | menu_2_changeVGain ()
static void | menu_3_changeIGain ()
| Select current channel transimpedance gain (V/A) More...
static void | menu_4_changeSampleFreq ()
| Changes the sampling frequency (ms) More...
static void | update_compare_reg (uint32_t regVal)
| Updates the compare match register. More...
static void | menu_5_pipeToFile ()
| Pipes voltage and current reading results to a file. More...
static void | menu_6_stopSampling ()
| Stops the sampling from menu 5. More...
| ISR (TIMER1_COMPA_vect)
| Timer Compare Interrupt Service Routine. More...

## Macros
#define | LTC6115_GPIO QUIKEVAL_GPIO
| Linduino QuikEval GPIO pin (QuikEval connector pin 14) connects to Arduino pin 9. More...

## Variables
volatile float | start_millis
| Start time when menu 4 function is called. More...
volatile float | current_millis
| Number of elapsed milliseconds since the program started running. More...
volatile float | globaltime_ms
| Number of elapsed milliseconds since menu 4 function is called. More...
volatile int | ISR_flag
| Set to 1 when interrupt service routine is running. More...
volatile int | samples_counter
| Counts the number of samples taken. More...
volatile int | num_samples
| Total number of samples that the user desires. More...
static int | update_interval
| Sampling interval(ms) to update to. More...
static int | compare_reg
| Value to set compare match register to get desired interrupt frequency (Hz) More...
volatile int | print_flag
| Set to 1 to print sampling data for menu option 4. More...
volatile int | ISR_prompt_flag
| Set to 1 to print prompt after interrupt service completes. More...
volatile uint32_t | readV
| Stores voltage reading. More...
volatile uint32_t | readI
| Stores current reading. More...

## Function Documentation

## ◆ ISR()

ISR | ( | TIMER1_COMPA_vect |  | ) |

Timer Compare Interrupt Service Routine.

Definition at line 396 of file DC2839A.ino.

## ◆ loop()

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

Repeats Linduino loop.

Returns
  void

Definition at line 169 of file DC2839A.ino.

## ◆ menu_1_convert_read()

static float menu_1_convert_read | ( |  | ) |
| static

Read channel.

Returns
  void

Definition at line 253 of file DC2839A.ino.

## ◆ menu_2_changeVGain()

static void menu_2_changeVGain | ( |  | ) |
| static

Returns
  void

Definition at line 289 of file DC2839A.ino.

## ◆ menu_3_changeIGain()

static void menu_3_changeIGain | ( |  | ) |
| static

Select current channel transimpedance gain (V/A)

Returns
  void

Definition at line 311 of file DC2839A.ino.

## ◆ menu_4_changeSampleFreq()

static void menu_4_changeSampleFreq | ( |  | ) |
| static

Changes the sampling frequency (ms)

Returns
  void

Definition at line 333 of file DC2839A.ino.

## ◆ menu_5_pipeToFile()

static void menu_5_pipeToFile | ( |  | ) |
| static

Pipes voltage and current reading results to a file.

Returns
  void

Definition at line 370 of file DC2839A.ino.

## ◆ menu_6_stopSampling()

static void menu_6_stopSampling | ( |  | ) |
| static

Stops the sampling from menu 5.

Returns
  void

Definition at line 390 of file DC2839A.ino.

## ◆ print_prompt()

static void print_prompt | ( |  | ) |
| static

Prints main menu.

Returns
  void

Definition at line 448 of file DC2839A.ino.

## ◆ print_title()

static void print_title | ( | void |  | ) |
| static

Prints the title block when program first starts.

Returns
  void

Definition at line 432 of file DC2839A.ino.

## ◆ setup()

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

Initialize Linduino.

Returns
  void

Definition at line 107 of file DC2839A.ino.

## ◆ update_compare_reg()

static void update_compare_reg | ( | uint32_t | regVal | ) |
| static

Updates the compare match register.

Returns
  void

Definition at line 361 of file DC2839A.ino.

## Macro Definition Documentation

## ◆ LTC6115_GPIO

#define LTC6115_GPIO QUIKEVAL_GPIO

Linduino QuikEval GPIO pin (QuikEval connector pin 14) connects to Arduino pin 9.

Definition at line 82 of file DC2839A.ino.

## Variable Documentation

## ◆ compare_reg

int compare_reg
| static

Value to set compare match register to get desired interrupt frequency (Hz)

Definition at line 99 of file DC2839A.ino.

## ◆ current_millis

volatile float current_millis

Number of elapsed milliseconds since the program started running.

Definition at line 93 of file DC2839A.ino.

## ◆ globaltime_ms

volatile float globaltime_ms

Number of elapsed milliseconds since menu 4 function is called.

Definition at line 94 of file DC2839A.ino.

## ◆ ISR_flag

volatile int ISR_flag

Set to 1 when interrupt service routine is running.

Definition at line 95 of file DC2839A.ino.

## ◆ ISR_prompt_flag

volatile int ISR_prompt_flag

Set to 1 to print prompt after interrupt service completes.

Definition at line 101 of file DC2839A.ino.

## ◆ num_samples

volatile int num_samples

Total number of samples that the user desires.

Definition at line 97 of file DC2839A.ino.

## ◆ print_flag

volatile int print_flag

Set to 1 to print sampling data for menu option 4.

Definition at line 100 of file DC2839A.ino.

## ◆ readI

volatile uint32_t readI

Stores current reading.

Definition at line 103 of file DC2839A.ino.

## ◆ readV

volatile uint32_t readV

Stores voltage reading.

Definition at line 102 of file DC2839A.ino.

## ◆ samples_counter

volatile int samples_counter

Counts the number of samples taken.

Definition at line 96 of file DC2839A.ino.

## ◆ start_millis

volatile float start_millis

Start time when menu 4 function is called.

Definition at line 92 of file DC2839A.ino.

## ◆ update_interval

int update_interval
| static

Sampling interval(ms) to update to.

Definition at line 98 of file DC2839A.ino.