| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LTC2378.h
Go to the documentation of this file.
1 /*!
2 LTC2376-20: 20-Bit, 250Ksps ADC
3 LTC2377-20: 20-Bit, 500Ksps ADC
4 LTC2378-20: 20-Bit, 1Msps ADC
5
6 @verbatim
7
8 The following parts (DUT) are pin-compatible, 20-bit A/D converters with serial I/O, and an internal reference:
9 LTC2376-20: 20-Bit, 250Ksps ADC
10 LTC2377-20: 20-Bit, 500Ksps ADC
11 LTC2378-20: 20-Bit, 1Msps ADC
12
13 The DUTs typically draw only 8.4 mA from a single 2.5V supply. The automatic nap and sleep modes benefit power sensitive applications.
14
15 The DUTs DC performance is outstanding with a +/-0.5 ppm INL specification and
16 no missing codes over temperature. The signal-to-noise ratio (SNR) for the LTC2378 is typically 104 dB, with the internal reference.
17
18 Example Code:
19
20 Read ADC input.
21
22 LTC2378_read(LTC2378_CS, &adc_code); // Throws out last reading
23 LTC2378_read(LTC2378_CS, &adc_code); // Obtains the current reading and stores to adc_code variable
24
25 // Convert adc_code to voltage
26 adc_voltage = LTC2378_code_to_voltage(adc_code, vref);
27
28 @endverbatim
29
30 http://www.linear.com/product/LTC2376-20
31 http://www.linear.com/product/LTC2377-20
32 http://www.linear.com/product/LTC2378-20
33
34 http://www.linear.com/product/LTC2376-20#demoboards
35 http://www.linear.com/product/LTC2377-20#demoboards
36 http://www.linear.com/product/LTC2378-20#demoboards
37
38
39 Copyright 2018(c) Analog Devices, Inc.
40
41 All rights reserved.
42
43 Redistribution and use in source and binary forms, with or without
44 modification, are permitted provided that the following conditions are met:
45 - Redistributions of source code must retain the above copyright
46 notice, this list of conditions and the following disclaimer.
47 - Redistributions in binary form must reproduce the above copyright
48 notice, this list of conditions and the following disclaimer in
49 the documentation and/or other materials provided with the
50 distribution.
51 - Neither the name of Analog Devices, Inc. nor the names of its
52 contributors may be used to endorse or promote products derived
53 from this software without specific prior written permission.
54 - The use of this software may or may not infringe the patent rights
55 of one or more patent holders. This license does not release you
56 from the requirement that you obtain separate licenses from these
57 patent holders to use this software.
58 - Use of the software either in source or binary form, must be run
59 on or directly connected to an Analog Devices Inc. component.
60
61 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
62 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
63 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
64 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
65 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
66 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
67 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
68 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
69 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
70 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
71 */
72
73 /*! @file
74 @ingroup LTC2378
75 Header for LTC2378: 16/18/20-bit 1Msps ADC
76 */
77
78 #ifndef LTC2378_H
79 #define LTC2378_H
80
81 #include <SPI.h>
82
83 //! Define the SPI CS pin
84 #ifndef LTC2378_CS
85 #define LTC2378_CS QUIKEVAL_CS
86 #endif
87
88 //! @name LTC2378 Channel Address
89 //! @{
90 // Channel Address
91 #define LTC2378_ADDRESS 0x00
92 //!@}
93
94
95 //! Reads the LTC2378 and returns 32-bit data in 2's complement format
96 //! @return void
97 void LTC2378_read(uint8_t cs, //!< Chip Select Pin
98 int32_t *ptr_adc_code //!< Returns code read from ADC (from previous conversion)
99 );
100
101
102 //! Calculates the LTC2378 input voltage given the binary data and lsb weight.
103 //! @return Floating point voltage
104 float LTC2378_code_to_voltage(int32_t adc_code, //!< Raw ADC code
105 uint8_t gain_compression,
106 float vref //!< Reference voltage
107 );
108
109 #endif // LTC2378_H
110
111
LTC2378_code_to_voltage
float LTC2378_code_to_voltage(int32_t adc_code, uint8_t gain_compression, float vref)
Calculates the LTC2378 input voltage given the binary data and lsb weight.
Definition: LTC2378.cpp:104
LTC2378_read
void LTC2378_read(uint8_t cs, int32_t *ptr_adc_code)
Reads the LTC2378 and returns 32-bit data in 2&#39;s complement format.
Definition: LTC2378.cpp:82
vref
float vref
Definition: LTC2492_Thermocouple_Meter.ino:129
adc_code
static uint32_t adc_code
Definition: DC2071AA.ino:113