LTC2305 - 2-Channel, 12-Bit ADCs with I2C Compatible Interface

Features

  • 12-Bit Resolution
  • Low Power: 1.5mW at 1ksps, 35μW Sleep Mode
  • 14ksps Throughput Rate
  • Internal Reference
  • Low Noise: SNR = 73.5dB
  • Guaranteed No Missing Codes
  • Single 5V Supply
  • 2-wire I2C Compatible Serial Interface with 9 Addresses Plus One Global for Synchronization
  • Fast Conversion Time: 1.3μs
  • 1-Channel (LTC2301) and 2-Channel (LTC2305) Versions
  • Unipolar or Bipolar Input Ranges (Software Selectable)
  • Internal Conversion Clock
  • Guaranteed Operation from –40°C to 125°C (MSOP Package)
  • 12-Pin 4mm × 3mm DFN and 12-Pin MSOP Packages
Designed for Automotive and Transportation Applications
AEC-Q100 data available for specific packages


Typical Application

LTC2305 Typical Application
LTC2305 Typical Application

Description

The LTC2301/LTC2305 are low noise, low power, 1-/2-channel, 12-bit successive approximation ADCs with an I2C compatible serial interface. These ADCs include an internal reference and a fully differential sample-andhold circuit to reduce common mode noise. The LTC2301/ LTC2305 operate from an internal clock to achieve a fast 1.3μs conversion time.

The LTC2301/LTC2305 operate from a single 5V supply and draw just 300μA at a throughput rate of 1ksps. The ADC enters nap mode when not converting, reducing the power dissipation.

The LTC2301/LTC2305 are available in small 12-pin 4mm × 3mm DFN and 12-pin MSOP packages. The internal 2.5V reference further reduces PCB board space requirements.

The low power consumption and small size make the LTC2301/LTC2305 ideal for battery operated and portable applications, while the 2-wire I2C compatible serial interface makes these ADCs a good match for space-constrained systems.

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
LTC2305CDE#PBF 4x3 DFN-12 DE/UE C 05-08-1695 Yes
LTC2305CDE#TRPBF 4x3 DFN-12 DE/UE C 05-08-1695 Yes
LTC2305CMS#PBF MS-12 MS C 05-08-1668 Yes
LTC2305CMS#TRPBF MS-12 MS C 05-08-1668 Yes
LTC2305HMS#PBF MS-12 MS H 05-08-1668 Yes
LTC2305HMS#TRPBF MS-12 MS H 05-08-1668 Yes
LTC2305IDE#PBF 4x3 DFN-12 DE/UE I 05-08-1695 Yes
LTC2305IDE#TRPBF 4x3 DFN-12 DE/UE I 05-08-1695 Yes
LTC2305IMS#PBF MS-12 MS I 05-08-1668 Yes
LTC2305IMS#TRPBF MS-12 MS I 05-08-1668 Yes


LTC2305 Package Drawing
LTC2305 Package Drawing
LTC2305 Package Drawing
LTC2305 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
LTC2305CDE#PBF 4x3 DFN-12 C $3.00 $2.10 Yes
LTC2305CDE#TRPBF 4x3 DFN-12 C $2.16 Yes
LTC2305CMS#PBF MS-12 C $3.00 $2.10 Yes
LTC2305CMS#TRPBF MS-12 C $2.16 Yes
LTC2305HMS#PBF MS-12 H $4.31 $3.02 Yes
LTC2305HMS#TRPBF MS-12 H $3.08 Yes
LTC2305IDE#PBF 4x3 DFN-12 I $3.60 $2.52 Yes
LTC2305IDE#TRPBF 4x3 DFN-12 I $2.58 Yes
LTC2305IMS#PBF MS-12 I $3.60 $2.52 Yes
LTC2305IMS#TRPBF MS-12 I $2.58 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
DC1444A-B LTC2305 Demo Board | 12-bit, 2-ch I2C 14ksps ADC (req DC2026) $50.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
Buy Now
Click here to view our complete list of demo boards

Designed for Automotive and Transportation Applications

AEC-Q100 data is available for these specific part numbers. Please contact your local sales representative for more information regarding reliability reports or to inquire about parts that are not included. For more information, view our Automotive and Transportation page

