| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions | Variables
DC682A.ino File Reference
Analog-to-Digital Converters (ADC) » LTC1859: 16-Bit 8-Channel 200ksps ADC

Linear Technology DC682A Demonstration Board. More...

## Detailed Description

Linear Technology DC682A Demonstration Board.

LTC1859: 16-Bit, 8-Channel 100ksps SAR ADC with SPI Interface.

    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. No
       external power supply is required. Ensure all jumpers on the demo board are
       installed in their default positions from the factory. Refer to Demo Manual
       DC682A.

      How to test Single-Ended mode:
       Bipolar Mode:
        The voltage source should be connected to one of the inputs CH0,...CH7. 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 +5V for low range, or 0V to 10V for high range.
        (Swapping input voltages results in a reversed polarity reading.)

       Unipolar Mode:
        The voltage source should be connected to one of the inputs CH0,...CH7. 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 +5V for low range, or 0V to 10V for high range.

      How to test Differential Mode:
       Bipolar Mode:
         The voltage source should be connected between paired channels. Ensure both
         inputs are within their specified absolute input voltage range. (It is easiest
         to tie the voltage source negative terminal to COM or GND.) Ensure the voltage
         source is set within the range of 0V to +5V for low range, or 0V to 10V for high range (differential voltage range).
         (Swapping input voltages results in a reversed polarity reading.)

       Unipolar Mode:
         The voltage source should be connected between paired channels. (It is easiest
         to tie the voltage source negative terminal to COM or GND.) Ensure both inputs
         are within their specified absolute input voltage range.  (It is easiest to tie
         the voltage source negative terminal to COM or GND.) Ensure the voltage source
         is set within the range of 0V to +5V for low range, or 0V to 10V for high range (differential voltage range).

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

http://www.linear.com/product/LTC1859

http://www.linear.com/product/LTC1859#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 DC682A.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 uint8_t | print_user_command_differential ()
| Display selected differential channels. More...
static uint8_t | print_user_command_single_ended ()
| Display selected single-ended channel. More...
static void | print_channel_selection (uint8_t menu)
| Display selected differential channels. More...
static void | menu_1_read_input ()
| Read channels. More...
static void | menu_2_select_single_ended_differential ()
| Sets LTC1859 to Single-Ended or Differential. More...
static void | menu_3_select_uni_bipolar ()
| Select unipolar (0-REFCOMP) or bipolar (+/- 0.5 x REFCOMP) mode. More...
static void | menu_4_select_range ()
| Select low range or high range mode. More...
static void | menu_5_sleep ()
| Put LTC1859 to sleep (low power) More...
static void | setup ()
| Initialize Linduino. More...
static void | loop ()
| Repeats Linduino loop. More...

## Variables
static uint8_t | uni_bipolar = LTC1859_UNIPOLAR_MODE
| Default set for unipolar mode. More...
static uint8_t | single_ended_differential = LTC1859_SINGLE_ENDED_MODE
| LTC1859 Unipolar or Bipolar mode selection. More...
static uint8_t | range_low_high = LTC1859_HIGH_RANGE_MODE
| Default set for high range mode. More...
static float | LTC1859_bits = 16
| Resolution (16 bits) More...
static float | LTC1859_vref = 10
const uint8_t | BUILD_COMMAND_SINGLE_ENDED [8]
| Lookup table to build the command for single-ended mode, input with respect to GND. More...
const uint8_t | BUILD_COMMAND_DIFF [8]
| Lookup table to build the command for differential mode with the selected uni/bipolar mode. More...

## Function Documentation

## ◆ loop()

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

Repeats Linduino loop.

Definition at line 152 of file DC682A.ino.

## ◆ menu_1_read_input()

static void menu_1_read_input | ( |  | ) |
| static

Read channels.

Returns
  1 if successful, 0 if not

Definition at line 193 of file DC682A.ino.

## ◆ menu_2_select_single_ended_differential()

static void menu_2_select_single_ended_differential | ( |  | ) |
| static

Sets LTC1859 to Single-Ended or Differential.

Definition at line 288 of file DC682A.ino.

## ◆ menu_3_select_uni_bipolar()

static void menu_3_select_uni_bipolar | ( |  | ) |
| static

Select unipolar (0-REFCOMP) or bipolar (+/- 0.5 x REFCOMP) mode.

Returns
  void

Definition at line 320 of file DC682A.ino.

## ◆ menu_4_select_range()

static void menu_4_select_range | ( |  | ) |
| static

Select low range or high range mode.

Returns
  void

Definition at line 350 of file DC682A.ino.

## ◆ menu_5_sleep()

static void menu_5_sleep | ( |  | ) |
| static

Put LTC1859 to sleep (low power)

