| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LTC2460.h
Go to the documentation of this file.
1 /*!
2 LTC2460 Ultra-Tiny, 16-bit delta sigma ADCs with 10ppm/degree C Max Precision Reference
3
4 @verbatim
5
6 The LTC2460/LTC2462 are ultra tiny, 16-Bit analog-to- digital converters
7 with an integrated precision reference. They use a single 2.7V to 5.5V supply
8 and communicate through an SPI Interface. The LTC2460 is single-ended with
9 a 0V to VREF input range and the LTC2462 is differential with a ±VREF input
10 range. Both ADC’s include a 1.25V integrated reference with 2ppm/°C drift
11 performance and 0.1% initial accuracy. The converters are available in a
12 12-pin DFN 3mm × 3mm package or an MSOP-12 package. They include an integrated
13 oscillator and perform conversions with no latency for multiplexed applications.
14 The LTC2460/LTC2462 include a proprietary input sampling scheme that reduces
15 the average input current several orders of magnitude when compared to conventional
16 delta sigma converters.
17
18
19 SPI DATA FORMAT (MSB First):
20
21 Byte #1 Byte #2
22
23 Data Out : D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D10
24 Data In : EN1 EN2 SPD SLP X X X X X X X X X X X X
25
26
27 Dx : Data Bits
28 EN1/EN2 : Enable Bits (00-keep previous mode, 10-change mode)
29 SPD : Double Output Rate Select Bit (1-Normal rate 30hz, auto-calibration on, 0- 2x rate 60hz, auto_calibration off)
30 SLP : 1 - powers down chip reference after the next conversion is complete
31 Command Byte #1
32 EN1 EN2 SPD SLP Comments
33 0 X X X Keep Previous Mode
34 1 0 1 X 60 Hz conversion
35 1 0 0 X 30 Hz auto-calibrated conversion
36
37 Example Code:
38
39 Read in 2X mode without turning off reference
40
41 uint16_t miso_timeout = 1000;
42 adc_command =LTC2460_SPEED_2X | LTC2460_REF_ON; // Build ADC command for channel 0
43
44 LTC2460_read(LTC2460_CS, adc_command, &adc_code); // Throws out last reading
45 delay(50);
46 LTC2460_read(LTC2460_CS, adc_command, &adc_code); // Obtains the current reading and stores to adc_code variable
47 // Convert adc_code to voltage
48 adc_voltage = LTC2460_code_to_voltage(adc_code, LTC2460_lsb);
49
50 @endverbatim
51
52 http://www.linear.com/product/LTC2460
53
54 http://www.linear.com/product/LTC2460#demoboards
55
56
57 Copyright 2018(c) Analog Devices, Inc.
58
59 All rights reserved.
60
61 Redistribution and use in source and binary forms, with or without
62 modification, are permitted provided that the following conditions are met:
63 - Redistributions of source code must retain the above copyright
64 notice, this list of conditions and the following disclaimer.
65 - Redistributions in binary form must reproduce the above copyright
66 notice, this list of conditions and the following disclaimer in
67 the documentation and/or other materials provided with the
68 distribution.
69 - Neither the name of Analog Devices, Inc. nor the names of its
70 contributors may be used to endorse or promote products derived
71 from this software without specific prior written permission.
72 - The use of this software may or may not infringe the patent rights
73 of one or more patent holders. This license does not release you
74 from the requirement that you obtain separate licenses from these
75 patent holders to use this software.
76 - Use of the software either in source or binary form, must be run
77 on or directly connected to an Analog Devices Inc. component.
78
79 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
80 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
81 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
82 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
83 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
84 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
85 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
86 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
87 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
88 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
89 */
90
91 /*! @file
92 @ingroup LTC2460
93 Header for LTC2460: Ultra-Tiny, 16-bit delta sigma ADCs with 10ppm/degree C Max Precision Reference
94 */
95
96 #ifndef LTC2460_H
97 #define LTC2460_H
98
99 //! Define the SPI CS pin
100 #ifndef LTC2460_CS
101 #define LTC2460_CS QUIKEVAL_CS
102 #endif
103
104 /*! @name Mode Configuration
105 @{
106 */
107 #define LTC2460_KEEP_PREVIOUS_MODE 0x00
108 #define LTC2460_SPEED_1X 0xA0
109 #define LTC2460_SPEED_2X 0x80
110 #define LTC2460_REF_ON 0x00
111 #define LTC2460_REF_OFF 0x10
112 /*!
113 @}
114 */
115
116
117 /*Commands
118 Construct a control word by bitwise ORing bitfields defined above.
119
120 Example - read with 1X mode enabled and reference on.
121 adc_command = (LTC2460_SPEED_1X | LTC2460_REF_ON);
122 */
123
124 //! Reads from LTC2460.
125 void LTC2460_read(uint8_t cs, //!< Chip select
126 uint8_t adc_command, //!< 1 byte command written to LTC2460
127 int32_t *adc_code //!< 4 byte conversion code read from LTC2460
128 );
129
130 //! Calculates the voltage corresponding to an adc code, given the reference (in volts)
131 //! @return Returns voltage calculated from ADC code.
132 float LTC2460_code_to_voltage(int32_t adc_code, //!< Code read from adc
133 float vref //!< VRef (in volts)
134 );
135
136 #endif // LTC2460_H
137
adc_command
static uint8_t adc_command
Definition: DC2071AA.ino:111
LTC2460_read
void LTC2460_read(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
Definition: LTC2460.cpp:77
LTC2460_code_to_voltage
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
vref
float vref
Definition: LTC2492_Thermocouple_Meter.ino:129
adc_code
static uint32_t adc_code
Definition: DC2071AA.ino:113