| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions | Enumerations | Variables
DC1410AB.ino File Reference
Analog-to-Digital Converters (ADC) » LTC2449: 24-Bit, 16-Channel Delta Sigma ADCs with Selectable Speed/Resolution

Linear Technology DC1410A-B Demonstration Board. More...

## Detailed Description

Linear Technology DC1410A-B Demonstration Board.

LTC2449: 24-Bit, 16-Channel Delta Sigma ADC with SPI interface

    NOTES
      Setup:
       Set the terminal baud rate to 115200 and select the newline terminator. Equipment
       required is a precision voltage source and a precision voltmeter. Additionally,
       an external power supply is required to provide a negative voltage for Amp V-.
       Set it to anywhere from -1V to -5V. Set Amp V+ to Vcc. Ensure the COM and REF-
       pins are connected to ground. The REF+ pin should be connected to +5V.

      How Measure a Load Cell:
       The LTC2449 allowas a wide common mode range of 0V to Vcc. The LT1678 OPAMP common
       mode range is V- + 1.5 to V+ - 0.8V. Ensure the load cell sensor meets the requirments
       of the ADC and amplifier. Lastly, set the desired gain and read in differential mode.

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

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

http://www.linear.com/product/LTC2449#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 DC1410AB.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 | print_user_command (uint8_t menu)
static uint8_t | menu_1_read_differential ()
| Read channels in differential mode. More...
static void | set_gain (uint8_t a_pin, uint8_t b_pin, uint8_t gain)
| Set the Mux select pins to the desired gain. More...
static void | init_gain_pins (uint8_t a_pin, uint8_t b_pin)
| initialize the MUX select pins More...
static void | menu_2_set_osr ()
| Allows the user to sets the desired OSR. More...
static void | menu_3_set_channel_gain ()
| Allows the user to sets the desired gain. More...
static void | print_gain (uint8_t gain)
| Utility function to display the gain. More...
static void | setup ()
| Initialize Linduino. More...
static void | loop ()
| Repeats Linduino loop. More...

## Enumerations
enum | Av { unity, g8, g16, g32, unity, g8, g16, g32 }

## Variables
static uint8_t | demo_board_connected
| Set to 1 if the board is connected. More...
static uint16_t | osr = LTC2449_OSR_32768
| Default OSR is 32768. More...
static float | LTC2449_lsb = 5.0 / 536870911
| The LTC2449 ideal reference voltage. More...
static uint16_t | eoc_timeout = 250
| Timeout in ms. More...
static uint8_t | filt_flag = 1
| Keeps track when filters need to be reset. More...
static uint8_t | channel_gain [6] = {g32, g32, g32, g32, g32, g32}
| default is gain 32 More...
const uint16_t | read_command_seq []
| Lookup table for reads. More...
static uint8_t | read_gain_seq []
| Lookup table for gain setting reads. More...
const uint16_t | OSR_COMMAND []
| Lookup table for OSR. More...
const uint8_t | A_PIN = 4
| Gain MUX pins. More...
const uint8_t | B_PIN = 7
const float | smoothing_const = 0.7
| Exponential filter smothing constant for the offset. More...

## Function Documentation

## ◆ init_gain_pins()

static void init_gain_pins | ( | uint8_t | a_pin,
|  | uint8_t | b_pin
| ) |  |
| static

initialize the MUX select pins

Definition at line 345 of file DC1410AB.ino.

## ◆ loop()

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

Repeats Linduino loop.

Definition at line 157 of file DC1410AB.ino.

## ◆ menu_1_read_differential()

static uint8_t menu_1_read_differential | ( |  | ) |
| static

Read channels in differential mode.

Returns
  Returns 0=successful, 1=unsuccessful (exceeded timeout)

Definition at line 216 of file DC1410AB.ino.

## ◆ menu_2_set_osr()

static void menu_2_set_osr | ( |  | ) |
| static

Allows the user to sets the desired OSR.

Definition at line 459 of file DC1410AB.ino.

## ◆ menu_3_set_channel_gain()

static void menu_3_set_channel_gain | ( |  | ) |
| static

Allows the user to sets the desired gain.

Definition at line 354 of file DC1410AB.ino.

## ◆ print_gain()

static void print_gain | ( | uint8_t | gain | ) |
| static

Utility function to display the gain.

Definition at line 439 of file DC1410AB.ino.

## ◆ print_prompt()

static void print_prompt | ( |  | ) |
| static

Prints main menu.

Definition at line 206 of file DC1410AB.ino.

## ◆ print_title()

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

Prints the title block when program first starts.

Definition at line 191 of file DC1410AB.ino.

## ◆ print_user_command()

static void print_user_command | ( | uint8_t | menu | ) |
| static

## ◆ set_gain()

static void set_gain | ( | uint8_t | a_pin,
|  | uint8_t | b_pin,
|  | uint8_t | gain
| ) |  |
| static

Set the Mux select pins to the desired gain.

Definition at line 338 of file DC1410AB.ino.

## ◆ setup()

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

Initialize Linduino.

Definition at line 132 of file DC1410AB.ino.

## Enumeration Type Documentation

## ◆ Av

enum Av

Enumerator
unity |
g8 |
g16 |
g32 |
unity |
g8 |
g16 |
g32 |

