Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC2460.cpp
Go to the documentation of this file.
1 
2 /*!
3 LTC2460 Ultra-Tiny, 16-bit delta sigma ADCs with 10ppm/degree C Max Precision Reference
4 
5 @verbatim
6 
7 The LTC2460/LTC2462 are ultra tiny, 16-Bit analog-to- digital converters
8 with an integrated precision reference. They use a single 2.7V to 5.5V supply
9 and communicate through an SPI Interface. The LTC2460 is single-ended with
10 a 0V to VREF input range and the LTC2462 is differential with a ±VREF input
11 range. Both ADC’s include a 1.25V integrated reference with 2ppm/°C drift
12 performance and 0.1% initial accuracy. The converters are available in a
13 12-pin DFN 3mm × 3mm package or an MSOP-12 package. They include an integrated
14 oscillator and perform conversions with no latency for multiplexed applications.
15 The LTC2460/LTC2462 include a proprietary input sampling scheme that reduces
16 the average input current several orders of magnitude when compared to conventional
17 delta sigma converters.
18 
19 @endverbatim
20 
21 http://www.linear.com/product/LTC2460
22 
23 http://www.linear.com/product/LTC2460#demoboards
24 
25 
26 Copyright 2018(c) Analog Devices, Inc.
27 
28 All rights reserved.
29 
30 Redistribution and use in source and binary forms, with or without
31 modification, are permitted provided that the following conditions are met:
32  - Redistributions of source code must retain the above copyright
33  notice, this list of conditions and the following disclaimer.
34  - Redistributions in binary form must reproduce the above copyright
35  notice, this list of conditions and the following disclaimer in
36  the documentation and/or other materials provided with the
37  distribution.
38  - Neither the name of Analog Devices, Inc. nor the names of its
39  contributors may be used to endorse or promote products derived
40  from this software without specific prior written permission.
41  - The use of this software may or may not infringe the patent rights
42  of one or more patent holders. This license does not release you
43  from the requirement that you obtain separate licenses from these
44  patent holders to use this software.
45  - Use of the software either in source or binary form, must be run
46  on or directly connected to an Analog Devices Inc. component.
47 
48 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
49 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
50 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
51 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
52 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
53 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
54 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
55 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58 */
59 
60 //! @ingroup Analog_to_Digital_Converters
61 //! @{
62 //! @defgroup LTC2460 LTC2460: 24-Bit, 16-Channel Delta Sigma ADCs with Selectable Speed/Resolution
63 //! @}
64 
65 /*! @file
66  @ingroup LTC2460
67  Library for LTC2460: 24-Bit, 16-Channel Delta Sigma ADCs with Selectable Speed/Resolution
68 */
69 
70 #include <stdint.h>
71 #include <Arduino.h>
72 #include "Linduino.h"
73 #include "LTC2460.h"
74 #include "LTC24XX_general.h"
75 
76 // Reads from LTC2460.
77 void LTC2460_read(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
78 {
79  int32_t data;
80  LTC24XX_SPI_8bit_command_24bit_data(cs, adc_command, &data); // Transfer arrays
81  *adc_code = data;
82 
83 }
84 
85 // Calculates the voltage corresponding to an adc code, given the reference (in volts)
86 float LTC2460_code_to_voltage(int32_t adc_code, float vref)
87 {
88  float adc_voltage;
89  adc_voltage = vref * (((adc_code>>16) & 0x0000FFFF )/65535.0); //This part does not have an EOC or a sign bit.
90  return(adc_voltage);
91 }
92 
static uint8_t adc_command
Definition: DC2071AA.ino:111
LTC2460 Ultra-Tiny, 16-bit delta sigma ADCs with 10ppm/degree C Max Precision Reference.
Header File for Linduino Libraries and Demo Code.
float LTC2460_code_to_voltage(int32_t adc_code, float vref)
Calculates the voltage corresponding to an adc code, given the reference (in volts) ...
Definition: LTC2460.cpp:86
void LTC24XX_SPI_8bit_command_24bit_data(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 24 bit output word...
static float adc_voltage
Definition: DC2071AA.ino:115
union LT_union_int32_4bytes data
Definition: DC2094A.ino:138
LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs.
void LTC2460_read(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
Definition: LTC2460.cpp:77
static uint32_t adc_code
Definition: DC2071AA.ino:113