Part Number Package Temp Price
(1-99)
Price
(1k)*
RoHS
LTC2305HMS#PBF MS-12 H $4.31 $3.02 Yes
LTC2305HMS#TRPBF MS-12 H $3.08 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.

Applications

  • Industrial Process Control
  • Motor Control
  • Accelerometer Measurements
  • Battery Operated Instruments
  • Isolated and/or Remote Data Acquisition
  • Power Supply Monitoring

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 Code Supported: There is example code available for this part. The code below may rely on other drivers available in the full library.

Download LTC2305 - DC1444A Linduino .INO File

/*!
Linear Technology DC1337A Demonstration Board.
LTC2301: 1-Channel, 12-Bit SAR ADC with I2C Interface.
LTC2305: 2-Channel, 12-Bit SAR ADC with I2C Interface.

@verbatim

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 DC1444A.
   
 LTC2301
  How to test Differential Mode:
   Bipolar Mode:
    The voltage source should be connected between inputs VIN+ and VIN-. Ensure both
    inputs are within their 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 +4.096V (differential voltage range).
    (Swapping input voltages results in a reversed polarity reading.)

   Unipolar Mode:
    The voltage source should be connected between inputs VIN+ and VIN-. Ensure both
    inputs are within their 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 +4.096V (differential voltage range).
    
LTC2305
  How to test Single-Ended mode:
   Bipolar Mode:
    The voltage source should be connected to input VCH0 or VCH1. 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 +4.096V.
    (Swapping input voltages results in a reversed polarity reading.)

   Unipolar Mode:
    The voltage source should be connected to input VCH0 or VCH1. 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 +4.096V.


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

@endverbatim

http://www.linear.com/product/LTC2301
http://www.linear.com/product/LTC2305

http://www.linear.com/product/LTC2301#demoboards
http://www.linear.com/product/LTC2305#demoboards

REVISION HISTORY
$Revision: 3018 $
$Date: 2014-12-01 15:53:20 -0800 (Mon, 01 Dec 2014) $

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 LTC2305
*/

#include <Arduino.h>
#include <stdint.h>
#include "Linduino.h"
#include "LT_I2C.h"
#include "UserInterface.h"
#include "QuikEval_EEPROM.h"
#include "LTC2305.h"
#include <Wire.h>

// Function Declaration
void print_title();                                     // Print the title block
void print_prompt();                                    // Prompt the user for an input command
uint8_t print_user_command_single_ended();             // Display selected single ended channels
int8_t menu_1_read_input();                             // Read channels in single-ended mode
void menu_2_select_part();                              // Selects LTC2301/2305
void menu_3_select_uni_bipolar();                       // Sets LTC2305 to Bipolar or Unipolar
void menu_4_select_single_ended_differential();        // Selects single-ended or differential mode
void menu_5_select_polarity();                         // Selects polarity in differential mode
int8_t menu_6_sleep();                                  // Sets LTC2305 Sleep Mode
void menu_7_set_address();

// Global variables
static uint8_t demo_board_connected;                    //!< Set to 1 if the board is connected
static uint8_t single_ended_differential = LTC2305_SINGLE_ENDED_MODE;     //!< LTC2305 Single-Ended or Differential mode selection
static uint8_t uni_bipolar = LTC2305_UNIPOLAR_MODE;     //!< LTC2305 Unipolar or Bipolar mode selection
static uint8_t part = LTC2301;                          //!< LTC2301 or 2305 part selection
static uint8_t polarity = LTC2305_P0_N1;                //!< LTC230X Input polarity selection
static uint8_t channel = LTC2305_CH0;                   //!< LTC2305 Channel selection
static uint8_t i2c_address = LTC2305_I2C_ADDRESS;       //!< I2C address in 7 bit format for part
static uint8_t LTC2305_bits = 12;                      //!< Resolution (12 bits)
static float LTC2305_vref = 4.096; 

// Constants
// Build the command for single-ended mode
const uint8_t BUILD_COMMAND_SINGLE_ENDED[2] = {LTC2305_CH0, LTC2305_CH1};        //!< Builds the command for single-ended mode
 
//! Initialize Linduino
void setup()
{
  quikeval_I2C_init();                    // Enable the I2C port
  quikeval_I2C_connect();                 // Connect I2C to main data port
  Serial.begin(115200);                   // Initialize the serial port to the PC
  print_title();
  print_prompt();
}


