LTC2642 - 16-/14-/12-Bit VOUT DACs in 3mm × 3mm DFN

Features

  • Tiny 3mm × 3mm 8-Pin DFN Package
  • Maximum 16-Bit INL Error: ±1LSB over Temperature
  • Low 120µA Supply Current
  • Guaranteed Monotonic over Temperature
  • Low 0.5nV•sec Glitch Impulse
  • 2.7V to 5.5V Single Supply Operation
  • Fast 1µs Settling Time to 16 Bits
  • Unbuffered Voltage Output Directly Drives 60k Loads
  • 50MHz SPI™/QSPI™/MICROWIRE™ Compatible Serial Interface
  • Power-On Reset Clears DAC Output to Zero Scale(LTC2641) or Midscale (LTC2642)
  • Schmitt-Trigger Inputs for Direct Optocoupler Interface
  • Asynchronous CLR Pin
  • 8-Lead MSOP, 3mm × 3mm DFN, and 8-Lead SO
    Packages (LTC2641)
  • 10-Lead MSOP and 3mm × 3mm DFN Packages(LTC2642)
Designed for Automotive and Transportation Applications
AEC-Q100 data available for specific packages


Typical Application

LTC2642 Typical Application
LTC2642 Typical Application

Description

The LTC2641/LTC2642 are families of 16-, 14- and 12-bit unbuffered voltage output DACs. These DACs operate from a single 2.7V to 5.5V supply and are guaranteed monotonic over temperature. The LTC2641A-16/LTC2642A-16 provide 16-bit performance (±1LSB INL and ±1LSB DNL) over temperature. Unbuffered DAC outputs result in low supply current of 120µA and a low offset error of ±1LSB.

Both the LTC2641 and LTC2642 feature a reference input range of 2V to VDD. VOUT swings from 0V to VREF. For bipolar operation, the LTC2642 includes matched scaling resistors for use with an external precision op amp (such as the LT1678), generating a ±VREF output swing at RFB.

The LTC2641/LTC2642 use a simple SPI/MICROWIRE compatible 3-wire serial interface which can be operated at clock rates up to 50MHz and can interface directly with optocouplers for applications requiring isolation. A power-on reset circuit clears the LTC2641’s DAC output to zero scale and the LTC2642’s DAC output to midscale when power is initially applied. A logic low on the CLR pin asynchronously clears the DAC to zero scale (LTC2641) or midscale (LTC2642). These DACs are all specified over the commercial and industrial ranges.

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
LTC2642ACDD-16#PBF 3x3 DFN-10 DD C 05-08-1699 Yes
LTC2642ACDD-16#TRPBF 3x3 DFN-10 DD C 05-08-1699 Yes
LTC2642ACMS-16#PBF MS-10 MS C 05-08-1661 Yes
LTC2642ACMS-16#TRPBF MS-10 MS C 05-08-1661 Yes
LTC2642AIDD-16#PBF 3x3 DFN-10 DD I 05-08-1699 Yes
LTC2642AIDD-16#TRPBF 3x3 DFN-10 DD I 05-08-1699 Yes
LTC2642AIMS-16#PBF MS-10 MS I 05-08-1661 Yes
LTC2642AIMS-16#TRPBF MS-10 MS I 05-08-1661 Yes
LTC2642CDD-12#PBF 3x3 DFN-10 DD C 05-08-1699 Yes
LTC2642CDD-12#TRPBF 3x3 DFN-10 DD C 05-08-1699 Yes
LTC2642CDD-14#PBF 3x3 DFN-10 DD C 05-08-1699 Yes
LTC2642CDD-14#TRPBF 3x3 DFN-10 DD C 05-08-1699 Yes
LTC2642CDD-16#PBF 3x3 DFN-10 DD C 05-08-1699 Yes
LTC2642CDD-16#TRPBF 3x3 DFN-10 DD C 05-08-1699 Yes
LTC2642CMS-12#PBF MS-10 MS C 05-08-1661 Yes
LTC2642CMS-12#TRPBF MS-10 MS C 05-08-1661 Yes
LTC2642CMS-14#PBF MS-10 MS C 05-08-1661 Yes
LTC2642CMS-14#TRPBF MS-10 MS C 05-08-1661 Yes
LTC2642CMS-16#PBF MS-10 MS C 05-08-1661 Yes
LTC2642CMS-16#TRPBF MS-10 MS C 05-08-1661 Yes
LTC2642IDD-12#PBF 3x3 DFN-10 DD I 05-08-1699 Yes
LTC2642IDD-12#TRPBF 3x3 DFN-10 DD I 05-08-1699 Yes
LTC2642IDD-14#PBF 3x3 DFN-10 DD I 05-08-1699 Yes
LTC2642IDD-14#TRPBF 3x3 DFN-10 DD I 05-08-1699 Yes
LTC2642IDD-16#PBF 3x3 DFN-10 DD I 05-08-1699 Yes
LTC2642IDD-16#TRPBF 3x3 DFN-10 DD I 05-08-1699 Yes
LTC2642IMS-12#PBF MS-10 MS I 05-08-1661 Yes
LTC2642IMS-12#TRPBF MS-10 MS I 05-08-1661 Yes
LTC2642IMS-14#PBF MS-10 MS I 05-08-1661 Yes
LTC2642IMS-14#TRPBF MS-10 MS I 05-08-1661 Yes
LTC2642IMS-16#PBF MS-10 MS I 05-08-1661 Yes
LTC2642IMS-16#TRPBF MS-10 MS I 05-08-1661 Yes


