LTC2372-18 - 18-Bit, 500ksps, 8-Channel SAR ADC with 100dB SNR

Features

  • 500ksps Throughput Rate
  • 18-Bit Resolution with No Missing Codes
  • 8-Channel Multiplexer with Selectable Input Range
  • Fully Differential (±4.096V)
  • Pseudo-Differential Unipolar (0V to 4.096V)
  • Pseudo-Differential Bipolar (±2.048V)
  • INL: ±2.75LSB (Maximum)
  • SNR: 100dB (Fully Differential)/95dB (Pseudo-
  • Differential) (Typical) at fIN = 1kHz
  • THD: –110dB (Typical) at fIN = 1kHz
  • Programmable Sequencer
  • Selectable Digital Gain Compression
  • Single 5V Supply with 1.8V to 5V I/O Voltages
  • SPI-Compatible Serial I/O
  • Onboard 2.048V Reference and Reference Buffer
  • No Pipeline Delay, No Cycle Latency
  • Power Dissipation 27mW (Typical)
  • Guaranteed Operation to 125°C
  • 32-Lead 5mm × 5mm QFN Package

Typical Application

LTC2372-18 Typical Application
LTC2372-18 Typical Application

Description

The LTC®2372-18 is a low noise, high speed, 8-channel 18-bit successive approximation register (SAR) ADC. Operating from a single 5V supply, the LTC2372-18 has a highly configurable, low crosstalk 8-channel input multiplexer, supporting fully differential, pseudo-differential unipolar and pseudo-differential bipolar analog input ranges. The LTC2372-18 achieves ±2.75LSB INL (maximum) in all input ranges, no missing codes at 18-bits and 100dB (fully differential)/ 95dB (pseudo-differential) SNR (typical).

The LTC2372-18 has an onboard low drift (20ppm/°C max) 2.048V temperature-compensated reference and a singleshot capable reference buffer. The LTC2372-18 also has a high speed SPI-compatible serial interface that supports 1.8V, 2.5V, 3.3V and 5V logic through which a sequencer with a depth of 16 may be programmed. An internal oscillator sets the conversion time, easing external timing considerations. The LTC2372-18 dissipates only 27mW and automatically naps between conversions, leading to reduced power dissipation that scales with the sampling rate. A sleep mode is also provided to reduce the power consumption of the LTC2372-18 to 300μW for further power savings during inactive periods.

Packaging

CAD Symbols and Footprints: The downloadable Zip file below contains the schematic symbol and PCB footprints.

For complete and up to date package information and drawings, please refer to our packaging page

Part Number Package Code Temp Package
Drawing
RoHS
LTC2372CUH-18#PBF 5x5 QFN-32 UH C 05-08-1693 Yes
LTC2372CUH-18#TRPBF 5x5 QFN-32 UH C 05-08-1693 Yes
LTC2372HUH-18#PBF 5x5 QFN-32 UH H 05-08-1693 Yes
LTC2372HUH-18#TRPBF 5x5 QFN-32 UH H 05-08-1693 Yes
LTC2372IUH-18#PBF 5x5 QFN-32 UH I 05-08-1693 Yes
LTC2372IUH-18#TRPBF 5x5 QFN-32 UH I 05-08-1693 Yes


LTC2372-18 Package Drawing

Order Info

  • Part numbers ending in PBF are lead free. Solder plated terminal finish (SnPb) versions are non-standard and special terms and conditions and pricing applies if available. Please contact LTC marketing for information.
  • Part numbers containing TR or TRM are shipped in tape and reel or 500 unit mini tape and reel, respectively
  • Please refer to our general ordering information or the product datasheet for more details

Package Variations and Pricing

Part Number Package Temp Price
(1-99)
Price
(1k)*
RoHS
LTC2372CUH-18#PBF 5x5 QFN-32 C $18.50 $12.95 Yes
LTC2372CUH-18#TRPBF 5x5 QFN-32 C $18.56 $13.01 Yes
LTC2372HUH-18#PBF 5x5 QFN-32 H $24.47 $17.13 Yes
LTC2372HUH-18#TRPBF 5x5 QFN-32 H $24.53 $17.19 Yes
LTC2372IUH-18#PBF 5x5 QFN-32 I $21.28 $14.89 Yes
LTC2372IUH-18#TRPBF 5x5 QFN-32 I $21.34 $14.95 Yes
Buy NowRequest Samples
* The USA list pricing shown is for BUDGETARY USE ONLY, shown in United States dollars (FOB USA per unit for the stated volume), and is subject to change. International prices may differ due to local duties, taxes, fees and exchange rates. For volume-specific price or delivery quotes, please contact your local Linear Technology sales office or authorized distributor.

Demo Boards

Linear Technology offers many demo boards free of charge to qualified customers. Contact your local sales office or distributor to inquire about a demo board. Certain demo boards are also available for sale via credit card on this website. Demo boards are for evaluation purposes only. It remains the customer’s responsibility to verify proper and reliable operation in the actual end application.