//! Repeats Linduino loop
void loop()
{
  int8_t user_command;              // The user input command
  uint8_t acknowledge = 0;              // I2C acknowledge bit
  
  if (Serial.available())             // Check for user input
  {
      user_command = read_int();        // Read the user command
      if (user_command != 'm')
        Serial.println(user_command);   // Prints the user command to com port
      Serial.flush();
      switch (user_command)
      {
        case 1:
          menu_1_read_input();
          break;
        case 2:
          menu_2_select_part();
          break;
        case 3:
          menu_3_select_uni_bipolar();
          break;
        case 4:
          menu_4_select_single_ended_differential();
          break;
        case 5:
          menu_5_select_polarity();
          break;
        case 6:
          menu_6_sleep();
          break;
        case 7:
          menu_7_set_address();
          break;
        default:
          Serial.println(F("Invalid Option"));
          break;
      }
      Serial.println();
      if (acknowledge != 0) Serial.println(F("Error: No Acknowledge. Check I2C Address."));
      Serial.println(F("*************************"));
      print_prompt();
  }
}


// Function Definitions
//! Read channels in single-ended mode
//! @return 1 if successful, 0 if not
int8_t menu_1_read_input()
{
  uint8_t user_command;
  uint16_t adc_command;         // The LTC2305 command byte    
  uint16_t adc_code = 0;    // The LTC2305 code
  uint8_t x, y, startcount, endcount;
  uint16_t display_code;
  float adc_voltage;
  uint8_t acknowledge = 0;       // I2C acknowledge bit
  
  if (part == LTC2305)
  {
    if(single_ended_differential == LTC2305_SINGLE_ENDED_MODE)
    {
      if (uni_bipolar == LTC2305_UNIPOLAR_MODE)
      {
        Serial.println(F("  Read LTC2305 Input in Single-Ended Unipolar mode:"));
        Serial.println(F("  Note that in Unipolar mode, input voltages less than zero are reported as 0.0V"));
      }
      else
        Serial.println(F("  Read LTC2305 Input in Single-Ended Bipolar mode:"));
      user_command = print_user_command_single_ended();
    }
    else
    {
      if (uni_bipolar == LTC2305_UNIPOLAR_MODE)
      {
        Serial.println(F("  Read LTC2305 Input in Differential Unipolar mode:"));
        Serial.println(F("  Note that in Unipolar mode, input voltages less than zero are reported as 0.0V"));
      }
      else
        Serial.println(F("  Read LTC2305 Input in Differential Bipolar mode:"));      
    }
  }
   
  else
  {
    if (uni_bipolar == LTC2305_UNIPOLAR_MODE)
    {
      Serial.println(F("  Read LTC2301 Input in Differential Unipolar mode:"));
      Serial.println(F("  Note that in Unipolar mode, input voltages less than zero are reported as 0.0V"));
    }
    else
      Serial.println(F("  Read LTC2301 Input in Differential Bipolar mode:"));
  }

  if (user_command == 8)  //read both channels
  {
    startcount = 0;
    endcount = 1;
  }
  else 
  {
    startcount = user_command;
    endcount = user_command;
  }
      
  if(part == LTC2305)  //read LTC2305
  {
    if(single_ended_differential == LTC2305_SINGLE_ENDED_MODE)
    {
      for (int8_t x = startcount; x <= endcount; x++)
      {
        adc_command = BUILD_COMMAND_SINGLE_ENDED[(x+1) % 2] | polarity | uni_bipolar; // Send channel config for the NEXT conversion to take place
        acknowledge |= LTC2305_read(LTC2305_I2C_ADDRESS, adc_command, &adc_code);     // Throws out last reading and starts CH0 conversion
        acknowledge |= LTC2305_read(LTC2305_I2C_ADDRESS, adc_command, &adc_code);   // Read previous channel conversion (x-1) and start next one (x)
    
        display_code = adc_code >> (16 - LTC2305_bits);
        display_code = display_code & 0xFFF; 

        Serial.print(F("  Received Code: b"));
        Serial.println(display_code, BIN);
            
        adc_voltage = LTC2305_code_to_voltage(adc_code, LTC2305_vref, uni_bipolar);
        Serial.print(F("  Voltage read on "));
        Serial.print(F("Ch"));
        Serial.print(x);
        Serial.print(F(": "));
        Serial.print(adc_voltage, 4);
        Serial.println(F("V"));
        Serial.println();
      }
    }

    else  //differential reading
    {
          adc_command = polarity | uni_bipolar; // Send channel config for the NEXT conversion to take place
          acknowledge |= LTC2305_read(LTC2305_I2C_ADDRESS, adc_command, &adc_code);     // Throws out last reading and starts CH0 conversion
          acknowledge |= LTC2305_read(LTC2305_I2C_ADDRESS, adc_command, &adc_code);   // Read previous channel conversion (x-1) and start next one (x)
    
          display_code = adc_code >> (16 - LTC2305_bits);
          display_code = display_code & 0xFFF;   
    
          Serial.print(F("  Received Code: b"));
          Serial.println(display_code, BIN);
            
          adc_voltage = LTC2305_code_to_voltage(adc_code, LTC2305_vref, uni_bipolar);
          Serial.print(F("  Voltage read on "));
          Serial.print(F("Ch"));
          Serial.print(x);
          Serial.print(F(": "));
          Serial.print(adc_voltage, 4);
          Serial.println(F("V"));
          Serial.println();
    }
  }
  
  else  //read LTC2301
  { 
        adc_command = polarity | uni_bipolar;
        acknowledge |= LTC2305_read(LTC2305_I2C_ADDRESS, adc_command, &adc_code);     // Throws out last reading and starts new conversion
        acknowledge |= LTC2305_read(LTC2305_I2C_ADDRESS, adc_command, &adc_code);
    
        display_code = adc_code >> (16 - LTC2305_bits);
        display_code = display_code & 0xFFF;   
    
        Serial.print(F("  Received Code: b"));
        Serial.println(display_code, BIN);
        
        adc_voltage = LTC2305_code_to_voltage(adc_code, LTC2305_vref, uni_bipolar);
        Serial.print(F("  Voltage read on "));
        Serial.print(F("Ch"));
        Serial.print(user_command);
        Serial.print(F(": "));
        Serial.print(adc_voltage, 4);
        Serial.println(F("V"));
        Serial.println();
  }
  return(acknowledge);
}