LTC2642 Package Drawing
LTC2642 Package Drawing
LTC2642 Package Drawing
LTC2642 Package Drawing
LTC2642 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
LTC2642ACDD-16#PBF 3x3 DFN-10 C $11.79 $8.25 Yes
LTC2642ACDD-16#TRPBF 3x3 DFN-10 C $8.31 Yes
LTC2642ACMS-16#PBF MS-10 C $11.79 $8.25 Yes
LTC2642ACMS-16#TRPBF MS-10 C $8.31 Yes
LTC2642AIDD-16#PBF 3x3 DFN-10 I $14.14 $9.90 Yes
LTC2642AIDD-16#TRPBF 3x3 DFN-10 I $9.96 Yes
LTC2642AIMS-16#PBF MS-10 I $14.14 $9.90 Yes
LTC2642AIMS-16#TRPBF MS-10 I $9.96 Yes
LTC2642CDD-12#PBF 3x3 DFN-10 C $4.32 $2.95 Yes
LTC2642CDD-12#TRPBF 3x3 DFN-10 C $3.01 Yes
LTC2642CDD-14#PBF 3x3 DFN-10 C $7.94 $5.42 Yes
LTC2642CDD-14#TRPBF 3x3 DFN-10 C $5.48 Yes
LTC2642CDD-16#PBF 3x3 DFN-10 C $9.15 $6.25 Yes
LTC2642CDD-16#TRPBF 3x3 DFN-10 C $6.31 Yes
LTC2642CMS-12#PBF MS-10 C $4.32 $2.95 Yes
LTC2642CMS-12#TRPBF MS-10 C $3.01 Yes
LTC2642CMS-14#PBF MS-10 C $7.94 $5.42 Yes
LTC2642CMS-14#TRPBF MS-10 C $5.48 Yes
LTC2642CMS-16#PBF MS-10 C $9.15 $6.25 Yes
LTC2642CMS-16#TRPBF MS-10 C $6.31 Yes
LTC2642IDD-12#PBF 3x3 DFN-10 I $5.18 $3.54 Yes
LTC2642IDD-12#TRPBF 3x3 DFN-10 I $3.60 Yes
LTC2642IDD-14#PBF 3x3 DFN-10 I $9.52 $6.50 Yes
LTC2642IDD-14#TRPBF 3x3 DFN-10 I $6.56 Yes
LTC2642IDD-16#PBF 3x3 DFN-10 I $10.98 $7.50 Yes
LTC2642IDD-16#TRPBF 3x3 DFN-10 I $7.56 Yes
LTC2642IMS-12#PBF MS-10 I $5.18 $3.54 Yes
LTC2642IMS-12#TRPBF MS-10 I $3.60 Yes
LTC2642IMS-14#PBF MS-10 I $9.52 $6.50 Yes
LTC2642IMS-14#TRPBF MS-10 I $6.56 Yes
LTC2642IMS-16#PBF MS-10 I $10.98 $7.50 Yes
LTC2642IMS-16#TRPBF MS-10 I $7.56 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
DC1096B LTC2642A-16 (LTC2641A-16) 16-bit +/-5V Unbuffered Vout DAC (req DC590B) $75.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
LTC2642AIDD-16#PBF 3x3 DFN-10 I $14.14 $9.90 Yes
LTC2642AIDD-16#TRPBF 3x3 DFN-10 I $9.96 Yes
LTC2642AIMS-16#PBF MS-10 I $14.14 $9.90 Yes
LTC2642AIMS-16#TRPBF MS-10 I $9.96 Yes
LTC2642IDD-12#PBF 3x3 DFN-10 I $5.18 $3.54 Yes
LTC2642IDD-12#TRPBF 3x3 DFN-10 I $3.60 Yes
LTC2642IDD-14#PBF 3x3 DFN-10 I $9.52 $6.50 Yes
LTC2642IDD-14#TRPBF 3x3 DFN-10 I $6.56 Yes
LTC2642IDD-16#PBF 3x3 DFN-10 I $10.98 $7.50 Yes
LTC2642IDD-16#TRPBF 3x3 DFN-10 I $7.56 Yes
LTC2642IMS-12#PBF MS-10 I $5.18 $3.54 Yes
LTC2642IMS-12#TRPBF MS-10 I $3.60 Yes
LTC2642IMS-14#PBF MS-10 I $9.52 $6.50 Yes
LTC2642IMS-14#TRPBF MS-10 I $6.56 Yes
LTC2642IMS-16#PBF MS-10 I $10.98 $7.50 Yes
LTC2642IMS-16#TRPBF MS-10 I $7.56 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

  • High Resolution Offset and Gain Adjustment
  • Process Control and Industrial Automation
  • Automatic Test Equipment
  • Data Aquisition Systems

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

