| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

DC1410AB.ino
Go to the documentation of this file.
1 /*!
2 Linear Technology DC1410A-B Demonstration Board.
3 LTC2449: 24-Bit, 16-Channel Delta Sigma ADC with SPI interface
4
5 @verbatim
6
7 NOTES
8 Setup:
9 Set the terminal baud rate to 115200 and select the newline terminator. Equipment
10 required is a precision voltage source and a precision voltmeter. Additionally,
11 an external power supply is required to provide a negative voltage for Amp V-.
12 Set it to anywhere from -1V to -5V. Set Amp V+ to Vcc. Ensure the COM and REF-
13 pins are connected to ground. The REF+ pin should be connected to +5V.
14
15 How Measure a Load Cell:
16 The LTC2449 allowas a wide common mode range of 0V to Vcc. The LT1678 OPAMP common
17 mode range is V- + 1.5 to V+ - 0.8V. Ensure the load cell sensor meets the requirments
18 of the ADC and amplifier. Lastly, set the desired gain and read in differential mode.
19
20 USER INPUT DATA FORMAT:
21 decimal : 1024
22 hex : 0x400
23 octal : 02000 (leading 0 "zero")
24 binary : B10000000000
25 float : 1024.0
26
27 @endverbatim
28
29 http://www.linear.com/product/LTC2449
30
31 http://www.linear.com/product/LTC2449#demoboards
32
33
34 Copyright 2018(c) Analog Devices, Inc.
35
36 All rights reserved.
37
38 Redistribution and use in source and binary forms, with or without
39 modification, are permitted provided that the following conditions are met:
40 - Redistributions of source code must retain the above copyright
41 notice, this list of conditions and the following disclaimer.
42 - Redistributions in binary form must reproduce the above copyright
43 notice, this list of conditions and the following disclaimer in
44 the documentation and/or other materials provided with the
45 distribution.
46 - Neither the name of Analog Devices, Inc. nor the names of its
47 contributors may be used to endorse or promote products derived
48 from this software without specific prior written permission.
49 - The use of this software may or may not infringe the patent rights
50 of one or more patent holders. This license does not release you
51 from the requirement that you obtain separate licenses from these
52 patent holders to use this software.
53 - Use of the software either in source or binary form, must be run
54 on or directly connected to an Analog Devices Inc. component.
55
56 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
57 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
58 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
59 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
60 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
61 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
62 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
63 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
64 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
65 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
66
67 */
68
69 /*! @file
70 @ingroup LTC2449
71 */
72
73 #include <Arduino.h>
74 #include <stdint.h>
75 #include "Linduino.h"
76 #include "LT_SPI.h"
77 #include <SPI.h>
78 #include "UserInterface.h"
79 #include "LT_I2C.h"
80 #include "QuikEval_EEPROM.h"
81 #include "LTC24XX_general.h"
82 #include "LTC2449.h"
83 #include "LTC24XX_general.h"
84
85 // Function Declaration
86 void print_title(); // Print the title block
87 void print_prompt(); // Prompt the user for an input command
88 void print_user_command(uint8_t menu); // Display selected differential channels
89
90 uint8_t menu_1_read_differential(); // Read the ADC in differential mode
91 void set_gain(uint8_t a_pin, uint8_t b_pin, uint8_t gain); // Drive the select pins to get desired gain
92 void init_gain_pins(uint8_t a_pin, uint8_t b_pin); // Initialize the MUX select pins
93 void menu_2_set_osr(); // Set the OSR for the ADC
94 void menu_3_set_channel_gain(); // Sets gains for indvidual channels
95 void print_gain(uint8_t gain); // Displays the current channel gain setting
96
97 enum Av {unity, g8, g16, g32}; // Gain options
98
99 // Global variables
100 static uint8_t demo_board_connected; //!< Set to 1 if the board is connected
101 static uint16_t osr = LTC2449_OSR_32768; //!< Default OSR is 32768
102 static float LTC2449_lsb = 5.0 / 536870911; //!< The LTC2449 ideal reference voltage
103 static uint16_t eoc_timeout = 250; //!< Timeout in ms
104 uint8_t filt_flag = 1; //!< Keeps track when filters need to be reset
105 uint8_t channel_gain[6] = {g32, g32, g32, g32, g32, g32}; //!< default is gain 32
106
107 // Constants
108 //! Lookup table for reads
109 const uint16_t read_command_seq[] = {LTC2449_P12_N13,
110 LTC2449_P14_N15, LTC2449_P14_N15, LTC2449_P14_N15, LTC2449_P14_N15,
111 LTC2449_P0_N1, LTC2449_P2_N3, LTC2449_P4_N5, LTC2449_P6_N7, LTC2449_P8_N9,
112 LTC2449_P10_N11, LTC2449_P10_N11
113 }; //!< Channel read sequence for the demo board
114
115 //! Lookup table for gain setting reads
116 uint8_t read_gain_seq[] = {unity, unity, unity, g8, g16, g32, channel_gain[0], channel_gain[1], channel_gain[2], channel_gain[3],
117 channel_gain[4], channel_gain[5]
118 }; //!< The gain sequence for the auto calibration
119 //! Lookup table for OSR
120 const uint16_t OSR_COMMAND[] = {LTC2449_OSR_64, LTC2449_OSR_128, LTC2449_OSR_256, LTC2449_OSR_512, LTC2449_OSR_1024,
121 LTC2449_OSR_2048, LTC2449_OSR_4096, LTC2449_OSR_8192, LTC2449_OSR_16384, LTC2449_OSR_32768
122 }; //!< Build the command for OSR
123
124 //! Gain MUX pins
125 const uint8_t A_PIN = 4;
126 const uint8_t B_PIN = 7;
127
128 //! Exponential filter smothing constant for the offset
129 const float smoothing_const = 0.7;
130
131 //! Initialize Linduino
132 void setup()
133 {
134 init_gain_pins(A_PIN, B_PIN); // Initialize the gain pins as outputs
135
136 char demo_name[] = "DC1410"; // Demo Board Name stored in QuikEval EEPROM
137 quikeval_SPI_init(); // Configure the spi port for 4MHz SCK
138 quikeval_SPI_connect(); // Connect SPI to main data port
139 quikeval_I2C_init(); // Configure the EEPROM I2C port for 100kHz
140 Serial.begin(115200); // Initialize the serial port to the PC
141 print_title();
142
143 demo_board_connected = discover_demo_board(demo_name);
144 if (demo_board_connected)
145 {
146 print_prompt();
147 }
148 else
149 {
150 Serial.println(F("EEPROM not detected, will attempt to proceed"));
151 print_prompt();
152 }
153 quikeval_SPI_connect(); // Initialize for SPI
154 }
155
156 //! Repeats Linduino loop
157 void loop()
158 {
159 int16_t user_command; // The user input command
160 uint8_t ack_EOC = 0; // Keeps track of the EOC timeout
161 if (Serial.available()) // Check for user input
162 {
163 user_command = read_int(); // Read the user command
164 if (user_command != 'm')
165 Serial.println(user_command); // Prints the user command to com port
166 Serial.flush();
167 switch (user_command)
168 {
169 case 1:
170 ack_EOC |= menu_1_read_differential();
171 break;
172 case 2:
173 menu_2_set_osr();
174 break;
175 case 3:
176 menu_3_set_channel_gain();
177 break;
178 default:
179 Serial.println(F("Incorrect Option"));
180 }
181 if (ack_EOC)
182 Serial.println(F("\n******SPI ERROR******\n"));
183 Serial.print(F("\n*************************\n"));
184 print_prompt();
185 }
186 }
187
188 // Function Definitions
189
190 //! Prints the title block when program first starts.
191 void print_title()
192 {
193 Serial.print(F("\n*****************************************************************\n"));
194 Serial.print(F("* DC1410A-B Demonstration Program *\n"));
195 Serial.print(F("* *\n"));
196 Serial.print(F("* This program demonstrates how to measure strain gauge or *\n"));
197 Serial.print(F("* other form of a Wheatstone bridge sensors with the LTC2449 *\n"));
198 Serial.print(F("* *\n"));
199 Serial.print(F("* *\n"));
200 Serial.print(F("* Set the baud rate to 115200 and select the newline terminator.*\n"));
201 Serial.print(F("* *\n"));
202 Serial.print(F("*****************************************************************\n"));
203 }
204
205 //! Prints main menu.
206 void print_prompt()
207 {
208 Serial.print(F("\n1-Read Differential\n"));
209 Serial.print(F("2-OSR Settings\n"));
210 Serial.print(F("3-Set Channel Gain\n"));
211 Serial.print(F("Enter a Command: "));
212 }
213
214 //! Read channels in differential mode
215 //! @return Returns 0=successful, 1=unsuccessful (exceeded timeout)
216 uint8_t menu_1_read_differential()
217 {
218 int8_t y; // Offset into differential channel array to select polarity
219 uint16_t adc_command; // The LTC2449 command word
220 int16_t user_command; // The user input command
221 uint32_t adc_code[12]; // The LTC2449 code
222 float adc_voltage; // The LTC2449 voltage
223 float offset = 0.0; // The ADC channel offset
224 float gain_unity = 0.0; // The code for unity gain
225 float gain_8 = 0.0; // The calculated gain of 8
226 float gain_16 = 0.0; // The calculated gain of 16
227 float gain_32 = 0.0; // The calculated gain of 32
228 float gain_value[4]; // The calculated gain
229
230 do
231 {
232 // Read the calibration channels first then the rest of the channels
233 for (int8_t i = 0; i <= 11; i++)
234 {
235 set_gain(A_PIN, B_PIN, read_gain_seq[i]); // Set the MUX to the desired gain
236 adc_command = read_command_seq[i] | osr;
237 // Ensure a conversions are complete
238 if (LTC2449_EOC_timeout(LTC2449_CS, eoc_timeout))
239 return 1;
240 // Read the LTC2449
241 LTC2449_read(LTC2449_CS, adc_command, adc_code + i);
242 }
243
244 if (filt_flag)
245 {
246 filt_flag = 0;
247 offset = adc_code[1] - 536870912;
248 gain_unity = ((float)adc_code[2]) - 536870912;
249 gain_8 = ((float)adc_code[3] - 536870912) / gain_unity;
250 gain_16 = ((float)adc_code[4] - 536870912) / gain_unity;
251 gain_32 = ((float)adc_code[5] - 536870912) / gain_unity;
252 }
253 else
254 {
255 // IIR exponential filter
256 offset = (1.0 - smoothing_const ) * ((float)adc_code[1] - 536870912) + smoothing_const * offset;
257 gain_unity = ((float)adc_code[2]) - 536870912;
258 gain_8 = (1.0 - smoothing_const) * (((float)adc_code[3] - 536870912) / gain_unity) + smoothing_const * gain_8;
259 gain_16 = (1.0 - smoothing_const) * (((float)adc_code[4] - 536870912) / gain_unity) + smoothing_const * gain_16;
260 gain_32 = (1.0 - smoothing_const) * (((float)adc_code[5] - 536870912) / gain_unity) + smoothing_const * gain_32;
261 }
262
263 gain_value[0] = 1; // Assume ideal unity gain
264 gain_value[1] = gain_8;
265 gain_value[2] = gain_16;
266 gain_value[3] = gain_32;
267
268 // Display the readings and data
269 Serial.println(F("\n**********"));
270 Serial.print(F(" Offset: "));
271 Serial.print(offset, 6);
272 Serial.print(F(" "));
273 Serial.print(LTC24XX_diff_code_to_calibrated_voltage(((int32_t)offset) + 536870912, LTC2449_lsb, 0.0) * 1000, 4);
274 Serial.println(F(" mV"));
275 Serial.print(F(" G8: "));
276 Serial.println(gain_8, 6);
277 Serial.print(F(" G16: "));
278 Serial.println(gain_16, 6);
279 Serial.print(F(" G32: "));
280 Serial.println(gain_32, 6);
281 Serial.println();
282
283 Serial.println(F("CH ADC Code Gain Comp Voltage (mV)"));
284 Serial.print(F("P0-N1: 0x"));
285 Serial.print(adc_code[5], HEX);
286 Serial.print(" ");
287 Serial.print(gain_value[channel_gain[0]], 6);
288 Serial.print(F(" "));
289 Serial.println(1000 * LTC24XX_diff_code_to_calibrated_voltage(adc_code[6], LTC2449_lsb, offset) / gain_value[channel_gain[0]], 6);
290
291 Serial.print(F("P2-N3: 0x"));
292 Serial.print(adc_code[6], HEX);
293 Serial.print(F(" "));
294 Serial.print(gain_value[channel_gain[1]], 6);
295 Serial.print(" ");
296 Serial.println(1000 * LTC24XX_diff_code_to_calibrated_voltage(adc_code[7], LTC2449_lsb, offset) / gain_value[channel_gain[1]], 6);
297
298 Serial.print(F("P4-N5: 0x"));
299 Serial.print(adc_code[7], HEX);
300 Serial.print(F(" "));
301 Serial.print(gain_value[channel_gain[2]], 6);
302 Serial.print(" ");
303 Serial.println(1000 * LTC24XX_diff_code_to_calibrated_voltage(adc_code[8], LTC2449_lsb, offset) / gain_value[channel_gain[2]], 6);
304
305 Serial.print(F("P6-N7: 0x"));
306 Serial.print(adc_code[8], HEX);
307 Serial.print(F(" "));
308 Serial.print(gain_value[channel_gain[3]], 6);
309 Serial.print(" ");
310 Serial.println(1000 * LTC24XX_diff_code_to_calibrated_voltage(adc_code[9], LTC2449_lsb, offset) / gain_value[channel_gain[3]], 6);
311
312 Serial.print(F("P8-N9: 0x"));
313 Serial.print(adc_code[9], HEX);
314 Serial.print(F(" "));
315 Serial.print(gain_value[channel_gain[4]], 6);
316 Serial.print(" ");
317 Serial.println(1000 * LTC24XX_diff_code_to_calibrated_voltage(adc_code[10], LTC2449_lsb, offset) / gain_value[channel_gain[4]], 6);
318
319 Serial.print(F("P10-N11: 0x"));
320 Serial.print(adc_code[10], HEX);
321 Serial.print(F(" "));
322 Serial.print(gain_value[channel_gain[5]], 6);
323 Serial.print(" ");
324 Serial.println(1000 * LTC24XX_diff_code_to_calibrated_voltage(adc_code[11], LTC2449_lsb, offset) / gain_value[channel_gain[5]], 6);
325
326 Serial.println();
327 Serial.println(F("Enter any character to exit"));
328
329 }
330 while (Serial.available() == 0);
331 while (Serial.available())
332 Serial.read();
333 Serial.flush();
334 return 0;
335 }
336
337 //! Set the Mux select pins to the desired gain
338 void set_gain(uint8_t a_pin, uint8_t b_pin, uint8_t gain)
339 {
340 digitalWrite(a_pin, gain & 0b01);
341 digitalWrite(b_pin, gain & 0b10);
342 }
343
344 //! initialize the MUX select pins
345 void init_gain_pins(uint8_t a_pin, uint8_t b_pin)
346 {
347 pinMode(a_pin, OUTPUT);
348 pinMode(b_pin, OUTPUT);
349 digitalWrite(a_pin, LOW);
350 digitalWrite(b_pin, LOW);
351 }
352
353 //! Allows the user to sets the desired gain
354 void menu_3_set_channel_gain()
355 {
356 int16_t user_command; // The user input cammand
357
358 while (1)
359 {
360 // Display gain settings
361 Serial.print(F("\nCurrent Gain Settings:\n"));
362 Serial.print(F(" CH 0P-1N gain: "));
363 print_gain(channel_gain[0]);
364 Serial.print(F(" CH 2P-3N gain: "));
365 print_gain(channel_gain[1]);
366 Serial.print(F(" CH 4P-5N gain: "));
367 print_gain(channel_gain[2]);
368 Serial.print(F(" CH 6P-7N gain: "));
369 print_gain(channel_gain[3]);
370 Serial.print(F(" CH 8P-9N gain: "));
371 print_gain(channel_gain[4]);
372 Serial.print(F(" CH 10P-11N gain: "));
373 print_gain(channel_gain[5]);
374
375 Serial.print(F("\n\n"));
376 Serial.print(F("Channel Select\n"));
377 Serial.print(F(" 0-0P-1N 3-6P-7N\n"));
378 Serial.print(F(" 1-2P-3N 4-8P-9N\n"));
379 Serial.print(F(" 2-4P-5N 5-10P-11N\n"));
380 Serial.print(F(" 6-ALL\n"));
381 Serial.print(F("m-Main Menu\n"));
382 Serial.print(F("Enter a Command: "));
383
384 user_command = read_int(); // Read the single command
385 uint8_t channel = user_command;
386 if (user_command == 'm')
387 {
388 Serial.println(F("m"));
389 break;
390 }
391 Serial.println(user_command);
392 if (user_command > 6)
393 Serial.println(F("Incorrect Option"));
394 else
395 {
396 if (user_command == 6)
397 {
398 Serial.print(F("\nGain Options\n"));
399 Serial.print(F(" 0-Unity Gain\n"));
400 Serial.print(F(" 1-Gain of 8\n"));
401 Serial.print(F(" 2-Gain of 16\n"));
402 Serial.print(F(" 3-Gain of 32\n"));
403 Serial.print(F("Enter a Command: "));
404 user_command = read_int(); // Read the single command
405 Serial.println(user_command);
406 if (user_command < 0 || user_command > 3)
407 Serial.print(F("Incorrect Gain Option"));
408 else
409 {
410 for (uint8_t i = 0; i <= 5; i++)
411 {
412 channel_gain[i] = user_command;
413 }
414 }
415 }
416 else
417 {
418 Serial.print(F("\nGain Options\n"));
419 Serial.print(F(" 0-Unity Gain\n"));
420 Serial.print(F(" 1-Gain of 8\n"));
421 Serial.print(F(" 2-Gain of 16\n"));
422 Serial.print(F(" 3-Gain of 32\n"));
423 Serial.print(F("Enter a Command: "));
424 user_command = read_int(); // Read the single command
425 Serial.println(user_command);
426 if (user_command < 0 || user_command > 3)
427 Serial.print(F("Incorrect Gain Option"));
428 else
429 channel_gain[channel] = user_command;
430 }
431 }
432 }
433 for (int8_t i = 0; i <= 5; i++)
434 read_gain_seq[i + 6] = channel_gain[i];
435 filt_flag = 1;
436 }
437
438 //! Utility function to display the gain
439 void print_gain(uint8_t gain)
440 {
441 switch (gain)
442 {
443 case unity:
444 Serial.print(F("Unity\n"));
445 break;
446 case g8:
447 Serial.print(F("8\n"));
448 break;
449 case g16:
450 Serial.print(F("16\n"));
451 break;
452 case g32:
453 Serial.print(F("32\n"));
454 break;
455 }
456 }
457
458 //! Allows the user to sets the desired OSR
459 void menu_2_set_osr()
460 {
461 int16_t user_command; // The user input command
462
463 // OSR settings
464 Serial.print(F("OSR Settings\n\n"));
465 Serial.print(F("0-64\n"));
466 Serial.print(F("1-128\n"));
467 Serial.print(F("2-256\n"));
468 Serial.print(F("3-512\n"));
469 Serial.print(F("4-1024\n"));
470 Serial.print(F("5-2048\n"));
471 Serial.print(F("6-4096\n"));
472 Serial.print(F("7-8192\n"));
473 Serial.print(F("8-16384\n"));
474 Serial.print(F("9-32768\n"));
475 Serial.print(F("Enter a Command: "));
476
477 user_command = read_int();
478 if (user_command <= 0)
479 {
480 user_command = 0;
481 }
482 else if (user_command > 9)
483 {
484 user_command = 9;
485 }
486 Serial.println(user_command);
487
488 osr = OSR_COMMAND[user_command];
489 filt_flag = 1;
490 }
init_gain_pins
static void init_gain_pins(uint8_t a_pin, uint8_t b_pin)
initialize the MUX select pins
Definition: DC1410AB.ino:345
g16
Definition: DC1410AB.ino:97
LTC2449_P10_N11
#define LTC2449_P10_N11
Definition: LTC2449.h:191
print_prompt
static void print_prompt()
Prints main menu.
Definition: DC1410AB.ino:206
user_command
unsigned char user_command
Definition: Serial_EEPROM_Test.ino:75
adc_command
static uint8_t adc_command
Definition: DC2071AA.ino:111
LTC2449_P14_N15
#define LTC2449_P14_N15
Definition: LTC2449.h:197
LTC2449_CS
#define LTC2449_CS
Define the SPI CS pin.
Definition: LTC2449.h:140
g8
Definition: DC1410AB.ino:97
osr
static uint16_t osr
Default OSR is 32768.
Definition: DC1410AB.ino:101
filt_flag
static uint8_t filt_flag
Keeps track when filters need to be reset.
Definition: DC1410AB.ino:104
LTC2449_OSR_2048
#define LTC2449_OSR_2048
Definition: LTC2449.h:217
LTC2449_P6_N7
#define LTC2449_P6_N7
Definition: LTC2449.h:185
LTC2449_OSR_32768
#define LTC2449_OSR_32768
Definition: LTC2449.h:221
LTC2449_OSR_8192
#define LTC2449_OSR_8192
Definition: LTC2449.h:219
Linduino.h
Header File for Linduino Libraries and Demo Code.
channel_gain
static uint8_t channel_gain[6]
default is gain 32
Definition: DC1410AB.ino:105
channel
static uint8_t channel
LTC2305 Channel selection.
Definition: DC1444A.ino:127
B_PIN
const uint8_t B_PIN
Definition: DC1410AB.ino:126
LTC2449_OSR_16384
#define LTC2449_OSR_16384
Definition: LTC2449.h:220
menu_1_read_differential
static uint8_t menu_1_read_differential()
Read channels in differential mode.
Definition: DC1410AB.ino:216
menu_3_set_channel_gain
static void menu_3_set_channel_gain()
Allows the user to sets the desired gain.
Definition: DC1410AB.ino:354
LTC24XX_diff_code_to_calibrated_voltage
float LTC24XX_diff_code_to_calibrated_voltage(int32_t adc_code, float LTC2449_lsb, int32_t LTC2449_offset_code)
Calculates the voltage corresponding to an ADC code, given lsb weight (in volts) and the calibrated A...
Definition: LTC24XX_general.cpp:409
adc_voltage
static float adc_voltage
Definition: DC2071AA.ino:115
LTC24XX_general.h
LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs.
menu_2_set_osr
static void menu_2_set_osr()
Allows the user to sets the desired OSR.
Definition: DC1410AB.ino:459
print_title
static void print_title()
Prints the title block when program first starts.
Definition: DC1410AB.ino:191
LTC2449_P0_N1
#define LTC2449_P0_N1
Definition: LTC2449.h:176
LTC2449_P12_N13
#define LTC2449_P12_N13
Definition: LTC2449.h:194
Av
Av
Definition: DC1410AB.ino:97
smoothing_const
const float smoothing_const
Exponential filter smothing constant for the offset.
Definition: DC1410AB.ino:129
A_PIN
const uint8_t A_PIN
Gain MUX pins.
Definition: DC1410AB.ino:125
read_gain_seq
static uint8_t read_gain_seq[]
Lookup table for gain setting reads.
Definition: DC1410AB.ino:116
QuikEval_EEPROM.h
QuikEval EEPROM Library.
loop
static void loop()
Repeats Linduino loop.
Definition: DC1410AB.ino:157
eoc_timeout
static uint16_t eoc_timeout
Timeout in ms.
Definition: DC1410AB.ino:103
quikeval_SPI_init
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
Definition: LT_SPI.cpp:151
LTC2449_OSR_512
#define LTC2449_OSR_512
Definition: LTC2449.h:215
demo_board_connected
static uint8_t demo_board_connected
Set to 1 if the board is connected.
Definition: DC1410AB.ino:100
discover_demo_board
int8_t discover_demo_board(char *demo_name)
Read the ID string from the EEPROM and determine if the correct board is connected.
Definition: QuikEval_EEPROM.cpp:141
LT_SPI.h
LT_SPI: Routines to communicate with ATmega328P&#39;s hardware SPI port.
print_gain
static void print_gain(uint8_t gain)
Utility function to display the gain.
Definition: DC1410AB.ino:439
LTC2449_P4_N5
#define LTC2449_P4_N5
Definition: LTC2449.h:182
LT_I2C.h
LT_I2C: Routines to communicate with ATmega328P&#39;s hardware I2C port.
LTC2449_P2_N3
#define LTC2449_P2_N3
Definition: LTC2449.h:179
demo_name
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
Definition: DC1880A.ino:97
print_user_command
static void print_user_command(uint8_t menu)
quikeval_SPI_connect
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
Definition: LT_SPI.cpp:138
UserInterface.h
setup
static void setup()
Initialize Linduino.
Definition: DC1410AB.ino:132
read_int
int32_t read_int()
Definition: UserInterface.cpp:93
OSR_COMMAND
const uint16_t OSR_COMMAND[]
Lookup table for OSR.
Definition: DC1410AB.ino:120
LTC2449.h
LTC2449: 24-Bit, 16-Channel Delta Sigma ADCs with Selectable Speed/Resolution.
LTC2449_OSR_64
#define LTC2449_OSR_64
Definition: LTC2449.h:212
LTC2449_OSR_128
#define LTC2449_OSR_128
Definition: LTC2449.h:213
LTC2449_OSR_1024
#define LTC2449_OSR_1024
Definition: LTC2449.h:216
LTC2449_lsb
static float LTC2449_lsb
The LTC2449 ideal reference voltage.
Definition: DC1410AB.ino:102
LTC2449_OSR_256
#define LTC2449_OSR_256
Definition: LTC2449.h:214
LTC2449_OSR_4096
#define LTC2449_OSR_4096
Definition: LTC2449.h:218
quikeval_I2C_init
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
Definition: LT_I2C.cpp:394
i
static int i
Definition: DC2430A.ino:184
LTC2449_P8_N9
#define LTC2449_P8_N9
Definition: LTC2449.h:188
read_command_seq
const uint16_t read_command_seq[]
Lookup table for reads.
Definition: DC1410AB.ino:109
unity
Definition: DC1410AB.ino:97
set_gain
static void set_gain(uint8_t a_pin, uint8_t b_pin, uint8_t gain)
Set the Mux select pins to the desired gain.
Definition: DC1410AB.ino:338
LTC2449_EOC_timeout
int8_t LTC2449_EOC_timeout(uint8_t cs, uint16_t miso_timeout)
Define the SPI CS pin.
Definition: LTC2449.cpp:86
g32
Definition: DC1410AB.ino:97
adc_code
static uint32_t adc_code
Definition: DC2071AA.ino:113
LTC2449_read
void LTC2449_read(uint8_t cs, uint16_t adc_command, uint32_t *adc_code)
Reads from LTC2449.
Definition: LTC2449.cpp:107