//! Sets LTC2305 to Single-Ended or Differential
void menu_2_select_part()
{
  uint8_t user_command;

  Serial.println(F("\n  0 = LTC2301"));
  Serial.println(F("  1 = LTC2305"));
  Serial.print(F("  Enter a Command: "));

  user_command = read_int();    // Read user input for uni_bipolar 
  Serial.println(user_command);
  switch (user_command)
      {
        case 0:
          Serial.println(F("  LTC2301 selected"));
          part = LTC2301;     
          break;
        case 1:
          Serial.println(F("  LTC2305 selected"));
          part = LTC2305;
          break; 
        default:
        {
          Serial.println("  Invalid Option");
          return;
        }
          break;
      }    
}


//! Sets LTC230X to Bipolar or Unipolar
void menu_3_select_uni_bipolar()
{
  uint8_t user_command;

  Serial.println(F("\n  0 = Unipolar"));
  Serial.println(F("  1 = Bipolar"));
  Serial.print(F("  Enter a Command: "));

  user_command = read_int();    // Read user input for uni_bipolar 
  Serial.println(user_command);
  switch (user_command)
      {
        case 0:
          Serial.println(F("  Uniipolar mode selected"));
          uni_bipolar = LTC2305_UNIPOLAR_MODE;
        break;
        case 1:
          Serial.println(F("  Bipolar mode selected"));
          uni_bipolar = LTC2305_BIPOLAR_MODE;
          break; 
        default:
        {
          Serial.println("  Invalid Option");
          return;
        }
          break;
      }    
}


//! Sets LTC2305 single-ended or differential mode
void menu_4_select_single_ended_differential()
{
  uint8_t user_command;

  Serial.println(F("\n  0 = Single-Ended"));
  Serial.println(F("  1 = Differential"));
  Serial.print(F("  Enter a Command: "));

  user_command = read_int();    // Read user input for uni_bipolar 
  Serial.println(user_command);
  switch (user_command)
      {
        case 0:
          Serial.println(F("  Single-ended mode selected"));
          single_ended_differential = LTC2305_SINGLE_ENDED_MODE;
//          menu_99_select_channel();
        break;
        case 1:
          Serial.println(F("  Differential mode selected"));
          single_ended_differential = LTC2305_DIFFERENTIAL_MODE;
          break; 
        default:
        {
          Serial.println("  Invalid Option");
          return;
        }
          break;
      }    
}