Part Number Description Price Documentation
DC2071A-B LTC2372-18 Demo Board | 18-Bit, 500ksps, 8-Channel SAR ADC with 100dB SNR (req DC590, DC2026 or DC890 $150.00
Buy Now

Companion Boards

Part Number Description Price Documentation
DC2026C Linduino One Isolated USB Demo Board: An Arduino- and QuikEval-Compatible Code Development Platform $75.00
DC590B Isolated USB Serial Controller for Linear Technology QuikEval-Compatible Demo Boards $50.00
DC890B USB Data Acquisition Controller, for PScope Evaluation Kits (up to 250Mbps, CMOS/LVDS) $300.00
Buy Now
Click here to view our complete list of demo boards

Applications

  • Programmable Logic Controllers
  • Industrial Process Control
  • High Speed Data Acquisition
  • Portable or Compact Instrumentation
  • ATE

Product Notifications

Please login to your MyLinear account for notifications of datasheet updates, new document releases and LTspice model announcements for your favorite products. If you do not have a MyLinear account you may Sign Up Now.

Forgot your password? Click here.
Need help? Email mylinear@linear.com with questions and comments.

Design Tools

Linduino

Linduino is an Arduino compatible platform for developing and distributing firmware libraries and code for SPI and I²C-compatible integrated circuits. The Linduino One board interfaces to more than 300 QuikEval demonstration cards, supporting a variety of product types including analog-to-digital converters (ADCs)digital-to-analog converters (DACs)power monitors, and more. Firmware libraries for individual devices are written in C and designed to be portable to a wide variety of processors and microcontrollers. Each library has a demonstration program that can be uploaded to the Linduino One platform to allow the circuit and software to be quickly and easily verified.

Click here for more information on Linduino

Code

Linduino is Linear Technology's Arduino compatible system for developing and distributing firmware libraries and example code for Linear Technology’s integrated circuits. The code below can be downloaded or copied and pasted into your project. Please visit the Linduino Home Page for demo board, manual and setup information.

This part is Family Supported: There is example code available for a part in this family. The code may require some changes to work with this specific part, however it still provides many good examples of how certain interactions should take place. The code below may rely on other drivers available in the full library.

Download LTC2373 - Linduino CPP File

/*!
LTC2373: 16/18-bit 1Msps 8 channel SAR ADC
LTC2372: 16/18-bit 500ksps 8 channel SAR ADC
LTC2374: 16 bit 1.6Msps 8 channel SAR ADC

@verbatim

The LTC2373_16/18 are pin-compatible, 16/18-bit A/D converters with
serial I/O, and an internal reference.

@endverbatim

http://www.linear.com/product/LTC2373-16
http://www.linear.com/product/LTC2373_18
http://www.linear.com/product/LTC2372-16
http://www.linear.com/product/LTC2372-18
http://www.linear.com/product/LTC2374-16

http://www.linear.com/product/LTC2373-16#demoboards
http://www.linear.com/product/LTC2373_18#demoboards
http://www.linear.com/product/LTC2372-16#demoboards
http://www.linear.com/product/LTC2372-18#demoboards
http://www.linear.com/product/LTC2374-16#demoboards

REVISION HISTORY
$Revision: 7190 $
$Date: 2017-07-10 14:58:35 -0700 (Mon, 10 Jul 2017) $

Copyright (c) 2013, Linear Technology Corp.(LTC)
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 Linear Technology Corp.

The Linear Technology 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.
*/

//! @ingroup Analog_to_Digital_Converters
//! @{
//! @defgroup LTC2373 LTC2373: 16/18-bit 1Msps 8 channel SAR ADC
//! @}

/*! @file
    @ingroup LTC2373
    Library for LTC2373: 16/18-bit 1Msps 8 channel SAR ADC
*/

#include <Arduino.h>
#include <stdint.h>
#include "Linduino.h"
#include "LT_I2C.h"
#include "LT_SPI.h"
#include "LTC2373.h"
#include <SPI.h>

// Builds the ADC command
uint8_t LTC2373_build_command(uint8_t sequencer_bit, uint8_t ch_designate, uint8_t range_select, uint8_t gain_compression)
{
  uint8_t adc_command;
  adc_command = sequencer_bit | ch_designate | range_select | gain_compression;

  return (adc_command);
}


// Reads from a SPI LTC2373-XX device that has a configuration word and a 20 bit output word.
void LTC2373_read(uint8_t cs, uint8_t adc_command, uint32_t *ptr_adc_code)
{
//Form a four byte object to hold four bytes of command
  LT_union_int32_4bytes command;  //instantiate the union
  command.LT_byte[3] = adc_command;
  command.LT_byte[2] = 0;
  command.LT_byte[1] = 0;
  command.LT_byte[0] = 0;

//Form a four byte object to hold four bytes of data
  LT_union_int32_4bytes data; //instantiate the union
  data.LT_byte[3] = 0;
  data.LT_byte[2] = 0;
  data.LT_byte[1] = 0;
  data.LT_byte[0] = 0;

  spi_transfer_block(cs,command.LT_byte,data.LT_byte,4);

  *ptr_adc_code = data.LT_int32;

  return;
}


// Programs multiple 8 bit control words to an SPI LTC2373-XX device.
void LTC2373_configure(uint8_t cs, uint32_t adc_configure)
{
//Form a four byte object to hold four bytes of command
  LT_union_int32_4bytes command;  //instantiate the union
  command.LT_uint32 = adc_configure;

//Form a four byte object to hold four bytes of dummy data
  LT_union_int32_4bytes data; //instantiate the union
  data.LT_byte[3] = 0;
  data.LT_byte[2] = 0;
  data.LT_byte[1] = 0;
  data.LT_byte[0] = 0;

  spi_transfer_block(cs,command.LT_byte,data.LT_byte,4);

  return;
}


// Calculates the voltage corresponding to an adc code, given the reference voltage (in volts)
float LTC2373_code_to_voltage(uint8_t adc_command, uint32_t adc_code, float vref)
{
  float voltage, range;
  float sign = 1;
  uint8_t config;

  config = (adc_command >> 1) & 0x03;

  switch (config)
  {
    case (0): //unipolar, 0 to vref
      voltage = (float)adc_code;
      voltage = voltage / (pow(2,32)-1);    //! 2) This calculates the input as a fraction of the reference voltage (dimensionless)
      voltage = voltage * vref;           //! 3) Multiply fraction by Vref to get the actual voltage at the input (in volts)
      break;

    case (1): //bipolar, +/- vref/2, twos complement out
      if ((adc_code>>31) == 1)  //number is < 0
      {
        adc_code = (adc_code ^ 0xFFFFFFFF)+1;                                    //! Convert ADC code from two's complement to binary
        sign = -1;
      }

      voltage = (float)adc_code;
      voltage = voltage / (pow(2,31)-1);    //! 2) This calculates the input as a fraction of the reference voltage (dimensionless)
      voltage = sign * voltage * vref/2;           //! 3) Multiply fraction by Vref to get the actual voltage at the input (in volts)
      break;

    case (2): //differential unipolar, 0 to vref
      voltage = (float)adc_code;
      voltage = voltage / (pow(2,32)-1);    //! 2) This calculates the input as a fraction of the reference voltage (dimensionless)
      voltage = sign * voltage * vref;           //! 3) Multiply fraction by Vref to get the actual voltage at the input (in volts)
      break;

    case (3): //differential bipolar, +/- vref, twos complement out
      if ((adc_code>>31) == 1)  //number is < 0
      {
        adc_code = (adc_code ^ 0xFFFFFFFF)+1;                                    //! Convert ADC code from two's complement to binary
        sign = -1;
      }

      voltage = (float)adc_code;
      voltage = voltage / (pow(2,31)-1);    //! 2) This calculates the input as a fraction of the reference voltage (dimensionless)
      voltage = sign * voltage * vref;           //! 3) Multiply fraction by Vref to get the actual voltage at the input (in volts)
      break;
  }

  return(voltage);
}

Download LTC2373 - Linduino DC2071AA.ino File

/*!
Linear Technology DC2071A Demonstration Board.

LTC2373: 16/18-bit 1Msps 8 channel SAR ADC
LTC2372: 16/18-bit 500ksps 8 channel SAR ADC
LTC2374: 16 bit 1.6Msps 8 channel SAR ADC

Max SCK rate is 100MHz.

@verbatim

NOTES
  Setup:
   Set the terminal baud rate to 115200 and select the newline terminator.
   Equipment required is a precision voltage source (null box) and a precision voltmeter (to monitor voltage source).
   No external power supply is required.
   Ensure JP1 is installed in the default position from the factory.

  How to test:
   The voltage source should be connected with positive and negative leads to the positive & negative ADC inputs. Ensure the differential voltage is within the
   range of -VREF to +VREF. Swapping input voltages results in a reversed polarity reading.

  How to calibrate:
   Enter menu item number "3 - Calibrate" and follow the prompts.
   Calibration is now stored in EEPROM. Upon startup the calibration values will be restored.

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

@endverbatim

http://www.linear.com/product/LTC2373-16
http://www.linear.com/product/LTC2373_18
http://www.linear.com/product/LTC2372-16
http://www.linear.com/product/LTC2372-18
http://www.linear.com/product/LTC2374-16

http://www.linear.com/product/LTC2373-16#demoboards
http://www.linear.com/product/LTC2373_18#demoboards
http://www.linear.com/product/LTC2372-16#demoboards
http://www.linear.com/product/LTC2372-18#demoboards
http://www.linear.com/product/LTC2374-16#demoboards

REVISION HISTORY
$Revision: 7190 $
$Date: 2017-07-10 14:58:35 -0700 (Mon, 10 Jul 2017) $

Copyright (c) 2013, Linear Technology Corp.(LTC)
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 Linear Technology Corp.

The Linear Technology 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.
*/

/*! @file
    @ingroup LTC2373
*/

#include <Arduino.h>
#include <stdint.h>
#include "Linduino.h"
#include "LT_SPI.h"
#include "UserInterface.h"
#include "LT_I2C.h"
#include "QuikEval_EEPROM.h"
#include "LTC2373.h"
#include <SPI.h>
#include <Wire.h>

// Function Declaration
void print_title();                                         // Print the title block
void print_prompt();                                        // Prompt the user for an input command
void print_user_command(uint8_t menu);                      // Display selected differential channels

void menu_1_read_adc();
void menu_2_program_sequencer();
void menu_3_read_sequencer();
void menu_4_select_bits();
void menu_5_select_range();
void menu_6_select_gain_compression();

// Global variables
static uint8_t adc_command;
static uint8_t user_command;
static uint32_t adc_code;                           // The LTC2373 code
static int32_t display_code;
float adc_voltage;                               // The LTC2373 voltage
float LTC2373_vref = 4.096;  //reference voltage in volts
static uint8_t LTC2373_range_select = LTC2373_RANGE_UNIPOLAR;    //!< Default set for single-ended unipolar mode
static uint8_t LTC2373_gain_compression = LTC2373_NO_COMPRESSION;   //!< Default set for no compression mode
static uint8_t LTC2373_bits = 18;                   //!< Default set for 18 bits
static uint8_t LTC2373_sequencer_bit = LTC2373_SEQUENCER_BIT;

// Constants
//! Lookup table to build the command for single-ended mode, input with respect to GND
const uint8_t COMMAND_SINGLE_ENDED[8] = {LTC2373_CH0, LTC2373_CH1, LTC2373_CH2, LTC2373_CH3,
                                        LTC2373_CH4, LTC2373_CH5, LTC2373_CH6, LTC2373_CH7
                                        }; //!< Builds the command for single-ended mode, input with respect to GND

//! Lookup table to build the command for differential mode
const uint8_t COMMAND_DIFF[8] = {LTC2373_CH0_1, LTC2373_CH2_3, LTC2373_CH4_5, LTC2373_CH6_7,
                                 LTC2373_CH1_0, LTC2373_CH3_2, LTC2373_CH5_4, LTC2373_CH7_6
                                }; //!< Builds the command for differential mode


//! Initialize Linduino
void setup()
{
  quikeval_I2C_init();           // Configure the EEPROM I2C port for 100kHz
  quikeval_SPI_init();           // Configure the spi port for 4MHz SCK
  quikeval_SPI_connect();        // Connect SPI to main data port
  Serial.begin(115200);          // Initialize the serial port to the PC
  print_title();
  print_prompt();
}


//! Repeats Linduino loop
void loop()
{
//  uint16_t user_command;
  {
    if (Serial.available())
    {
      user_command = read_int();        // Read the user command
      if (user_command != 'm')
        Serial.println(user_command);   // Prints the user command to com port
      switch (user_command)
      {
        case 1:
          menu_1_read_adc();
          break;
        case 2:
          menu_2_program_sequencer();
          break;
        case 3:
          menu_3_read_sequencer();
          break;
        case 4:
          menu_4_select_bits();
          break;
        case 5:
          menu_5_select_range();
          break;
        case 6:
          menu_6_select_gain_compression();
          break;
        default:
          Serial.println("Invalid Option");
          break;
      }
      Serial.println();
      print_prompt();
    }
  }
}


// Function Definitions
//! Read channels in single-ended mode
//! @return void
void menu_1_read_adc()
{
  uint8_t single_ended = 0;
  uint8_t i;                                                    //!< iteration variable

  i2c_write_byte(I2C_ADDRESS, I2C_COMMAND);  //disable the CPLD communication

  while (1)
  {
    switch (LTC2373_range_select)
    {
      case LTC2373_RANGE_UNIPOLAR:
        single_ended = 1;
        Serial.println("");
        Serial.println("");
        Serial.println(F("   Single-Ended, Unipolar mode, 0 to Vref:"));
        Serial.println(F("    0-CH0"));
        Serial.println(F("    1-CH1"));
        Serial.println(F("    2-CH2"));
        Serial.println(F("    3-CH3"));
        Serial.println(F("    4-CH4"));
        Serial.println(F("    5-CH5"));
        Serial.println(F("    6-CH6"));
        Serial.println(F("    7-CH7"));
        Serial.println(F("    8-ALL"));
        Serial.println(F("    m-Main Menu"));
        break;

      case LTC2373_RANGE_BIPOLAR:
        single_ended = 1;
        Serial.println("");
        Serial.println("");
        Serial.println(F("   Single-Ended, Bipolar mode, -Vref/2 to +Vref/2:"));
        Serial.println(F("    0-CH0"));
        Serial.println(F("    1-CH1"));
        Serial.println(F("    2-CH2"));
        Serial.println(F("    3-CH3"));
        Serial.println(F("    4-CH4"));
        Serial.println(F("    5-CH5"));
        Serial.println(F("    6-CH6"));
        Serial.println(F("    7-CH7"));
        Serial.println(F("    8-ALL"));
        Serial.println(F("    m-Main Menu"));
        break;

      case LTC2373_RANGE_DIFF_UNIPOLAR:
        Serial.println("");
        Serial.println("");
        Serial.println(F("   Differential, Unipolar mode, 0 to Vref:"));
        Serial.println(F("    0-0P-1N"));
        Serial.println(F("    1-2P-3N"));
        Serial.println(F("    2-4P-5N"));
        Serial.println(F("    3-6P-7N"));
        Serial.println(F("    4-1P-0N"));
        Serial.println(F("    5-3P-2N"));
        Serial.println(F("    6-5P_4N"));
        Serial.println(F("    7-7P-6N"));
        Serial.println(F("    8-ALL Even_P-Odd_N"));
        Serial.println(F("    m-Main Menu"));
        break;

      case LTC2373_RANGE_DIFF_BIPOLAR:
        Serial.println("");
        Serial.println("");
        Serial.println(F("   Differential Bipolar mode, -Vref to +Vref:"));
        Serial.println(F("    0-0P-1N"));
        Serial.println(F("    1-2P-3N"));
        Serial.println(F("    2-4P-5N"));
        Serial.println(F("    3-6P-7N"));
        Serial.println(F("    4-1P-0N"));
        Serial.println(F("    5-3P-2N"));
        Serial.println(F("    6-5P_4N"));
        Serial.println(F("    7-7P-6N"));
        Serial.println(F("    8-ALL"));
        Serial.println(F("    m-Main Menu"));
        break;

      default:
        Serial.println("    Invalid Option");
        break;
    }

    Serial.println();
    Serial.print(F("    Enter a Command: "));
    user_command = read_int();                                 // Read the single command
    if (user_command == 'm')
      return;

    switch (user_command)
    {
      case 0:
        ;
        break;
      case 1:
        ;
        break;
      case 2:
        ;
        break;
      case 3:
        ;
        break;
      case 4:
        ;
        break;
      case 5:
        ;
        break;
      case 6:
        ;
        break;
      case 7:
        ;
        break;
      case 8:
        ;
        break;
      default:
        {
          Serial.println("    Invalid Option");
          return;
        }
        break;
    }

    Serial.println(user_command);

    switch (single_ended)
    {
      case 0:  //differential mode
        if (user_command == 8)  //read all 8 channels
        {
          for (i = 0; i <= 7; i++)                                      // Read all channels in differential mode
          {
            adc_command = LTC2373_build_command(LTC2373_SEQUENCER_BIT, COMMAND_DIFF[(i) % 8], LTC2373_range_select, LTC2373_gain_compression);
            LTC2373_read(LTC2373_CS, adc_command, &adc_code);
            delay(100);
            LTC2373_read(LTC2373_CS, 0, &adc_code);

            display_code = adc_code >> (32 - LTC2373_bits);
            if (LTC2373_bits == 16) //grab the leftmost 16 bits
              display_code = display_code & 0xFFFF;
            else  //grab the leftmost 18 bits
              display_code = display_code & 0x3FFFF;

            print_user_command(i);
            Serial.print(F(" Received ADC Code: 0x"));
            Serial.println(display_code, HEX);

            // Convert the received code to voltage
            adc_voltage = LTC2373_code_to_voltage(adc_command, adc_code, LTC2373_vref);
            Serial.print(F("      Equivalent voltage: "));
            Serial.print(adc_voltage, 4);
            Serial.println(F("V"));
            Serial.println();
          }
        }
        else  //read 1 channel
        {
          i = user_command;
          adc_command = LTC2373_build_command(LTC2373_SEQUENCER_BIT, COMMAND_DIFF[i], LTC2373_range_select, LTC2373_gain_compression);
          LTC2373_read(LTC2373_CS, adc_command, &adc_code); // Throws out last reading
          delay(100);
          LTC2373_read(LTC2373_CS, 0, &adc_code);

          display_code = adc_code >> (32 - LTC2373_bits);
          if (LTC2373_bits == 16) //grab the leftmost 16 bits
            display_code = display_code & 0xFFFF;
          else  //grab the leftmost 18 bits
            display_code = display_code & 0x3FFFF;

          print_user_command(i);
          Serial.print(F(" Received ADC Code: 0x"));
          Serial.println(display_code, HEX);

          // Convert the received code to voltage
          adc_voltage = LTC2373_code_to_voltage(adc_command, adc_code, LTC2373_vref);
          Serial.print(F("      Equivalent voltage: "));
          Serial.print(adc_voltage, 4);
          Serial.println(F("V"));
          Serial.println();
        }
        break;

      case 1:  //single-ended mode
        if (user_command == 8)  //read all 8 channels
        {
          for (i = 0; i <= 7; i++)                                      // Read all channels in single-ended mode
          {
            adc_command = LTC2373_build_command(LTC2373_SEQUENCER_BIT, COMMAND_SINGLE_ENDED[(i) % 8], LTC2373_range_select, LTC2373_gain_compression);
            LTC2373_read(LTC2373_CS, adc_command, &adc_code);  // Program sequencer once
            delay(100);
            LTC2373_read(LTC2373_CS, 0, &adc_code);  //read adc

            display_code = adc_code >> (32 - LTC2373_bits);
            if (LTC2373_bits == 16) //grab the leftmost 16 bits
              display_code = display_code & 0xFFFF;
            else  //grab the leftmost 18 bits
              display_code = display_code & 0x3FFFF;

            Serial.print(F("      CH"));
            Serial.print(i);
            Serial.print(F(" Received ADC Code: 0x"));
            Serial.println(display_code, HEX);

            // Convert the received code to voltage
            adc_voltage = LTC2373_code_to_voltage(adc_command, adc_code, LTC2373_vref);
            Serial.print(F("      Equivalent voltage: "));
            Serial.print(adc_voltage, 4);
            Serial.println(F("V"));
            Serial.println();
          }
        }

        else  //read 1 channel
        {
          i = user_command;
          adc_command = LTC2373_build_command(LTC2373_SEQUENCER_BIT, COMMAND_SINGLE_ENDED[i], LTC2373_range_select, LTC2373_gain_compression);
          LTC2373_read(LTC2373_CS, adc_command, &adc_code); // Program sequencer once
          delay(100);
          LTC2373_read(LTC2373_CS, 0, &adc_code);  //read adc

          display_code = adc_code >> (32 - LTC2373_bits);
          if (LTC2373_bits == 16) //grab the leftmost 16 bits
            display_code = display_code & 0xFFFF;
          else  //grab the leftmost 18 bits
            display_code = display_code & 0x3FFFF;

          Serial.print(F("      CH"));
          Serial.print(i);
          Serial.print(F(" Received ADC Code: 0x"));
          Serial.println(display_code, HEX);

          // Convert the received code to voltage
          adc_voltage = LTC2373_code_to_voltage(adc_command, adc_code, LTC2373_vref);
          Serial.print(F("      Equivalent voltage: "));
          Serial.print(adc_voltage, 4);
          Serial.println(F("V"));
          Serial.println();
        }
        break;
    }
  }
}


//! Program the sequencer
//! @return void
void menu_2_program_sequencer()
{
  uint8_t temp_bits = 0;

  Serial.println();
  Serial.println(F("*****************************************************************************************"));
  Serial.println(F("* This routine demonstrates how to program the sequencer.                               *"));
  Serial.println(F("*                                                                                       *"));
  Serial.println(F("* A specific set of four configurations will be programmed:                             *"));
  Serial.println(F("*   A single-ended unipolar voltage on AIN1+                                            *"));
  Serial.println(F("*   A differential unipolar voltage on AIN1+/AIN1-, which feeds the ADC differentially  *"));
  Serial.println(F("*   A single-ended bipolar voltage on AIN3, which feeds the ADC differentially          *"));
  Serial.println(F("*   A differential bipolar voltage on AIN4+/AIN4-                                       *"));
  Serial.println(F("*                                                                                       *"));
  Serial.println(F("* Set the baud rate to 115200 and select the newline terminator.                        *"));
  Serial.println(F("*                                                                                       *"));
  Serial.println(F("*****************************************************************************************"));

//Form a four byte object to hold four bytes of dummy data
  LT_union_int32_4bytes adc_configuration;  //instantiate the union

  adc_configuration.LT_byte[0] = LTC2373_build_command(LTC2373_SEQUENCER_BIT, COMMAND_SINGLE_ENDED[0], LTC2373_RANGE_UNIPOLAR, LTC2373_NO_COMPRESSION);
  adc_configuration.LT_byte[1] = LTC2373_build_command(LTC2373_SEQUENCER_BIT, COMMAND_DIFF[4], LTC2373_RANGE_DIFF_UNIPOLAR, LTC2373_NO_COMPRESSION);
  adc_configuration.LT_byte[2] = LTC2373_build_command(LTC2373_SEQUENCER_BIT, COMMAND_DIFF[6], LTC2373_RANGE_DIFF_BIPOLAR, LTC2373_NO_COMPRESSION);
  adc_configuration.LT_byte[3] = LTC2373_build_command(LTC2373_SEQUENCER_BIT, COMMAND_DIFF[3], LTC2373_RANGE_DIFF_BIPOLAR, LTC2373_NO_COMPRESSION);

  LTC2373_configure(LTC2373_CS, adc_configuration.LT_uint32); // Program sequencer once

  Serial.println(F("  Write Codes: "));
  Serial.print(F("    Register C3 adc config code: "));
  Serial.println(adc_configuration.LT_byte[0] & 0x7F, BIN);
  Serial.print(F("    Register C2 adc config code: "));
  Serial.println(adc_configuration.LT_byte[1] & 0x7F, BIN);
  Serial.print(F("    Register C1 adc config code: "));
  Serial.println(adc_configuration.LT_byte[2] & 0x7F, BIN);
  Serial.print(F("    Register C0 adc config code: "));
  Serial.println(adc_configuration.LT_byte[3] & 0x7F, BIN);
  Serial.println("");
}


//! Program the sequencer
//! @return void
void menu_3_read_sequencer()
{
  uint8_t i, mode;

  for (i = 0; i < 4; i++)
  {
    LTC2373_read(LTC2373_CS, 0, &adc_code);  //Read the data

    display_code = adc_code >> (32 - LTC2373_bits);
    if (LTC2373_bits == 16) //grab the leftmost 16 bits
      display_code = display_code & 0xFFFF;
    else  //grab the leftmost 18 bits
      display_code = display_code & 0x3FFFF;

    adc_command = (adc_code >> 6) & 0x7F;

    Serial.print(F("    Register C"));
    Serial.println(i);
    mode = (0x06 & adc_command) >> 1;

    switch (mode)
    {
      case (0):
        Serial.println(F("    Unipolar, 0 to Vref"));
        break;
      case (1):
        Serial.println(F("    Bipolar, -Vref/2 to +Vref/2"));
        break;
      case (2):
        Serial.println(F("    Differential unipolar, 0 to Vref"));
        break;
      case (3):
        Serial.println(F("    Differential bipolar, -Vref to +Vref"));
        break;
    }

    Serial.print(F("    Readback adc config: "));
    Serial.println(adc_command, BIN);

    Serial.print(F("    Received Code: 0x"));
    Serial.println(display_code, HEX);

    // Convert the received code to voltage
    adc_voltage = LTC2373_code_to_voltage(adc_command, adc_code, LTC2373_vref);

    Serial.print(F("    Equivalent voltage: "));
    Serial.print(adc_voltage, 4);
    Serial.println(F("V"));
    Serial.println("");
    Serial.println("");
  }
}


//! Select number of bits
//! @return void
void menu_4_select_bits()
{
  uint8_t user_command;

  Serial.println();
  if (LTC2373_bits == 16)
    Serial.println(F("    16 bits selected"));
  else
    Serial.println(F("    18 bits selected"));

  Serial.println(F("    16 = 2373-16"));
  Serial.println(F("    18 = 2373-18"));
  Serial.println(F(""));
  Serial.print(F("    Enter a Command, based upon the resolution of the part under test: "));

  user_command = read_int();    // Read user input
  Serial.println(user_command);   // Prints the user command to com port
  switch (user_command)
  {
    case 16:
      LTC2373_bits = 16;
      break;
    case 18:
      LTC2373_bits = 18;
      break;
    default:
      {
        Serial.println("    Invalid Option");
        return;
      }
      break;
  }
}


//! Select range
//! @return void
void menu_5_select_range()
{
  uint8_t user_command;

  Serial.println(F("    0 = Unipolar, 0 to Vref"));
  Serial.println(F("    1 = Bipolar, -Vref/2 to +Vref/2"));
  Serial.println(F("    2 = Differential unipolar, 0 to Vref"));
  Serial.println(F("    3 = Differential bipolar, -Vref to +Vref"));
  Serial.println(F(""));
  Serial.print(F("    Enter a Command: "));
  user_command = read_int();    // Read user input for range select
  Serial.println(user_command);

  switch (user_command)
  {
    case 0:
      Serial.println(F("    Unipolar input range selected; set JP9 to 'GND' position"));
      LTC2373_range_select = LTC2373_RANGE_UNIPOLAR;
      break;
    case 1:
      Serial.println(F("    Bipolar input range selected; set JP9 to 'CM' position"));
      LTC2373_range_select = LTC2373_RANGE_BIPOLAR;
      break;
    case 2:
      Serial.println(F("    Differential Unipolar input range selected"));
      Serial.println(F("    Note that this range operates only for the following configurations:"));
      Serial.println(F("        CH 0P-1N, with AIN1+ connected to GND"));
      Serial.println(F("        CH 1P-0N, with AIN1- connected to GND"));
      LTC2373_range_select = LTC2373_RANGE_DIFF_UNIPOLAR;
      break;
    case 3:
      Serial.println(F("    Differential Bipolar input range selected"));
      LTC2373_range_select = LTC2373_RANGE_DIFF_BIPOLAR;
      break;
    default:
      {
        Serial.println("    Invalid Option");
        return;
      }
      break;
  }
}


//! Select gain compression
//! @return void
void menu_6_select_gain_compression()
{
  uint8_t user_command;
  Serial.println();
  if (LTC2373_gain_compression == 0)
    Serial.println(F("    No gain compression enabled"));
  else
    Serial.println(F("    Gain compression enabled"));

  Serial.println(F("    0 = No Gain Compression"));
  Serial.println(F("    1 = Gain Compression"));
  Serial.println(F(""));
  Serial.print(F("    Enter a Command: "));

  user_command = read_int();    // Read user input
  Serial.println(user_command);   // Prints the user command to com port
  switch (user_command)
  {
    case 0:
      LTC2373_gain_compression = 0;
      break;
    case 1:
      LTC2373_gain_compression = 1;
      break;
    default:
      {
        Serial.println("    Invalid Option");
        return;
      }
      break;
  }
}


//! Prints the title block when program first starts.
void print_title()
{
  Serial.println();
  Serial.println(F("*****************************************************************"));
  Serial.println(F("* DC2071A Demonstration Program                                 *"));
  Serial.println(F("*                                                               *"));
  Serial.println(F("* This program demonstrates how to receive data                 *"));
  Serial.println(F("* from the LTC2373-16/18 ADC.                                   *"));
  Serial.println(F("*                                                               *"));
  Serial.println(F("* Set the baud rate to 115200 and select the newline terminator.*"));
  Serial.println(F("*                                                               *"));
  Serial.println(F("*****************************************************************"));
}


//! Prints main menu.
void print_prompt()
{
  Serial.println("");
  Serial.println(F("  1-Read ADC Input"));
  Serial.println(F("  2-Program the Sequencer"));
  Serial.println(F("  3-Read the Sequencer"));
  Serial.println(F("  4-Select Number of Bits (Default is 18 bits)"));
  Serial.println(F("  5-Select Range (Default is Single-Ended Unipolar Range)"));
  Serial.println(F("  6-Select Gain Compression (Default is No Gain Compression)\n"));
  Serial.println(F(""));
  Serial.print(F("  Enter a command: "));
}


//! Display selected differential channels. Displaying single-ended channels is
//! straightforward; not so with differential because the inputs can take either polarity.
void print_user_command(uint8_t menu)
{
  switch (menu)
  {
    case 0:
      Serial.print(F("     CH 0P-1N"));
      break;
    case 1:
      Serial.print(F("     CH 2P-3N"));
      break;
    case 2:
      Serial.print(F("     CH 4P-5N"));
      break;
    case 3:
      Serial.print(F("     CH 6P-7N"));
      break;
    case 4:
      Serial.print(F("     CH 1P-0N"));
      break;
    case 5:
      Serial.print(F("     CH 3P-2N"));
      break;
    case 6:
      Serial.print(F("     CH 5P-4N"));
      break;
    case 7:
      Serial.print(F("     CH 7P-6N"));
      break;
  }
}

Download LTC2373 - Linduino Header File

/*!
LTC2373: 16/18-bit 1Msps 8 channel SAR ADC
LTC2372: 16/18-bit 500ksps 8 channel SAR ADC
LTC2374: 16 bit 1.6Msps 8 channel SAR ADC

@verbatim

The LTC2373_16/18 are pin-compatible, 16/18-bit A/D converters
with serial I/O, and an internal reference.

Example Code:

Read ADC input.

    adc_command = LTC2373_CH0 | LTC2373_UNIPOLAR_MODE | LTC2373_LOW_GAIN_MODE | LTC2373_NORMAL_MODE;     // Single-ended, CH0, unipolar, low gain, normal mode.
    LTC2373_read(LTC2373_CS, adc_command, &adc_code);   // Throws out last reading
    LTC2373_read(LTC2373_CS, adc_command, &adc_code);   // Obtains the current reading and stores to adc_code variable

    // Convert adc_code to voltage
    adc_voltage = LTC2373_code_to_voltage(adc_code, LTC2373_lsb, LTC2373_offset_unipolar_code);

@endverbatim

http://www.linear.com/product/LTC2373-16
http://www.linear.com/product/LTC2373_18
http://www.linear.com/product/LTC2372-16
http://www.linear.com/product/LTC2372-18
http://www.linear.com/product/LTC2374-16

http://www.linear.com/product/LTC2373-16#demoboards
http://www.linear.com/product/LTC2373_18#demoboards
http://www.linear.com/product/LTC2372-16#demoboards
http://www.linear.com/product/LTC2372-18#demoboards
http://www.linear.com/product/LTC2374-16#demoboards


REVISION HISTORY
$Revision: 7190 $
$Date: 2017-07-10 14:58:35 -0700 (Mon, 10 Jul 2017) $

Copyright (c) 2013, Linear Technology Corp.(LTC)
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 Linear Technology Corp.

The Linear Technology 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.
*/

/*! @file
    @ingroup LTC2373
    Header for LTC2373: 16/18-bit 1Msps 8 channel SAR ADC
*/

#ifndef LTC2373_H
#define LTC2373_H

#include <SPI.h>

//! Define the SPI CS pin
#ifndef LTC2373_CS
#define LTC2373_CS QUIKEVAL_CS
#endif

#define I2C_ADDRESS       0x20  //I2C address in 7 bit format
#define I2C_COMMAND       0x80  //Command to write to bus extender
#define LTC2373_SEQUENCER_BIT 0x80

//! @name LTC2373 Channel Addresses
//! @{
// Channel Address
#define LTC2373_CH0           0x40
#define LTC2373_CH1           0x48
#define LTC2373_CH2           0x50
#define LTC2373_CH3           0x58
#define LTC2373_CH4           0x60
#define LTC2373_CH5           0x68
#define LTC2373_CH6           0x70
#define LTC2373_CH7           0x78

#define LTC2373_CH0_1         0x00
#define LTC2373_CH1_0         0x20

#define LTC2373_CH2_3         0x08
#define LTC2373_CH3_2         0x28

#define LTC2373_CH4_5         0x10
#define LTC2373_CH5_4         0x30

#define LTC2373_CH6_7         0x18
#define LTC2373_CH7_6         0x38
//!@}

//! @name LTC2373 Uni/GAIN config bits
//! @{
// Range Command
#define LTC2373_RANGE_UNIPOLAR    0x00
#define LTC2373_RANGE_BIPOLAR   0x02
#define LTC2373_RANGE_DIFF_UNIPOLAR 0x04
#define LTC2373_RANGE_DIFF_BIPOLAR  0x06

// Gain Compression Command
#define LTC2373_NO_COMPRESSION   0x00
#define LTC2373_GAIN_COMPRESSION  0x01
//!@}

// Builds the ADC command
uint8_t LTC2373_build_command(uint8_t sequencer_bit,
                              uint8_t ch_designate,
                              uint8_t range_select,
                              uint8_t gain_compression
                             );


//! Reads the LTC2373 and returns 32-bit data
//! @return void
void LTC2373_read(uint8_t cs,           //!< Chip Select Pin
                  uint8_t adc_command,
                  uint32_t *ptr_adc_code    //!< Returns code read from ADC (from previous conversion)
                 );

//! Configures the LTC2373
//! @return void
void LTC2373_configure(uint8_t cs,
                       uint32_t adc_command
                      );

//! Calculates the LTC2373 input voltage given the binary data and lsb weight.
//! @return Floating point voltage
float LTC2373_code_to_voltage(uint8_t adc_command,
                              uint32_t adc_code,                   //!< Raw ADC code
                              float vref          //!< Reference voltage
                             );

#endif  //  LTC2373_H


Technical Support