| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

LTC2492_original.h
Go to the documentation of this file.
1 /*
2 Copyright 2011(c) Analog Devices, Inc.
3
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without modification,
7 are permitted provided that the following conditions are met:
8 - Redistributions of source code must retain the above copyright
9 notice, this list of conditions and the following disclaimer.
10 - Redistributions in binary form must reproduce the above copyright
11 notice, this list of conditions and the following disclaimer in
12 the documentation and/or other materials provided with the
13 distribution.
14 - Neither the name of Analog Devices, Inc. nor the names of its
15 contributors may be used to endorse or promote products derived
16 from this software without specific prior written permission.
17 - The use of this software may or may not infringe the patent rights
18 of one or more patent holders. This license does not release you
19 from the requirement that you obtain separate licenses from these
20 patent holders to use this software.
21 - Use of the software either in source or binary form, must be run
22 on or directly connected to an Analog Devices Inc. component.
23
24 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
25 INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
26 PARTICULAR PURPOSE ARE DISCLAIMED.
27
28 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
29 EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY
30 RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
31 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
32 STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
33 THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 */
35
36
37 //#include <16F876A.h> // Device
38 //#use delay(clock=6000000) // 6MHz clock
39 //#fuses NOWDT,HS, PUT, NOPROTECT, NOBROWNOUT // Configuration fuses
40 //#rom 0x2007 = {0x3f3a}
41
42 //#include "PCM73A.h" // Various defines
43 //#include "lcd420.c" // LCD driver functions
44
45
46 //#byte SSPCON = 0x14
47 //#byte SSPSTAT = 0x94
48 //#bit CKP = SSPCON.4
49 //#bit CKE = SSPSTAT.6
50
51 // Useful defines for the LTC2492 - OR them together to make the
52 // 8 bit channel address and 8 bit config word.
53
54 // Select ADC channel
55 #define CH0_1 0b10101000 // CH0 is negative
56 #define CH2_3 0b10101001 // CH2 is negative
57 #define CH0SE 0b10110000
58 #define CH1SE 0b10111001
59 #define CH2SE 0b10110000
60 #define CH3SE 0b10111000
61 #define NO_CH 0b10100000
62
63 // Select ADC source - differential input or PTAT circuit
64 #define VIN 0b10000000
65 #define PTAT 0b11000000
66
67 // Select rejection frequency - 50, 55, or 60Hz
68 #define R50 0b10010000
69 #define R55 0b10000000
70 #define R60 0b10100000
71
72 // Speed settings is bit 7 in the 2nd byte
73 #define SLOW 0b10000000 // slow output rate with autozero
74 #define FAST 0b10001000 // fast output rate with no autozero
75
76 // Define connections to LTC2480 and buttons
77 //#define CS PIN_C2
78 //#define INC_BUTTON PIN_A0
79 //#define DEC_BUTTON PIN_A1
80 //#define CAL_JUMPER PIN_A4
81
82
83
84 // Function Prototypes
85 int32_t read_LTC2492(char channel, char config);
86 void initialize(void);
87 void display(void);
88 void calibrate(void);
89 void read_calibration(void);
90 float type_K_V2C(float tc_voltage, float cj_temp);
channel
static uint8_t channel
LTC2305 Channel selection.
Definition: DC1444A.ino:127
cj_temp
float cj_temp
Definition: LTC2492_Thermocouple_Meter.ino:127
display
void display(void)
type_K_V2C
float type_K_V2C(float tc_voltage, float cj_temp)
read_calibration
void read_calibration(void)
read_LTC2492
int32_t read_LTC2492(char channel, char config)
calibrate
void calibrate(void)
initialize
void initialize(void)