//! Sets LTC2305 polarity in differential mode
void menu_5_select_polarity()
{
  uint8_t user_command;

  Serial.println(F("\n  0 = 0P-1N"));
  Serial.println(F("  1 = 1P-0N"));
  Serial.print(F("  Enter a Command: "));

  user_command = read_int();    // Read user input for uni_bipolar 
  Serial.println(user_command);
  switch (user_command)
      {
        case 0:
          Serial.println(F("  0P-1N selected"));
          polarity = LTC2305_P0_N1;
        break;
        case 1:
          Serial.println(F("  1P-0N selected"));
          polarity = LTC2305_P1_N0;
          break; 
        default:
        {
          Serial.println("  Invalid Option");
          return;
        }
          break;
      }    
}


//! Sets LTC2305 Sleep Mode
//! @return 1 if successful, 0 if not
int8_t menu_6_sleep()
{
  int8_t acknowledge = 0;           // I2C acknowledge bit
  uint16_t user_command;
  uint16_t adc_code;        // The LTC2305 code
  
  acknowledge |= LTC2305_read(LTC2305_I2C_ADDRESS, LTC2305_SLEEP_MODE, &adc_code);
  
  Serial.println();
  Serial.print(F("  ADC Command: b"));
  Serial.println(LTC2305_SLEEP_MODE, BIN);
  Serial.println(F("  LTC2305 is now in sleep mode"));
  Serial.println(F("  Enter RETURN to exit Sleep Mode"));
  
  user_command = read_int();
  
  acknowledge |= LTC2305_read(LTC2305_I2C_ADDRESS, LTC2305_EXIT_SLEEP_MODE, &adc_code);
  return(acknowledge);
}


//! Set the I2C 7 bit address 
void menu_7_set_address()
{
    int16_t user_command;
    Serial.print(F("  Enter the I2C address of the part in decimal format, from 0 to 127 (default is 8)\n"));  
    user_command = read_int();
    Serial.print(F("  Address entered: "));
    Serial.println(user_command);
    i2c_address = user_command&0x7F;
}


//! Prints the title block when the program first starts.
void print_title()
{
  Serial.println();
  Serial.println(F("*****************************************************************"));
  Serial.println(F("* DC1444A Demonstration Program                                 *"));
  Serial.println(F("* This program demonstrates how to receive data                 *"));
  Serial.println(F("* from the following ADCs:                                      *"));
  Serial.println(F("*   LTC2301                                                     *"));
  Serial.println(F("*   LTC2305                                                     *"));
  Serial.println(F("*                                                               *"));
  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(F("1-Read ADC Input "));
  Serial.println(F("2-Select LTC2301 / LTC2305 (default is LTC2301)"));
  Serial.println(F("3-Select Unipolar / Bipolar measurement (default is Unipolar)"));
  Serial.println(F("4-Select Single-Ended / Differential measurement, LTC2305 only (default is Single-Ended)"));
  Serial.println(F("5-Select Polarity (default is 0+/1-)"));
  Serial.println(F("6-Sleep Mode"));
  Serial.println(F("7-Set I2C address (default is 8)"));
  Serial.println();
  Serial.print(F("Enter a command:  "));
}


//! Display selected single-ended channels.
uint8_t print_user_command_single_ended()
{
  uint8_t user_command;
  Serial.println(F("*************************"));                         
  Serial.println(F("  0 = CH0"));
  Serial.println(F("  1 = CH1"));
  Serial.println(F("  2 = ALL"));
  Serial.println(F("  m = Main Menu"));
  Serial.println();
  Serial.print(F("  Enter a Command: "));

  user_command = read_int();  // Read the single-ended menu command
  Serial.println(user_command);
  if (user_command == 'm')
    return(0);
      
  switch (user_command)  //check for invalid selection
  {
    case 0:
      Serial.println(F("  CH0 selected"));
      break;
    case 1:
      Serial.println(F("  CH1 selected"));
      break;
    case 2:
      Serial.println(F("  All selected"));
      break;
    default:
      Serial.println(F("  Invalid Option"));
      break;
   }

  return(user_command);
}



Download LTC2305 - Linduino Header File