Returns
  void

Definition at line 382 of file DC682A.ino.

## ◆ print_channel_selection()

static void print_channel_selection | ( | uint8_t | menu | ) |
| static

Display selected differential channels.

Displaying single-ended channels is straightforward; not so with differential because the inputs can take either polarity.

Definition at line 491 of file DC682A.ino.

## ◆ print_prompt()

static void print_prompt | ( |  | ) |
| static

Prints main menu.

Definition at line 415 of file DC682A.ino.

## ◆ print_title()

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

Prints the title block when program first starts.

Definition at line 399 of file DC682A.ino.

## ◆ print_user_command_differential()

static uint8_t print_user_command_differential | ( |  | ) |
| static

Display selected differential channels.

Displaying single-ended channels is straightforward; not so with differential because the inputs can take either polarity.

Definition at line 429 of file DC682A.ino.

## ◆ print_user_command_single_ended()

static uint8_t print_user_command_single_ended | ( |  | ) |
| static

Display selected single-ended channel.

Definition at line 524 of file DC682A.ino.

## ◆ setup()

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

Initialize Linduino.

Definition at line 140 of file DC682A.ino.

## Variable Documentation

## ◆ BUILD_COMMAND_DIFF

const uint8_t BUILD_COMMAND_DIFF[8]

Initial value:
= {LTC1859_P0_N1, LTC1859_P2_N3, LTC1859_P4_N5, LTC1859_P6_N7,
LTC1859_P1_N0, LTC1859_P3_N2, LTC1859_P5_N4, LTC1859_P7_N6
}
LTC1859_P3_N2
#define LTC1859_P3_N2
Definition: LTC1859.h:121
LTC1859_P1_N0
#define LTC1859_P1_N0
Definition: LTC1859.h:118
LTC1859_P0_N1
#define LTC1859_P0_N1
Definition: LTC1859.h:117
LTC1859_P7_N6
#define LTC1859_P7_N6
Definition: LTC1859.h:127
LTC1859_P2_N3
#define LTC1859_P2_N3
Definition: LTC1859.h:120
LTC1859_P4_N5
#define LTC1859_P4_N5
Definition: LTC1859.h:123
LTC1859_P6_N7
#define LTC1859_P6_N7
Definition: LTC1859.h:126
LTC1859_P5_N4
#define LTC1859_P5_N4
Definition: LTC1859.h:124

Lookup table to build the command for differential mode with the selected uni/bipolar mode.

Build the command for differential mode

Definition at line 134 of file DC682A.ino.

## ◆ BUILD_COMMAND_SINGLE_ENDED

const uint8_t BUILD_COMMAND_SINGLE_ENDED[8]

Initial value:
= {LTC1859_CH0, LTC1859_CH1, LTC1859_CH2, LTC1859_CH3,
LTC1859_CH4, LTC1859_CH5, LTC1859_CH6, LTC1859_CH7
}
LTC1859_CH6
#define LTC1859_CH6
Definition: LTC1859.h:110
LTC1859_CH3
#define LTC1859_CH3
Definition: LTC1859.h:107
LTC1859_CH0
#define LTC1859_CH0
Definition: LTC1859.h:104
LTC1859_CH1
#define LTC1859_CH1
Definition: LTC1859.h:105
LTC1859_CH7
#define LTC1859_CH7
Definition: LTC1859.h:111
LTC1859_CH4
#define LTC1859_CH4
Definition: LTC1859.h:108
LTC1859_CH5
#define LTC1859_CH5
Definition: LTC1859.h:109
LTC1859_CH2
#define LTC1859_CH2
Definition: LTC1859.h:106

Lookup table to build the command for single-ended mode, input with respect to GND.

Builds the command for single-ended mode, input with respect to GND

Definition at line 129 of file DC682A.ino.

## ◆ LTC1859_bits

float LTC1859_bits = 16
| static

Resolution (16 bits)

Definition at line 124 of file DC682A.ino.

## ◆ LTC1859_vref

float LTC1859_vref = 10
| static

Definition at line 125 of file DC682A.ino.

## ◆ range_low_high

uint8_t range_low_high = LTC1859_HIGH_RANGE_MODE
| static

Default set for high range mode.

Definition at line 123 of file DC682A.ino.

## ◆ single_ended_differential

uint8_t single_ended_differential = LTC1859_SINGLE_ENDED_MODE
| static

LTC1859 Unipolar or Bipolar mode selection.

Definition at line 122 of file DC682A.ino.

## ◆ uni_bipolar

uint8_t uni_bipolar = LTC1859_UNIPOLAR_MODE
| static

Default set for unipolar mode.

Definition at line 121 of file DC682A.ino.