| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

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