/*!
LTC2305: 8-channel, 12-Bit SAR ADC with I2C interface

@verbatim

The LTC2305 is a low noise, low power, 8-channel, 12-bit successive 
approximation ADC with an I2C compatible serial interface. This ADC includes an 
internal reference and a fully differential sample-and-hold circuit to reduce 
common mode noise. The LTC2305 operates from an internal clock to achieve a fast 
1.3 microsecond conversion time. 

The LTC2305 operates from a single 5V supply and draws just 300 microamps at a 
throughput rate of 1ksps. The ADC enters nap mode when not converting, reducing 
the power dissipation. 

I2C DATA FORMAT (MSB First):


       Byte #1                             Byte #2
START  SA6 SA5 SA4 SA3 SA2 SA1 SA0 W SACK  SD OS S1 S0 UNI SLP X X SACK

             Byte #3                             Byte #4                             Byte #5
Repeat Start SA6 SA5 SA4 SA3 SA2 SA1 SA0 R SACK  D11 D10 D9  D8  D7  D6  D5 D4 MACK  D3 D2 D1 D0 X  X  X  X  MNACK  STOP

SACK  : Slave Acknowledge
MACK  : Master Acknowledge
MNACK : Master Not Acknowledge
SD    : Single, Differential# Bit
OS    : ODD, Sign# Bit
Sx    : Address Select Bit
COM   : CH7/COM Configuration Bit
UNI   : Unipolar, Bipolar# Bit
SLP   : Sleep Mode Bit
Dx    : Data Bits
X     : Don't care

Example Code:

Read Channel 0 in Single-Ended Unipolar mode

    adc_command = LTC2305_CH0 | LTC2305_UNIPOLAR_MODE;                  // Build ADC command for channel 0

    ack |= LTC2305_read(LTC2305_I2C_ADDRESS, adc_command, &adc_code);   // Throws out last reading
    ack |= LTC2305_read(LTC2305_I2C_ADDRESS, adc_command, &adc_code);   // Obtains the current reading and stores to adc_code variable

    // Convert adc_code to voltage
    adc_voltage = LTC2305_unipolar_code_to_voltage(adc_code, LTC2305_lsb, LTC2305_offset_code);

@endverbatim

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

http://www.linear.com/product/LTC2305#demoboards

REVISION HISTORY
$Revision: 3018 $
$Date: 2014-12-01 15:53:20 -0800 (Mon, 01 Dec 2014) $

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 LTC2305
    Header for LTC2305: 8-channel, 12-Bit SAR ADC with I2C interface
*/

#ifndef LTC2305_H
#define LTC2305_H

#include <Wire.h>

//! @name I2C addresses
//! @{
//! Un-comment the address corresponding to the LTC2305's address
//                                     //  Pin State
// LTC2305 I2C Address                 //  AD1       AD0

#define LTC2305_I2C_ADDRESS 0x08      //  LOW       LOW
// #define LTC2305_I2C_ADDRESS 0x09    //  LOW       Float
// #define LTC2305_I2C_ADDRESS 0x0A    //  LOW       HIGH
// #define LTC2305_I2C_ADDRESS 0x0B    //  Float     HIGH
// #define LTC2305_I2C_ADDRESS 0x18    //  Float     Float
// #define LTC2305_I2C_ADDRESS 0x19    //  Float     LOW
// #define LTC2305_I2C_ADDRESS 0x1A    //  HIGH      LOW
// #define LTC2305_I2C_ADDRESS 0x1B    //  HIGH      Float
// #define LTC2305_I2C_ADDRESS 0x14    //  High      HIGH
//!@}

//! @name Single-Ended Channel Configuration
//! @{
// Single-Ended Channel Configuration
#define LTC2305_CH0                0xC0
#define LTC2305_CH1                0x80
//!@}


//! @name LTC2305 Configuration Bits
//! @{
// LTC1867 Configuration Bits
#define LTC2305_SLEEP_MODE         0x04
#define LTC2305_EXIT_SLEEP_MODE    0x00
#define LTC2305_UNIPOLAR_MODE      0x08
#define LTC2305_BIPOLAR_MODE       0x00
#define LTC2305_SINGLE_ENDED_MODE  0x80
#define LTC2305_DIFFERENTIAL_MODE  0x00
#define LTC2305_P0_N1			   0x00
#define LTC2305_P1_N0			   0x40