Definition at line 97 of file DC1410AB.ino.

## Variable Documentation

## ◆ A_PIN

const uint8_t A_PIN = 4

Gain MUX pins.

Definition at line 125 of file DC1410AB.ino.

## ◆ B_PIN

const uint8_t B_PIN = 7

Definition at line 126 of file DC1410AB.ino.

## ◆ channel_gain

uint8_t channel_gain[6] = {g32, g32, g32, g32, g32, g32}
| static

default is gain 32

Definition at line 105 of file DC1410AB.ino.

## ◆ demo_board_connected

uint8_t demo_board_connected
| static

Set to 1 if the board is connected.

Definition at line 100 of file DC1410AB.ino.

## ◆ eoc_timeout

uint16_t eoc_timeout = 250
| static

Timeout in ms.

Definition at line 103 of file DC1410AB.ino.

## ◆ filt_flag

uint8_t filt_flag = 1
| static

Keeps track when filters need to be reset.

Definition at line 104 of file DC1410AB.ino.

## ◆ LTC2449_lsb

float LTC2449_lsb = 5.0 / 536870911
| static

The LTC2449 ideal reference voltage.

Definition at line 102 of file DC1410AB.ino.

## ◆ osr

uint16_t osr = LTC2449_OSR_32768
| static

Default OSR is 32768.

Definition at line 101 of file DC1410AB.ino.

## ◆ OSR_COMMAND

const uint16_t OSR_COMMAND[]

Initial value:
= {LTC2449_OSR_64, LTC2449_OSR_128, LTC2449_OSR_256, LTC2449_OSR_512, LTC2449_OSR_1024,
LTC2449_OSR_2048, LTC2449_OSR_4096, LTC2449_OSR_8192, LTC2449_OSR_16384, LTC2449_OSR_32768
}
LTC2449_OSR_2048
#define LTC2449_OSR_2048
Definition: LTC2449.h:217
LTC2449_OSR_32768
#define LTC2449_OSR_32768
Definition: LTC2449.h:221
LTC2449_OSR_8192
#define LTC2449_OSR_8192
Definition: LTC2449.h:219
LTC2449_OSR_16384
#define LTC2449_OSR_16384
Definition: LTC2449.h:220
LTC2449_OSR_512
#define LTC2449_OSR_512
Definition: LTC2449.h:215
LTC2449_OSR_64
#define LTC2449_OSR_64
Definition: LTC2449.h:212
LTC2449_OSR_128
#define LTC2449_OSR_128
Definition: LTC2449.h:213
LTC2449_OSR_1024
#define LTC2449_OSR_1024
Definition: LTC2449.h:216
LTC2449_OSR_256
#define LTC2449_OSR_256
Definition: LTC2449.h:214
LTC2449_OSR_4096
#define LTC2449_OSR_4096
Definition: LTC2449.h:218

Lookup table for OSR.

Build the command for OSR

Definition at line 120 of file DC1410AB.ino.

## ◆ read_command_seq

const uint16_t read_command_seq[]

Initial value:
= {LTC2449_P12_N13,
LTC2449_P14_N15, LTC2449_P14_N15, LTC2449_P14_N15, LTC2449_P14_N15,
LTC2449_P0_N1, LTC2449_P2_N3, LTC2449_P4_N5, LTC2449_P6_N7, LTC2449_P8_N9,
LTC2449_P10_N11, LTC2449_P10_N11
}
LTC2449_P10_N11
#define LTC2449_P10_N11
Definition: LTC2449.h:191
LTC2449_P14_N15
#define LTC2449_P14_N15
Definition: LTC2449.h:197
LTC2449_P6_N7
#define LTC2449_P6_N7
Definition: LTC2449.h:185
LTC2449_P0_N1
#define LTC2449_P0_N1
Definition: LTC2449.h:176
LTC2449_P12_N13
#define LTC2449_P12_N13
Definition: LTC2449.h:194
LTC2449_P4_N5
#define LTC2449_P4_N5
Definition: LTC2449.h:182
LTC2449_P2_N3
#define LTC2449_P2_N3
Definition: LTC2449.h:179
LTC2449_P8_N9
#define LTC2449_P8_N9
Definition: LTC2449.h:188

Lookup table for reads.

Channel read sequence for the demo board

Definition at line 109 of file DC1410AB.ino.

## ◆ read_gain_seq

uint8_t read_gain_seq[]
| static

Initial value:
= {unity, unity, unity, g8, g16, g32, channel_gain[0], channel_gain[1], channel_gain[2], channel_gain[3],
channel_gain[4], channel_gain[5]
}
g16
Definition: DC1410AB.ino:97
g8
Definition: DC1410AB.ino:97
channel_gain
static uint8_t channel_gain[6]
default is gain 32
Definition: DC1410AB.ino:105
unity
Definition: DC1410AB.ino:97
g32
Definition: DC1410AB.ino:97

Lookup table for gain setting reads.

The gain sequence for the auto calibration

Definition at line 116 of file DC1410AB.ino.

## ◆ smoothing_const

const float smoothing_const = 0.7

Exponential filter smothing constant for the offset.

Definition at line 129 of file DC1410AB.ino.