Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC2348.h
Go to the documentation of this file.
1 /*!
2 LTC2348-18: Octal, 18-Bit, 200ksps Differential ±10.24V Input SoftSpan ADC with Wide Input Common Mode Range.
3 LTC2348-16: Octal, 16-Bit, 200ksps Differential ±10.24V Input SoftSpan ADC with Wide Input Common Mode Range.
4 LTC2344-18: Quad, 18-Bit, 400ksps/ch Differential SoftSpan ADC with Wide Input Common Mode Range.
5 LTC2344-16: Quad, 16-Bit, 400ksps/ch Differential SoftSpan ADC with Wide Input Common Mode Range.
6 LTC2333-18: Buffered 8-Channel, 18-Bit, 800ksps Differential ±10.24V ADC with 30VP-P Common Mode Range.
7 LTC2333-16: Buffered 8-Channel, 16-Bit, 800ksps Differential ±10.24V ADC with 30VP-P Common Mode Range.
8 LTC2357-18: Buffered Quad, 18-Bit, 350ksps/Ch Differential ±10.24V ADC with 30VP-P Common Mode Range.
9 LTC2357-16: Buffered Quad, 16-Bit, 350ksps/Ch Differential ±10.24V ADC with 30VP-P Common Mode Range.
10 LTC2358-18: Buffered Octal, 18-Bit, 200ksps/Ch Differential ±10.24V ADC with 30VP-P Common Mode Range.
11 LTC2358-16: Buffered Octal, 16-Bit, 200ksps/Ch Differential ±10.24V ADC with 30VP-P Common Mode Range.
12 LTC2353-18: Buffered Dual, 18-Bit, 550ksps/Ch Differential ±10.24V ADC with 30VP-P Common Mode Range.
13 LTC2353-16: Buffered Dual, 16-Bit, 550ksps/Ch Differential ±10.24V ADC with 30VP-P Common Mode Range.
14 
15 
16 @verbatim
17 
18 The LTC2348 is an 18-bit,low noise 8-channel simultaneous sampling successive
19 approximation register(SAR) ADC with differential,wide common mode range
20 inputs. Operating from a 5V low voltage supply, flexible high voltage supplies,
21 and using the internal reference and buffer, each channel of this SoftSpan ADC
22 can be independently configured on a conversion-by-conversion basis to accept
23 ±10.24V, 0V to 10.24V, ±5.12V,or 0V to 5.12V signals. Individual channels may
24 also be disabled to increase throughput on the remaining channels
25 
26 SPI DATA FORMAT :
27  SoftSpan Configuration Word for Conversion N+1
28 Data In : S23 S22 S21 S20 S19 S18 S17 S16 S15 S14 S13 S12 S11 S10 S9 S8 S7 S6 S5 S4 S3 S2 S1 S0
29 
30  Conversion N Channel 0
31 SDO0 : D17 D16 D15 D14 D13 D12 D11 D10 D9 D8 D7 D6 D5 D4 D3 D2 D1 D0 C2 C1 C0 SS2 SS1 SS0
32 
33 Sx : SoftSpan Configuration Bits
34 Dx : Data Bits
35 Cx : Channel ID Bits
36 SSx : SoftSpan Configuration Bits of corresponding channel
37 
38 @endverbatim
39 
40 http://www.linear.com/product/LTC2348-18
41 http://www.linear.com/product/LTC2348-16
42 http://www.linear.com/product/LTC2344-18
43 http://www.linear.com/product/LTC2344-16
44 http://www.linear.com/product/LTC2333-18
45 http://www.linear.com/product/LTC2333-16
46 http://www.linear.com/product/LTC2357-18
47 http://www.linear.com/product/LTC2357-16
48 http://www.linear.com/product/LTC2358-18
49 http://www.linear.com/product/LTC2358-16
50 http://www.linear.com/product/LTC2353-18
51 http://www.linear.com/product/LTC2353-16
52 
53 http://www.linear.com/product/LTC2348-18#demoboards
54 http://www.linear.com/product/LTC2348-16#demoboards
55 http://www.linear.com/product/LTC2344-18#demoboards
56 http://www.linear.com/product/LTC2344-16#demoboards
57 http://www.linear.com/product/LTC2333-18#demoboards
58 http://www.linear.com/product/LTC2333-16#demoboards
59 http://www.linear.com/product/LTC2357-18#demoboards
60 http://www.linear.com/product/LTC2357-16#demoboards
61 http://www.linear.com/product/LTC2358-18#demoboards
62 http://www.linear.com/product/LTC2358-16#demoboards
63 http://www.linear.com/product/LTC2353-18#demoboards
64 http://www.linear.com/product/LTC2353-16#demoboards
65 
66 
67 Copyright 2018(c) Analog Devices, Inc.
68 
69 All rights reserved.
70 
71 Redistribution and use in source and binary forms, with or without
72 modification, are permitted provided that the following conditions are met:
73  - Redistributions of source code must retain the above copyright
74  notice, this list of conditions and the following disclaimer.
75  - Redistributions in binary form must reproduce the above copyright
76  notice, this list of conditions and the following disclaimer in
77  the documentation and/or other materials provided with the
78  distribution.
79  - Neither the name of Analog Devices, Inc. nor the names of its
80  contributors may be used to endorse or promote products derived
81  from this software without specific prior written permission.
82  - The use of this software may or may not infringe the patent rights
83  of one or more patent holders. This license does not release you
84  from the requirement that you obtain separate licenses from these
85  patent holders to use this software.
86  - Use of the software either in source or binary form, must be run
87  on or directly connected to an Analog Devices Inc. component.
88 
89 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
90 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
91 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
92 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
93 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
94 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
95 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
96 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
97 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
98 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
99 */
100 
101 /*! @file
102  @ingroup LTC23XX
103  Header for LTC23XX: 16/18-Bit Differential Input SoftSpan ADC with Wide Input Common Mode Range.
104 */
105 
106 #ifndef LTC2348_H
107 #define LTC2348_H
108 
109 #define VREF 4.096
110 #define POW2_18 262144
111 #define POW2_17 131072
112 
113 #define CHANNEL_NUMBER 0x38
114 #define SOFTSPAN 0x07
115 
116 #define SNEAKER_PORT_I2C_ADDRESS 0x20
117 
118 //! Creates 24-bit configuration word for the 8 channels.
119 void LTC23XX_create_config_word(uint8_t channel, //!< Channel number
120  uint8_t config_number, //!< Configuration number for the channel
121  uint32_t *config_word //!< 24 bit config word created
122  );
123 
124 //! Transmits 24 bits (3 bytes) of configuration information and
125 //! reads back 24 bytes of data (3 bytes/ 24 bits for each channel)
126 //! 24 bits: 18 bit data + 3 bit config + 3 bit channel number
127 void LTC23XX_read(uint8_t cs_pin, //!< Chip select
128  uint32_t config_word, //!< 3 bytes of configutaion data for 8 channels
129  uint8_t data_array[24] //!< Data array to read in 24 bytes of data from 8 channels
130  );
131 
132 //! Calculates the voltage from ADC output data depending on the channel configuration
133 float LTC23XX_voltage_calculator(uint32_t data, //!< 24 bits of ADC output data for a single channel
134  uint8_t channel_configuration //!< 3 bits of channel configuration data
135  );
136 
137 #endif
void LTC23XX_create_config_word(uint8_t channel, uint8_t config_number, uint32_t *config_word)
Creates 24-bit configuration word for the 8 channels.
Definition: LTC2348.cpp:106
static uint8_t channel
LTC2305 Channel selection.
Definition: DC1444A.ino:127
union LT_union_int32_4bytes data
Definition: DC2094A.ino:138
float LTC23XX_voltage_calculator(uint32_t data, uint8_t channel_configuration)
Calculates the voltage from ADC output data depending on the channel configuration.
Definition: LTC2348.cpp:142
void LTC23XX_read(uint8_t cs_pin, uint32_t config_word, uint8_t data_array[24])
Transmits 24 bits (3 bytes) of configuration information and reads back 24 bytes of data (3 bytes/ 24...
Definition: LTC2348.cpp:115