#define LTC2301					   1
#define LTC2305					   0
//!@}

// Commands
// Construct a channel / uni/bipolar by bitwise ORing one choice from the channel configuration
// and one choice from the command.

// Example - read channel 3 single-ended
// adc_command = LTC2305_CH3 | LTC2305_UNIPOLAR_MODE;

// Example - read voltage between channels 5 and 4 with 4 as positive polarity and in bipolar mode.
// adc_command = LTC2305_P4_N5 | LTC2305_BIPOLAR_MODE;


//! Reads 12-bit code from LTC2305, programs channel and mode for next conversion.
//! @return Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
int8_t LTC2305_read(uint8_t i2c_address,    //!< I2C address of device
                    uint8_t adc_command,    //!< ADC command / address bits
                    uint16_t *ptr_adc_code      //!< Returns code read from ADC
                   );


//! Calculates the LTC2305 input voltage.
//! @return Calculated voltage
float LTC2305_code_to_voltage(uint16_t adc_code,           //!< Code read from ADC
                                       float LTC2305_vref,           //!< LSB value (volts)
                                       uint8_t uni_bipolar
					);

#endif  // LTC2305_H

Download LTC2305 - Linduino.CPP File

/*!
LTC2305: 2-channel, 12-Bit SAR ADC with I2C interface

@verbatim

The LTC2305 is a low noise, low power, 8-channel, 12-bit successive 
approximation ADC with an I2C compatible serial interface. This ADC includes an 
internal reference and a fully differential sample-and-hold circuit to reduce 
common mode noise. The LTC2305 operates from an internal clock to achieve a fast 
1.3 microsecond conversion time. 

The LTC2305 operates from a single 5V supply and draws just 300 microamps at a 
throughput rate of 1ksps. The ADC enters nap mode when not converting, reducing 
the power dissipation. 

@endverbatim

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

http://www.linear.com/product/LTC2305#demoboards

REVISION HISTORY
$Revision: 3018 $
$Date: 2014-12-01 15:53:20 -0800 (Mon, 01 Dec 2014) $

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

//! @defgroup LTC2305 LTC2305: 2-channel, 12-Bit SAR ADC with I2C interface

/*! @file
    @ingroup LTC2305
    Library for LTC2305: 2-channel, 12-Bit SAR ADC with I2C interface
*/

#include <Arduino.h>
#include <stdint.h>
#include "Linduino.h"
#include "LT_I2C.h"
#include "LTC2305.h"
#include <Wire.h>

// Commands
// Construct a channel / uni/bipolar by bitwise ORing one choice from the channel configuration
// and one choice from the command.

// Example - read channel 3 single-ended
// adc_command = LTC2305_CH3 | LTC2305_UNIPOLAR_MODE;

// Example - read voltage between channels 5 and 4 with 4 as positive polarity and in bipolar mode.
// adc_command = LTC2305_P4_N5 | LTC2305_BIPOLAR_MODE;


// Reads 12 bits in binary format
int8_t LTC2305_read(uint8_t i2c_address, uint8_t adc_command, uint16_t *ptr_adc_code)
{
  int8_t ack = 0;
  LT_union_int16_2bytes data;

  data.LT_byte[1] = 0; 
  data.LT_byte[0] = 0; 

  ack = i2c_read_word_data(i2c_address, adc_command, &data.LT_uint16);

  *ptr_adc_code = data.LT_uint16;	//note the 12 bits of data are left justified

  return(ack);
}


// Calculates the LTC2305 input unipolar voltage.
float LTC2305_code_to_voltage(uint16_t adc_code, float vref, uint8_t uni_bipolar)
{
  float voltage;
  float sign = 1;

  if(uni_bipolar == LTC2305_UNIPOLAR_MODE)
  {
  	voltage = (float)adc_code;
 	voltage = voltage / (pow(2,16)-1);    //! 2) This calculates the input as a fraction of the reference voltage (dimensionless)
  }
  else
  {
	vref = vref/2;
	if ((adc_code & 0x8000) == 0x8000)	//adc code is < 0
  	{
    	  adc_code = (adc_code ^ 0xFFFF)+1;                                    //! Convert ADC code from two's complement to binary
    	  sign = -1;
  	}
  	voltage = sign*(float)adc_code;
	voltage = voltage / (pow(2,15)-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)


  return(voltage);
}

Technical Support