LTspice

LTspice® software is a powerful, fast and free simulation tool, schematic capture and waveform viewer with enhancements and models for improving the simulation of switching regulators. Click here to download LTspice

Models for the following parts are available in LTspice IV:
LTC2642-14
LTC2642-16

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 LTC2642 - DC1096B Linduino.INO File

/*!
Linear Technology DC1096B Demonstration Board.
LTC2642: 16-Bit DAC with SPI Interface

@verbatim

NOTES

   Set the terminal baud rate to 115200 and select the newline terminator.

   No external power supply is required. Two on-board reference voltages of
   2.5V and 5V are available.

   The board features LTC2642A with direct and buffered output.

   The program displays calculated voltages which are based on the reference
   voltage used. A precision voltmeter is needed to verify the actual
   measured voltages against the calculated voltage displayed.

   There is also an option of generating a square wave of required voltage
   levels and frequency. This proves the fast settling time of the corresponding
   parts.

  Explanation of Commands:

  Setup:
   Option 1: Enter a digital value to obtain analog voltage output.
   Option 2: Enter the frequency and voltage levels to obtain a square wave.
   Option 3: Vary the reference voltage used.

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

@endverbatim

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

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

REVISION HISTORY
$Revision: 5668 $
$Date: 2016-09-02 10:27:05 -0700 (Fri, 02 Sep 2016) $

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

// Headerfiles
#include <Arduino.h>
#include <stdint.h>
#include <SPI.h>
#include "LT_SPI.h"
#include "LT_I2C.h"
#include "Linduino.h"
#include "QuikEval_EEPROM.h"
#include "UserInterface.h"
#include "LTC2642.h"

// Macros
#define VREF1 5
#define VREF2 2.5

// Global Variables
float VREF = VREF1;   // Set the reference voltage

// Function Declarations
void print_title();
void print_prompt();
uint8_t voltage_output();
uint8_t square_wave_output();
void change_VREF();
uint8_t discover_DC1096(char *demo_name);

//! Initialize Linduino
void setup()
{
  uint8_t demo_board_connected;

  char demo_name[] = "LTC2642";           // Demo Board Name stored in QuikEval EEPROM
  output_high(LTC2642_CS);                //! Pulls LTC2642 Chip Select (LD pin) High

  quikeval_I2C_init();                    //! Initializes Linduino I2C port.

  quikeval_SPI_init();                    //! Configures the SPI port for 4MHz SCK
  quikeval_SPI_connect();                 //! Connects SPI to QuikEval port

  Serial.begin(115200);                   //! Initializes the serial port to the PC
  print_title();                          //! Displays the title

  demo_board_connected = discover_DC1096(demo_name); //! Checks if correct demo board is connected.

  if (demo_board_connected)               //! Prints the prompt if the correct demo board is connected
  {
    print_prompt();                       // Prints prompt and indicates that "A" is selected.
  }
}

//! Repeats Linduino loop
void loop()
{
  int8_t user_command;                // The user input command
  uint8_t acknowledge = 0;
  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:
        acknowledge |= voltage_output();
        break;
      case 2:
        acknowledge |= square_wave_output();
        break;
      case 3:
        change_VREF();
        break;
      default:
        Serial.println(F("Incorrect Option"));
    }
    if (acknowledge)
      Serial.println(F("***** I2C ERROR *****"));
    Serial.print(F("\n\n\t\t\tMake sure the on-board VREF jumper is set to "));
    Serial.print(VREF);
    Serial.println(" V");
    Serial.println(F("\t\t\t\tPress Enter to Continue..."));
    read_int();
    print_prompt();
  }
}

//! Function to enter a digital value and get the analog output
uint8_t voltage_output()
{
  uint16_t data;
  float voltage;
  Serial.print("\nEnter the 16-bit data as decimal or hex: ");
  data = read_int();
  Serial.print("0x");
  Serial.println(data, HEX);

  LTC2642_write(QUIKEVAL_CS, data);
  voltage = LTC2642_code_to_voltage(data, VREF);

  Serial.print("\nOutput voltage = ");
  Serial.print(voltage);
  Serial.println(" V");
  return 0;
}

//! Function to generate a square wave of desired frequency and voltage ranges
uint8_t square_wave_output()
{
  uint16_t freq;
  float time;
  float voltage_high, voltage_low;
  uint16_t code_high, code_low;
  //uint8_t receive_enter;  // To receive enter key pressed

  Serial.print("\nEnter voltage_high: ");
  while (!Serial.available());
  voltage_high = read_float();
  Serial.print(voltage_high);
  Serial.println(" V");

  Serial.print("\nEnter voltage_low: ");
  while (!Serial.available());
  voltage_low = read_float();
  Serial.print(voltage_low);
  Serial.println(" V");

  Serial.print("\nEnter the required frequency in Hz: ");
  freq = read_int();
  Serial.print(freq);
  Serial.println(" Hz");

  time = (float)1000/freq;
  Serial.print("\nT = ");
  Serial.print(time);
  Serial.println(" ms");

  //! Converting data into voltage
  code_high = LTC2642_voltage_to_code(voltage_high, VREF);
  code_low = LTC2642_voltage_to_code(voltage_low, VREF);

  while (!Serial.available()) //! Generate square wave until a key is pressed
  {
    LTC2642_write(LTC2642_CS, code_high);
    delayMicroseconds(time * 500);
    LTC2642_write(LTC2642_CS, code_low);
    delayMicroseconds(time * 500);
  }
  return 0;
}

//! Function to change the reference voltage to be used
void change_VREF()
{
  uint8_t choice;
  Serial.println("\n1 - 5.00 V \n2 - 2.50 V");
  Serial.print("Enter your choice: ");
  choice = read_int();
  Serial.println(choice);

  if (choice == 1)
    VREF = VREF1;
  else if (choice == 2)
    VREF = VREF2;
  else
    Serial.println("\nWrong choice!");
}

//! Read the ID string from the EEPROM and determine if the correct board is connected.
//! Returns 1 if successful, 0 if not successful
uint8_t discover_DC1096(char *demo_name)
{
  Serial.print(F("\nChecking EEPROM contents..."));
  read_quikeval_id_string(&ui_buffer[0]);
  ui_buffer[48] = 0;
  Serial.println(ui_buffer);

  if (!strcmp(demo_board.product_name, demo_name))
  {
    Serial.print("Demo Board Name: ");
    Serial.println(demo_board.name);
    Serial.print("Product Name: ");
    Serial.println(demo_board.product_name);
    if (demo_board.option)
    {
      Serial.print("Demo Board Option: ");
      Serial.println(demo_board.option);
    }
    Serial.println(F("Demo board connected"));
    Serial.println(F("\n\n\t\t\t\tPress Enter to Continue..."));
    read_int();
    return 1;
  }
  else
  {
    Serial.print("Demo board ");
    Serial.print(demo_name);
    Serial.print(" not found, \nfound ");
    Serial.print(demo_board.name);
    Serial.println(" instead. \nConnect the correct demo board, then press the reset button.");
    return 0;
  }
}

//! Prints the title block when program first starts.
void print_title()
{
  Serial.print(F("\n*****************************************************************\n"));
  Serial.print(F("* DC1096B Demonstration Program                                 *\n"));
  Serial.print(F("*                                                               *\n"));
  Serial.print(F("* This program demonstrates how to send data to the 16-bit DAC. *\n"));
  Serial.print(F("* Set the baud rate to 115200 and select the newline terminator.*\n"));
  Serial.print(F("*                                                               *\n"));
  Serial.print(F("*****************************************************************\n"));
}

//! Prints main menu.
void print_prompt()
{
  Serial.print(F("\n----------------------------------------------------------------------"));
  Serial.print(F("\n\n\t\t\t\tOPTIONS\n"));
  Serial.print(F("\n1 - Voltage output\n"));
  Serial.print(F("2 - Square Wave output\n"));
  Serial.print(F("3 - Change VREF\n"));

  Serial.print(F("\nENTER A COMMAND: "));
}

Download LTC2642 Linduino Header File

/*!
LTC2642: 16-Bit DAC with SPI Interface

@verbatim

The LTC2641/LTC2642 are families of 16-,14 and 12-bit unbuffered voltage output
DACs. These DACs operate from 2.7V to 5.5V supply and are monotonic over
temperature.

They communicate via SPI interface. 16 bits of data are loaded through DIN
after a high-to-low transition of CS (MSB first). After 16 data bits have
been loaded into the serial input register, a low-to-high transition on CS
transfers the data to the 16-bit DAC latch, updating the DAC output.

For the 14-bit DACs, (LTC2641-14/LTC2642-14), the MSB remains in the same
(left-justified) position in the input 16-bit data word. Therefore, two
“don’t-care” bits must be loaded after the LSB, to make up the required
16 data bits. Similarly, for the 12-bit family members(LTC2641-12/LTC2642-12)
four “don’t-care” bits must follow the LSB.

@endverbatim

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

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

REVISION HISTORY
$Revision: 3237 $
$Date: 2015-03-05 17:45:18 -0800 (Thu, 05 Mar 2015) $

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 LTC2642
    Header for LTC2642: 16-Bit DAC with SPI Interface
*/

