Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
LTC2496.cpp
Go to the documentation of this file.
1 /*!
2 LTC2496: 16-Bit 8-/16-Channel Delta Sigma ADC with Easy Drive Input Current Cancellation
3 
4 @verbatim
5 
6 The LTC2496 is a 16-channel (8-differential) 16-bit No Latency ΔΣ ADC with Easy
7 Drive technology. The patented sampling scheme eliminates dynamic input current
8 errors and the shortcomings of on-chip buffering through automatic cancellation
9 of differential input current. This allows large external source impedances,
10 and rail-to-rail input signals to be directly digitized while maintaining
11 exceptional DC accuracy.
12 
13 The LTC2496 includes an integrated oscillator. This device can be configured to
14 measure an external signal (from combinations of 16 analog input channels
15 operating in single ended or differential modes). It automatically rejects
16 line frequencies of 50Hz and 60Hz, simultaneously.
17 
18 @endverbatim
19 
20 http://www.linear.com/product/LTC2496
21 
22 http://www.linear.com/product/LTC2496#demoboards
23 
24 
25 
26 Copyright 2018(c) Analog Devices, Inc.
27 
28 All rights reserved.
29 
30 Redistribution and use in source and binary forms, with or without
31 modification, are permitted provided that the following conditions are met:
32  - Redistributions of source code must retain the above copyright
33  notice, this list of conditions and the following disclaimer.
34  - Redistributions in binary form must reproduce the above copyright
35  notice, this list of conditions and the following disclaimer in
36  the documentation and/or other materials provided with the
37  distribution.
38  - Neither the name of Analog Devices, Inc. nor the names of its
39  contributors may be used to endorse or promote products derived
40  from this software without specific prior written permission.
41  - The use of this software may or may not infringe the patent rights
42  of one or more patent holders. This license does not release you
43  from the requirement that you obtain separate licenses from these
44  patent holders to use this software.
45  - Use of the software either in source or binary form, must be run
46  on or directly connected to an Analog Devices Inc. component.
47 
48 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
49 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
50 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
51 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
52 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
53 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
54 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
55 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
56 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
57 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
58 */
59 
60 //! @ingroup Analog_to_Digital_Converters
61 //! @{
62 //! @defgroup LTC2496 LTC2496: 16-Bit 8-/16-Channel Delta Sigma ADC with Easy Drive Input Current Cancellation
63 //! @}
64 
65 /*! @file
66  @ingroup LTC2496
67  Library for LTC2496 LTC2496: 16-Bit 8-/16-Channel Delta Sigma ADC with Easy Drive Input Current Cancellation
68 */
69 
70 #include <stdint.h>
71 #include <Arduino.h>
72 #include "Linduino.h"
73 #include "LT_SPI.h"
74 #include "LTC2496.h"
75 #include "LTC24XX_general.h"
76 #include <SPI.h>
77 
78 // Checks for EOC with a specified timeout
79 int8_t LTC2496_EOC_timeout(uint8_t cs, uint16_t miso_timeout)
80 {
81 
82  return LTC24XX_EOC_timeout(cs,miso_timeout);
83 }
84 
85 // reads the LTC2496
86 void LTC2496_read(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
87 {
88 
89  LTC24XX_SPI_8bit_command_24bit_data(cs, adc_command, adc_code);
90 }
91 
92 
93 float LTC2496_code_to_voltage(int32_t adc_code, float vref)
94 {
95 
96  return(LTC24XX_diff_code_to_voltage(adc_code,vref));
97 }
LTC2496: 16-Bit 8-/16-Channel Delta Sigma ADC with Easy Drive Input Current Cancellation.
static uint8_t adc_command
Definition: DC2071AA.ino:111
Header File for Linduino Libraries and Demo Code.
int8_t LTC24XX_EOC_timeout(uint8_t cs, uint16_t miso_timeout)
Checks for EOC with a specified timeout.
void LTC24XX_SPI_8bit_command_24bit_data(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
Reads from LTC24XX ADC that accepts an 8 bit configuration and returns a 24 bit output word...
LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs.
LT_SPI: Routines to communicate with ATmega328P&#39;s hardware SPI port.
float LTC24XX_diff_code_to_voltage(int32_t adc_code, float vref)
Calculates the voltage corresponding to an ADC code, given the reference voltage. ...
void LTC2496_read(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
Read LTC2496 result, program configuration for next conversion.
Definition: LTC2496.cpp:86
float LTC2496_code_to_voltage(int32_t adc_code, float vref)
Calculates the LTC2496 input voltage.
Definition: LTC2496.cpp:93
int8_t LTC2496_EOC_timeout(uint8_t cs, uint16_t miso_timeout)
Checks for EOC with a specified timeout.
Definition: LTC2496.cpp:79
static uint32_t adc_code
Definition: DC2071AA.ino:113