| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LTC2461.h
Go to the documentation of this file.
1 /*!
2 LTC2461: 16-Bit I2C Delta Sigma ADCs with 10ppm/C Max Precision Reference.
3 LTC2463: Differential, 16-Bit I2C Delta Sigma ADCs with 10ppm/C Max Precision Reference.
4 LTC2453: Differential, 16-Bit Delta Sigma ADC With I2C Interface.
5
6 @verbatim
7
8 The LTC2461/LTC2463 are ultra tiny, 16-Bit analog-todigital converters with an
9 integrated precision reference. They use a single 2.7V to 5.5V supply and
10 communicate through an I2C Interface. The LTC2461 is single-ended with a 0V to
11 1.25V input range and the LTC2463 is differential with a 1.25V input range. Both
12 ADCs include a 1.25V integrated reference with 2ppm/C drift performance and 0.1%
13 initial accuracy. The converters are available in a 12-pin 3mm x 3mm DFN package
14 or an MSOP-12 package. They include an integrated oscillator and perform
15 conversions with no latency for multiplexed applications. The LTC2461/LTC2463
16 include a proprietary input sampling scheme that reduces the average input
17 current several orders of magnitude when compared to conventional delta sigma
18 converters
19
20 I2C DATA FORMAT (MSB First):
21
22 Byte #1 Byte #2 Byte #3
23
24 START SA6 SA5 SA4 SA3 SA2 SA1 SA0 W SACK EN1 EN2 SPD SLP X X X X SACK STOP
25
26 START SA6 SA5 SA4 SA3 SA2 SA1 SA0 R SACK D15 D14 D13 D12 D11 D10 D9 D8 MACK D7 D6 D5 D4 D3 D2 D1 D0 MNACK STOP
27
28 SACK : Slave Acknowledge
29 MACK : Master Acknowledge
30 MNACK : Master Not Acknowledge
31 Sx : Address Select Bit
32 EN1 : Enable 1 : to program, EN1 = High, EN2 = Low
33 EN2 : Enable 2
34 SPD : Speed Bit- 0 for 60Hz, 1 for 30Hz
35 SLP : Sleep Mode Bit
36 X : Don't care
37 Dx : Data Bits
38
39
40 Example Code:
41
42 Read ADC in 60Hz Speed Mode
43
44 ack |= LTC2461_read(LTC2461_I2C_ADDRESS, LTC2461_60HZ_SPEED_MODE, &adc_code_60Hz); // Throws out last reading
45 ack |= LTC2461_read(LTC2461_I2C_ADDRESS, LTC2461_60HZ_SPEED_MODE, &adc_code_60Hz); // Obtains the current reading and
46 // stores to adc_code_60Hz variable
47
48 // Convert adc_code_60Hz to voltage
49 adc_voltage_60Hz = LTC2461_code_to_voltage(adc_code_60Hz, LTC2461_lsb, LTC2461_offset_code);
50
51 @endverbatim
52
53 http://www.linear.com/product/LTC2461
54 http://www.linear.com/product/LTC2463
55 http://www.linear.com/product/LTC2453
56
57 http://www.linear.com/product/LTC2461#demoboards
58 http://www.linear.com/product/LTC2463#demoboards
59 http://www.linear.com/product/LTC2453#demoboards
60
61
62 Copyright 2018(c) Analog Devices, Inc.
63
64 All rights reserved.
65
66 Redistribution and use in source and binary forms, with or without
67 modification, are permitted provided that the following conditions are met:
68 - Redistributions of source code must retain the above copyright
69 notice, this list of conditions and the following disclaimer.
70 - Redistributions in binary form must reproduce the above copyright
71 notice, this list of conditions and the following disclaimer in
72 the documentation and/or other materials provided with the
73 distribution.
74 - Neither the name of Analog Devices, Inc. nor the names of its
75 contributors may be used to endorse or promote products derived
76 from this software without specific prior written permission.
77 - The use of this software may or may not infringe the patent rights
78 of one or more patent holders. This license does not release you
79 from the requirement that you obtain separate licenses from these
80 patent holders to use this software.
81 - Use of the software either in source or binary form, must be run
82 on or directly connected to an Analog Devices Inc. component.
83
84 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
85 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
86 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
87 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
88 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
89 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
90 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
91 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
92 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
93 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
94 */
95
96 /*! @file
97 @ingroup LTC2461
98 Header for LTC2461: 16-Bit I2C Delta Sigma ADCs with 10ppm/C Max Precision Reference
99 */
100
101 #ifndef LTC2461_H
102 #define LTC2461_H
103
104 #include <Wire.h>
105
106 // Address Choices:
107 // To choose an address, comment out all options except the
108 // configuration on the demo board:
109
110 //! @name I2C addresses
111 //! @{
112 //! Un-comment the address corresponding to the LTC2309's address
113
114 // LTC2461 I2C Addresses
115 #define LTC2461_I2C_ADDRESS 0x14 // A0 = LOW : this is demo board default
116 // #define LTC2461_I2C_ADDRESS 0x54 // A0 = HIGH
117 //!@}
118
119 //! @name Modes
120 //! @{
121 // Command Constants
122 #define LTC2461_30HZ_SPEED_MODE 0xA0 // SPD=1
123 #define LTC2461_60HZ_SPEED_MODE 0x80 // SPD=0
124 #define LTC2461_SLEEP_MODE 0x90 // SLP=1 SPD=XX
125 //!@}
126
127 //! Reads the ADC and returns 16-bit data
128 //! @return Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
129 int8_t LTC2461_read(uint8_t i2c_address, //!< I2C address of the LTC2461.
130 uint8_t adc_command, //!< ADC command to be written to the LTC2461.
131 uint16_t *adc_code //!< Returns code read from ADC.
132 );
133
134
135 //! Write a 16-bit command to the ADC. Derived from 2655.
136 //! @return Returns the state of the acknowledge bit after the I2C address write. 0=acknowledge, 1=no acknowledge.
137 int8_t LTC2461_command(uint8_t i2c_address, //!< I2C address of the LTC2461.
138 uint8_t adc_command //!< ADC command to be written to the LTC2461.
139 );
140
141 //! Calculates the LTC2309 input unipolar voltage.
142 //! @return Floating point voltage
143 float LTC2461_code_to_voltage(uint16_t adc_code, //!< Raw ADC code
144 float LTC2461_lsb, //!< LSB value (volts)
145 int32_t LTC2461_offset_code //!< Offset code
146 );
147
148 //! Calibrate the lsb
149 //! @return Void
150 void LTC2461_cal_voltage(uint16_t zero_code, //!< Code from zero reading
151 uint16_t fs_code, //!< Full-scale code
152 float zero_voltage, //!< Measured zero voltage
153 float fs_voltage, //!< Measured full-scale voltage
154 float *LTC2461_lsb, //!< Return LSB value (volts)
155 int32_t *LTC2461_offset_code //!< Return Offset code
156 );
157
158
159 #endif // LTC2461_H
i2c_address
uint8_t i2c_address
adc_command
static uint8_t adc_command
Definition: DC2071AA.ino:111
LTC2461_command
int8_t LTC2461_command(uint8_t i2c_address, uint8_t adc_command)
Write a 16-bit command to the ADC.
Definition: LTC2461.cpp:93
LTC2461_code_to_voltage
float LTC2461_code_to_voltage(uint16_t adc_code, float LTC2461_lsb, int32_t LTC2461_offset_code)
Calculates the LTC2309 input unipolar voltage.
Definition: LTC2461.cpp:103
LTC2461_lsb
static float LTC2461_lsb
Ideal LSB voltage for a perfect part (Vref/(2^16))
Definition: DC1491A.ino:124
LTC2461_cal_voltage
void LTC2461_cal_voltage(uint16_t zero_code, uint16_t fs_code, float zero_voltage, float fs_voltage, float *LTC2461_lsb, int32_t *LTC2461_offset_code)
Calibrate the lsb.
Definition: LTC2461.cpp:111
LTC2461_offset_code
static int32_t LTC2461_offset_code
Ideal offset for a perfect part.
Definition: DC1491A.ino:125
LTC2461_read
int8_t LTC2461_read(uint8_t i2c_address, uint8_t adc_command, uint16_t *adc_code)
Reads the ADC and returns 16-bit data.
Definition: LTC2461.cpp:82
adc_code
static uint32_t adc_code
Definition: DC2071AA.ino:113