#ifndef LTC2642_H
#define LTC2642_H

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

//! Writes the 16-bit data into the DAC
//! @return void
void LTC2642_write(uint8_t cs,            //!< Chip Select Pin
                   uint16_t data          //!< 16-bit digital input data
                  );
//! Calculates the output voltage from the given digital code and reference voltage
//! @return Floating point voltage
float LTC2642_code_to_voltage(uint16_t data,    //!< 16-bit digital input data
                              float VREF      //!< Reference voltage
                             );
//! Calculates the 16 bit data code from voltage
//! @return 16-bit code
uint16_t LTC2642_voltage_to_code(float voltage,   //!< Analog voltage to be converted into code
                                 float VREF     //!< Reference Voltage
                                );
#endif      //LTC2642_H

Download LTC2642 Linduino.CPP

/*!
LTC2642: 16-Bit DAC with SPI Interface

@verbatim

The LTC2641/LTC2642 are families of 16-,14 and 12-bit unbuffered voltage output
DACs. These DACs operate from 2.7V to 5.5V supply and are monotonic over
temperature.

They communicate via SPI interface. 16 bits of data are loaded through DIN
after a high-to-low transition of CS (MSB first). After 16 data bits have
been loaded into the serial input register, a low-to-high transition on CS
transfers the data to the 16-bit DAC latch, updating the DAC output.

For the 14-bit DACs, (LTC2641-14/LTC2642-14), the MSB remains in the same
(left-justified) position in the input 16-bit data word. Therefore, two
“don’t-care” bits must be loaded after the LSB, to make up the required
16 data bits. Similarly, for the 12-bit family members(LTC2641-12/LTC2642-12)
four “don’t-care” bits must follow the LSB.

@endverbatim

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

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

REVISION HISTORY
$Revision: 5668 $
$Date: 2016-09-02 10:27:05 -0700 (Fri, 02 Sep 2016) $

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 LTC2642 LTC2642: 16-Bit DAC with SPI Interface

/*! @file
    @ingroup LTC2642
    Library for LTC2642 16-Bit DAC with SPI Interface
*/

#include <SPI.h>
#include "LT_SPI.h"
#include "Linduino.h"

// Writes 16 bit data into serial input register
void LTC2642_write(uint8_t cs, uint16_t data)
{
  output_low(cs);
  spi_write((uint8_t)(data >> 8));  // D15:D8
  spi_write((uint8_t)data);     // D7:D0
  output_high(cs);          // CS high transfers data to DAC latch
}

// Calculates the 16 bit data code from voltage
uint16_t LTC2642_voltage_to_code(float voltage, float VREF)
{
  float code;
  code = voltage * 0xFFFF / VREF;
  return code;
}

// Calculates the output voltage from the given digital code and reference voltage
float LTC2642_code_to_voltage(uint16_t data, float VREF)
{
  float voltage;
  voltage = (float)data / 0xFFFF * VREF;
  return voltage;
}

Technical Support