| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

DC571A.ino
Go to the documentation of this file.
1 /*!
2 Linear Technology DC571A Demonstration Board.
3 LTC2418: 24-bit No Latency Delta Sigma 16-channel ADC
4
5 @verbatim
6
7 NOTES
8 Setup:
9 Set the terminal baud rate to 115200 and select the newline terminator.
10 Equipment required is a precision voltage source and a precision
11 voltmeter. No external power supply is required. Ensure all jumpers on
12 the demo board are installed in their default positions from the
13 factory.
14
15 How to test Single-Ended mode:
16 The voltage source should be connected to the ADC such that the negative
17 lead is connected to ground. The positive lead may be connected to any
18 channel input. Ensure voltage is within analog input voltage range -0.3V to
19 +2.5V.
20
21 How to test Differential Mode:
22 The voltage source should be connected with positive and negative leads to
23 paired channels. The voltage source negative output must also be connected to
24 the COM pin in order to provide a ground-referenced voltage. Ensure voltage is
25 within analog input voltage range -0.3V to +2.5V. Swapping input voltages
26 results in a reversed polarity reading.
27
28 How to calibrate:
29 Apply 100mV to CH0 with respect to COM pin. Next, Measure this voltage with a
30 precise voltmeter and enter this value. (This takes the reading.) Apply a higher
31 voltage than the first voltage or approximately 2.40 volts to CH0. Anything
32 above 2.40 is not reccomened. It is very likely to reach the ADC's full-scale
33 and poduce invalide lsb and offset. Measure this voltage with a precise
34 voltmeter and enter this value. Calibration is now stored in EEPROM. Upon
35 startup the calibration values will be restored.
36
37 USER INPUT DATA FORMAT:
38 decimal : 1024
39 hex : 0x400
40 octal : 02000 (leading 0 "zero")
41 binary : B10000000000
42 float : 1024.0
43
44 @endverbatim
45
46 http://www.linear.com/product/LTC2418
47
48 http://www.linear.com/product/LTC2418#demoboards
49
50
51 Copyright 2018(c) Analog Devices, Inc.
52
53 All rights reserved.
54
55 Redistribution and use in source and binary forms, with or without
56 modification, are permitted provided that the following conditions are met:
57 - Redistributions of source code must retain the above copyright
58 notice, this list of conditions and the following disclaimer.
59 - Redistributions in binary form must reproduce the above copyright
60 notice, this list of conditions and the following disclaimer in
61 the documentation and/or other materials provided with the
62 distribution.
63 - Neither the name of Analog Devices, Inc. nor the names of its
64 contributors may be used to endorse or promote products derived
65 from this software without specific prior written permission.
66 - The use of this software may or may not infringe the patent rights
67 of one or more patent holders. This license does not release you
68 from the requirement that you obtain separate licenses from these
69 patent holders to use this software.
70 - Use of the software either in source or binary form, must be run
71 on or directly connected to an Analog Devices Inc. component.
72
73 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
74 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
75 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
76 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
77 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
78 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
79 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
80 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
81 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
82 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
83 */
84
85 /*! @file
86 @ingroup LTC2418
87 */
88
89 #include <Arduino.h>
90 #include <stdint.h>
91 #include "Linduino.h"
92 #include "LT_SPI.h"
93 #include "LT_I2C.h"
94 #include "UserInterface.h"
95 #include "QuikEval_EEPROM.h"
96 #include "LTC2418.h"
97 #include <SPI.h>
98 #include <Wire.h>
99
100 // Function Declaration
101 void print_title(); // Print the title block
102 void print_prompt(); // Prompt the user for an input command
103 void print_user_command(uint8_t menu); // Display selected differential channels
104 void store_calibration(); // store the ADC calibration to the EEPROM
105 int8_t restore_calibration(); // read the calibration from EEPROM return 1 if successful, 0 if not
106
107 int8_t menu_1_read_single_ended();
108 int8_t menu_2_read_differential();
109 int8_t menu_3_calibrate();
110
111 // Global variables
112 static uint8_t demo_board_connected; //!< Set to 1 if the board is connected
113 static float LTC2418_lsb = 5.9604652E-7; //!< Ideal LSB voltage for a perfect part
114 static int32_t LTC2418_offset_code = 0; //!< Ideal offset for a perfect part
115
116
117 //Constants
118 //! Lookup table to build the command for single-ended mode channels
119 const uint8_t BUILD_COMMAND_SINGLE_ENDED[16] = {LTC2418_CH0, LTC2418_CH1, LTC2418_CH2, LTC2418_CH3,
120 LTC2418_CH4, LTC2418_CH5, LTC2418_CH6, LTC2418_CH7,
121 LTC2418_CH8, LTC2418_CH9, LTC2418_CH10, LTC2418_CH11,
122 LTC2418_CH12, LTC2418_CH13, LTC2418_CH14, LTC2418_CH15
123 }; //!< Builds the command for single-ended mode
124
125 //! Lookup table to build the command for differential mode channels
126 const uint8_t BUILD_COMMAND_DIFF[16] = {LTC2418_P0_N1, LTC2418_P2_N3, LTC2418_P4_N5, LTC2418_P6_N7,
127 LTC2418_P8_N9, LTC2418_P10_N11, LTC2418_P12_N13, LTC2418_P14_N15,
128 LTC2418_P1_N0, LTC2418_P3_N2, LTC2418_P5_N4, LTC2418_P7_N6,
129 LTC2418_P9_N8, LTC2418_P11_N10, LTC2418_P13_N12, LTC2418_P15_N14
130 }; //!< Build the command for differential
131
132 const uint16_t MISO_TIMEOUT = 1000; //!< The MISO timeout (ms)
133
134 //! Initialize Linduino
135 void setup()
136 {
137 char demo_name[6]="DC571"; // Demo Board Name stored in QuikEval EEPROM
138 quikeval_SPI_init(); // Configure the spi port for 4MHz SCK
139 quikeval_SPI_connect(); // Connect SPI to main data port
140 quikeval_I2C_init(); // Configure the EEPROM I2C port for 100kHz
141 Serial.begin(115200); // Initialize the serial port to the PC
142 print_title();
143 demo_board_connected = discover_demo_board(demo_name);
144 if (!(demo_board_connected)) // Resolves EEPROM string variation
145 {
146 Serial.print(F("Checking for string variation\n"));
147 demo_name[0]='D';
148 demo_name[1]='C';
149 demo_name[2]='5';
150 demo_name[3]='7';
151 demo_name[4]='1';
152 demo_name[5]='-';
153 demo_board_connected = discover_demo_board(demo_name);
154 }
155 if (demo_board_connected)
156 {
157 restore_calibration();
158 print_prompt();
159 }
160 }
161
162 //! Repeats Linduino loop
163 void loop()
164 {
165 int16_t user_command; // The user input command
166 uint8_t acknowledge = 0;
167 if (demo_board_connected)
168 {
169 if (Serial.available()) // Check for user input
170 {
171 user_command = read_int(); // Read the user command
172 if (user_command != 'm')
173 Serial.println(user_command); // Prints the user command to com port
174 switch (user_command)
175 {
176 case 1:
177 acknowledge |= menu_1_read_single_ended();
178 break;
179 case 2:
180 acknowledge |= menu_2_read_differential();
181 break;
182 case 3:
183 acknowledge |= menu_3_calibrate();
184 break;
185 default:
186 Serial.println("Incorrect Option");
187 break;
188 }
189 if (acknowledge)
190 Serial.println(F("***** SPI ERROR ******"));
191 Serial.print(F("\n*************************\n"));
192 print_prompt();
193 }
194 }
195 }
196
197 // Function Definitions
198
199 //! Read channels in single-ended mode
200 //! @return 0 when m is entered into menu, 1 if timeout for EOC
201 int8_t menu_1_read_single_ended()
202 {
203 uint8_t adc_command; // The LTC2418 command byte
204 int16_t user_command; // The user input command
205 uint32_t adc_code; // The LTC2418 code
206 float adc_voltage; // The LTC2418 voltage
207
208 while (1)
209 {
210 Serial.print(F("*************************\n\n")); // Display single-ended menu
211 Serial.print(F("0-CH0 8-CH8\n"));
212 Serial.print(F("1-CH1 9-CH9\n"));
213 Serial.print(F("2-CH2 10-CH10\n"));
214 Serial.print(F("3-CH3 11-CH11\n"));
215 Serial.print(F("4-CH4 12-CH12\n"));
216 Serial.print(F("5-CH5 13-CH13\n"));
217 Serial.print(F("6-CH6 14-CH14\n"));
218 Serial.print(F("7-CH7 15-CH15\n"));
219 Serial.print(F("16-ALL\n"));
220 Serial.print(F("m-Main Menu\n"));
221 Serial.print(F("\nEnter a Command: "));
222 user_command = read_int(); // Read the single command
223 if (user_command == 'm')
224 return(0);
225 else
226 Serial.println(user_command);
227 Serial.println();
228
229 if (user_command == 16)
230 {
231 Serial.print(F("ALL\n"));
232 adc_command = BUILD_COMMAND_SINGLE_ENDED[0]; // Build ADC command for channel 0
233
234 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
235 return(1);
236 LTC2418_read(LTC2418_CS, adc_command, &adc_code); // Throws out last reading
237
238 for (int8_t x = 0; x < 15; x++)
239 {
240 adc_command = BUILD_COMMAND_SINGLE_ENDED[(x + 1) % 16]; // Read all channels in single-ended mode
241 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
242 return(1);
243 LTC2418_read(LTC2418_CS, adc_command, &adc_code);
244 adc_voltage = LTC2418_code_to_voltage(adc_code, LTC2418_lsb , LTC2418_offset_code);
245 Serial.print(F(" ****"));
246 Serial.print(F("CH"));
247 Serial.print(x);
248 Serial.print(F(": "));
249 Serial.print(adc_voltage, 4);
250 Serial.print(F("V\n"));
251 }
252 }
253 else if (user_command != 'm') // Read selected channel
254 {
255 adc_command = BUILD_COMMAND_SINGLE_ENDED[user_command];
256 Serial.print(F("\nADC Command: B"));
257 Serial.println(adc_command, BIN);
258 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
259 return(1);
260 LTC2418_read(LTC2418_CS, adc_command, &adc_code); // Throws out last reading
261 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
262 return(1);
263 LTC2418_read(LTC2418_CS, adc_command, &adc_code);
264 Serial.print(F("Received Code: 0x"));
265 Serial.println(adc_code, HEX);
266 adc_voltage = LTC2418_code_to_voltage(adc_code, LTC2418_lsb , LTC2418_offset_code);
267 Serial.print(F(" ****"));
268 Serial.print(F("CH"));
269 Serial.print(user_command);
270 Serial.print(F(": "));
271 Serial.print(adc_voltage, 4);
272 Serial.print(F("V\n"));
273 }
274 }
275 }
276
277 //! Read channels in differential mode
278 //! @return 0 when m is entered into menu, 1 if timeout for EOC
279 int8_t menu_2_read_differential()
280 {
281 int8_t y; // Offset into differential channel array to select polarity
282 uint8_t adc_command; // The LTC2418 command byte
283 int16_t user_command; // The user input command
284 uint32_t adc_code; // The LTC2418 code
285 float adc_voltage; // The LTC2418 voltage
286
287 while (1)
288 {
289 // Display differential menu
290 Serial.print(F("\n*************************\n\n"));
291 Serial.print(F("0-0P-1N 8-1P-0N\n"));
292 Serial.print(F("1-2P-3N 9-3P-2N\n"));
293 Serial.print(F("2-4P-5N 10-5P-4N\n"));
294 Serial.print(F("3-6P-7N 11-7P-6N\n"));
295 Serial.print(F("4-8P-9N 12-9P-8N\n"));
296 Serial.print(F("5-10P-11N 13-11P-10N\n"));
297 Serial.print(F("6-12P_13N 14-13P-12N\n"));
298 Serial.print(F("7-14P-15N 15-15P-14N\n"));
299 Serial.print(F("16-ALL Even_P-Odd_N\n"));
300 Serial.print(F("17-ALL Odd_P-Even_N\n"));
301 Serial.print(F("m-Main Menu\n"));
302 Serial.print(F("\nEnter a Command: "));
303 user_command = read_int();
304 if (user_command == 'm')
305 return(0);
306 Serial.println(user_command);
307 Serial.println();
308
309 if ((user_command == 16) || (user_command == 17))
310 {
311 if (user_command == 16)
312 {
313 Serial.print(F("ALL Even_P-Odd_N\n")); // Cycles through options 0-7
314 y = 0;
315 }
316 if (user_command == 17)
317 {
318 Serial.print(F("ALL Odd_P-Even_N\n")); // Cycles through options 8-15
319 y = 8;
320 }
321 adc_command = BUILD_COMMAND_DIFF[y]; // Set up first channel
322 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // check for EOC
323 return(1);
324 LTC2418_read(LTC2418_CS, adc_command, &adc_code); // Throws out last reading
325 for (int8_t x = 0; x <= 7; x++) // Read all channels. All even channels are positive and odd channels are negative
326 {
327 adc_command = BUILD_COMMAND_DIFF[((x+1) % 8) + y];
328 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
329 return(1);
330 LTC2418_read(LTC2418_CS, adc_command, &adc_code);
331 adc_voltage = LTC2418_code_to_voltage(adc_code, LTC2418_lsb , LTC2418_offset_code);
332 Serial.println();
333 Serial.print(F(" ****"));
334 print_user_command(x + y);
335 Serial.print(F(": "));
336 Serial.print(adc_voltage, 4);
337 Serial.print(F("V\n"));
338 }
339 }
340 else // Read selected channels
341 {
342 // Reads and displays a selected channel
343 adc_command = BUILD_COMMAND_DIFF[user_command];
344 Serial.print(F("ADC Command: B"));
345 Serial.println(adc_command, BIN);
346 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
347 return(1);
348 LTC2418_read(LTC2418_CS, adc_command, &adc_code); // Throws out last reading
349 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
350 return(1);
351 LTC2418_read(LTC2418_CS, adc_command, &adc_code);
352 Serial.print(F("Received Code: 0x"));
353 Serial.println(adc_code, HEX);
354 adc_voltage = LTC2418_code_to_voltage(adc_code, LTC2418_lsb , LTC2418_offset_code);
355 Serial.println();
356 Serial.print(F(" ****"));
357 Serial.print(F("CH"));
358 Serial.print(user_command);
359 Serial.print(F(": "));
360 Serial.print(adc_voltage, 4);
361 Serial.print(F("V"));
362 Serial.println();
363 }
364 }
365 }
366
367 //! Calibrate ADC given two known inputs
368 //! @return 0 if successful, 1 if timeout for EOC
369 int8_t menu_3_calibrate()
370 {
371 // Calibration
372 float fs_voltage; // Measured full-scale voltage
373 float zero_voltage; // Measured zero voltage
374 uint32_t zero_code; // Cal zero code
375 uint32_t fs_code; // Cal full scale code
376 uint8_t adc_command; // The LTC2418 command byte
377 uint32_t adc_code; // The LTC2418 code
378
379 Serial.println("Apply 100mV to CH0 with respect to COM");
380 Serial.println("or apply a voltage greater than GND for the");
381 Serial.println("lower point in two point calibration");
382 Serial.print("Enter the measured input voltage:");
383 zero_voltage = read_float();
384 Serial.println(zero_voltage,4);
385 adc_command = BUILD_COMMAND_SINGLE_ENDED[0]; // Build ADC command byte for voltage input
386 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
387 return(1);
388 LTC2418_read(LTC2418_CS, adc_command, &adc_code); // Throw away previous reading
389 delay(100);
390 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
391 return(1);
392 LTC2418_read(LTC2418_CS, adc_command, &zero_code); // Measure zero
393
394 Serial.println("Apply ~2.40V input voltage to CH0");
395 Serial.println("or apply a voltage greater that first");
396 Serial.println("voltage and less than 2.40V.");
397 Serial.print("Enter the measured input voltage: ");
398
399 fs_voltage = read_float();
400 Serial.println(fs_voltage, 4);
401 adc_command = BUILD_COMMAND_SINGLE_ENDED[0]; // Build ADC command byte for voltage input
402 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
403 return(1);
404 LTC2418_read(LTC2418_CS, adc_command, &adc_code); // Throw away previous reading
405 delay(100);
406 if (LTC2418_EOC_timeout(LTC2418_CS, MISO_TIMEOUT)) // Check for EOC
407 return(1);
408 LTC2418_read(LTC2418_CS, adc_command, &fs_code); // Measure full scale
409 LTC2418_cal_voltage(zero_code, fs_code, zero_voltage, fs_voltage, &LTC2418_lsb , &LTC2418_offset_code);
410
411 Serial.print("ADC offset : ");
412 Serial.println(LTC2418_offset_code);
413 Serial.print("ADC lsb : ");
414 Serial.print(LTC2418_lsb*1.0e9, 4);
415 Serial.println("nV (32-bits)");
416 store_calibration();
417 return(0);
418 }
419
420 //! Prints the title block when program first starts.
421 void print_title()
422 {
423 Serial.print(F("\n*****************************************************************\n"));
424 Serial.print(F("* DC571A Demonstration Program *\n"));
425 Serial.print(F("* *\n"));
426 Serial.print(F("* This program demonstrates how to send data and receive data *\n"));
427 Serial.print(F("* from the 24-bit ADC. *\n"));
428 Serial.print(F("* *\n"));
429 Serial.print(F("* Set the baud rate to 115200 and select the newline terminator.*\n"));
430 Serial.print(F("* *\n"));
431 Serial.print(F("*****************************************************************\n"));
432 }
433
434 //! Prints main menu.
435 void print_prompt()
436 {
437 Serial.print(F("\n1-Read Single-Ended\n"));
438 Serial.print(F("2-Read Differential\n"));
439 Serial.print(F("3-Calibration\n"));
440 Serial.println();
441 Serial.print(F("Enter a command:"));
442 }
443
444
445 //! Display selected differential channels. Displaying Single-Ended channels is
446 //! straightforward; not so with differential because the inputs can take either polarity.
447 void print_user_command(uint8_t menu)
448 {
449 switch (menu)
450 {
451 case 0:
452 Serial.print("0P-1N");
453 break;
454 case 1:
455 Serial.print("2P-3N");
456 break;
457 case 2:
458 Serial.print("4P-5N");
459 break;
460 case 3:
461 Serial.print("6P-7N");
462 break;
463 case 4:
464 Serial.print("8P-9N");
465 break;
466 case 5:
467 Serial.print("10P-11N");
468 break;
469 case 6:
470 Serial.print("12P-13N");
471 break;
472 case 7:
473 Serial.print("14P-15N");
474 break;
475 case 8:
476 Serial.print("1P-0N");
477 break;
478 case 9:
479 Serial.print("3P-2N");
480 break;
481 case 10:
482 Serial.print("5P-4N");
483 break;
484 case 11:
485 Serial.print("7P-6N");
486 break;
487 case 12:
488 Serial.print("9P-8N");
489 break;
490 case 13:
491 Serial.print("11P-10N");
492 break;
493 case 14:
494 Serial.print("13P-12N");
495 break;
496 case 15:
497 Serial.print("15P-14N");
498 break;
499 }
500 Serial.print(": ");
501 }
502
503 //! Store measured calibration parameters to nonvolatile EEPROM on demo board
504 void store_calibration()
505 // store the ADC calibration to the EEPROM
506 {
507 eeprom_write_int16(EEPROM_I2C_ADDRESS, EEPROM_CAL_KEY, EEPROM_CAL_STATUS_ADDRESS); // Cal key
508 eeprom_write_int32(EEPROM_I2C_ADDRESS, LTC2418_offset_code, EEPROM_CAL_STATUS_ADDRESS+2); // Offset
509 eeprom_write_float(EEPROM_I2C_ADDRESS, LTC2418_lsb, EEPROM_CAL_STATUS_ADDRESS+6); // LSB
510 Serial.println("Calibration Stored to EEPROM");
511 }
512
513 //! Read stored calibration parameters from nonvolatile EEPROM on demo board
514 //! @return return 1 if successful, 0 if not
515 int8_t restore_calibration()
516 {
517 int16_t cal_key;
518 // read the cal key from the EEPROM
519 eeprom_read_int16(EEPROM_I2C_ADDRESS, &cal_key, EEPROM_CAL_STATUS_ADDRESS);
520 if (cal_key == EEPROM_CAL_KEY)
521 {
522 // calibration has been stored, read offset and lsb
523 eeprom_read_int32(EEPROM_I2C_ADDRESS, &LTC2418_offset_code, EEPROM_CAL_STATUS_ADDRESS+2); // Offset
524 eeprom_read_float(EEPROM_I2C_ADDRESS, &LTC2418_lsb, EEPROM_CAL_STATUS_ADDRESS+6); // LSB
525 Serial.println("Calibration Restored");
526 return(1);
527 }
528 else
529 {
530 Serial.println("Calibration not found");
531 return(0);
532 }
533 }
LTC2418_CH3
#define LTC2418_CH3
Definition: LTC2418.h:119
LTC2418_CH0
#define LTC2418_CH0
Definition: LTC2418.h:116
LTC2418_CH5
#define LTC2418_CH5
Definition: LTC2418.h:121
eeprom_read_int16
uint8_t eeprom_read_int16(uint8_t i2c_address, int16_t *read_data, uint16_t address)
Read the two byte integer data from the EEPROM starting at address.
Definition: QuikEval_EEPROM.cpp:395
LTC2418_CH7
#define LTC2418_CH7
Definition: LTC2418.h:123
user_command
unsigned char user_command
Definition: Serial_EEPROM_Test.ino:75
adc_command
static uint8_t adc_command
Definition: DC2071AA.ino:111
EEPROM_I2C_ADDRESS
#define EEPROM_I2C_ADDRESS
Definition: QuikEval_EEPROM.h:60
setup
static void setup()
Initialize Linduino.
Definition: DC571A.ino:135
LTC2418_P15_N14
#define LTC2418_P15_N14
Definition: LTC2418.h:159
LTC2418_offset_code
static int32_t LTC2418_offset_code
Ideal offset for a perfect part.
Definition: DC571A.ino:114
LTC2418_cal_voltage
void LTC2418_cal_voltage(int32_t zero_code, int32_t fs_code, float zero_voltage, float fs_voltage, float *LTC2418_lsb, int32_t *LTC2418_offset_code)
Calibrate the lsb.
Definition: LTC2418.cpp:117
Linduino.h
Header File for Linduino Libraries and Demo Code.
LTC2418_CS
#define LTC2418_CS
Define the SPI CS pin.
Definition: LTC2418.h:110
eeprom_read_float
uint8_t eeprom_read_float(uint8_t i2c_address, float *read_data, uint16_t address)
Read the four byte float data from the EEPROM starting at address.
Definition: QuikEval_EEPROM.cpp:435
LTC2418_CH11
#define LTC2418_CH11
Definition: LTC2418.h:127
eeprom_write_int32
uint8_t eeprom_write_int32(uint8_t i2c_address, int32_t write_data, uint16_t address)
Write the 4 byte long data to the EEPROM starting at address.
Definition: QuikEval_EEPROM.cpp:455
LTC2418_P14_N15
#define LTC2418_P14_N15
Definition: LTC2418.h:158
LTC2418_P2_N3
#define LTC2418_P2_N3
Definition: LTC2418.h:140
LTC2418_P12_N13
#define LTC2418_P12_N13
Definition: LTC2418.h:155
BUILD_COMMAND_SINGLE_ENDED
const uint8_t BUILD_COMMAND_SINGLE_ENDED[16]
Lookup table to build the command for single-ended mode channels.
Definition: DC571A.ino:119
adc_voltage
static float adc_voltage
Definition: DC2071AA.ino:115
menu_2_read_differential
static int8_t menu_2_read_differential()
Read channels in differential mode.
Definition: DC571A.ino:279
LTC2418_P7_N6
#define LTC2418_P7_N6
Definition: LTC2418.h:147
LTC2418_P13_N12
#define LTC2418_P13_N12
Definition: LTC2418.h:156
LTC2418_P6_N7
#define LTC2418_P6_N7
Definition: LTC2418.h:146
eeprom_write_float
uint8_t eeprom_write_float(uint8_t i2c_address, float write_data, uint16_t address)
Write the 4 byte float data to the EEPROM starting at address.
Definition: QuikEval_EEPROM.cpp:412
LTC2418_lsb
static float LTC2418_lsb
Ideal LSB voltage for a perfect part.
Definition: DC571A.ino:113
eeprom_write_int16
uint8_t eeprom_write_int16(uint8_t i2c_address, int16_t write_data, uint16_t address)
Write the 2 byte integer data to the EEPROM starting at address.
Definition: QuikEval_EEPROM.cpp:377
LTC2418_CH13
#define LTC2418_CH13
Definition: LTC2418.h:129
LTC2418_CH10
#define LTC2418_CH10
Definition: LTC2418.h:126
LTC2418.h
LTC2418: 16-Channel 24-Bit No Latency Delta-Sigma ADC.
LTC2418_P1_N0
#define LTC2418_P1_N0
Definition: LTC2418.h:138
QuikEval_EEPROM.h
QuikEval EEPROM Library.
LTC2418_CH2
#define LTC2418_CH2
Definition: LTC2418.h:118
print_title
static void print_title()
Prints the title block when program first starts.
Definition: DC571A.ino:421
LTC2418_P5_N4
#define LTC2418_P5_N4
Definition: LTC2418.h:144
quikeval_SPI_init
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
Definition: LT_SPI.cpp:151
menu_1_read_single_ended
static int8_t menu_1_read_single_ended()
Read channels in single-ended mode.
Definition: DC571A.ino:201
print_prompt
static void print_prompt()
Prints main menu.
Definition: DC571A.ino:435
EEPROM_CAL_STATUS_ADDRESS
#define EEPROM_CAL_STATUS_ADDRESS
Definition: QuikEval_EEPROM.h:58
LTC2418_CH4
#define LTC2418_CH4
Definition: LTC2418.h:120
LTC2418_code_to_voltage
float LTC2418_code_to_voltage(int32_t adc_code, float LTC2418_lsb, int32_t LTC2418_offset_code)
Calculates the LTC2418 input bipolar voltage.
Definition: LTC2418.cpp:107
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
LTC2418_P11_N10
#define LTC2418_P11_N10
Definition: LTC2418.h:153
LTC2418_CH9
#define LTC2418_CH9
Definition: LTC2418.h:125
LT_SPI.h
LT_SPI: Routines to communicate with ATmega328P&#39;s hardware SPI port.
menu_3_calibrate
static int8_t menu_3_calibrate()
Calibrate ADC given two known inputs.
Definition: DC571A.ino:369
demo_board_connected
static uint8_t demo_board_connected
Set to 1 if the board is connected.
Definition: DC571A.ino:112
restore_calibration
static int8_t restore_calibration()
Read stored calibration parameters from nonvolatile EEPROM on demo board.
Definition: DC571A.ino:515
LTC2418_EOC_timeout
int8_t LTC2418_EOC_timeout(uint8_t cs, uint16_t miso_timeout)
Checks for EOC with a specified timeout.
Definition: LTC2418.cpp:73
LT_I2C.h
LT_I2C: Routines to communicate with ATmega328P&#39;s hardware I2C port.
loop
static void loop()
Repeats Linduino loop.
Definition: DC571A.ino:163
LTC2418_P8_N9
#define LTC2418_P8_N9
Definition: LTC2418.h:149
LTC2418_CH8
#define LTC2418_CH8
Definition: LTC2418.h:124
LTC2418_CH12
#define LTC2418_CH12
Definition: LTC2418.h:128
demo_name
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
Definition: DC1880A.ino:97
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
eeprom_read_int32
uint8_t eeprom_read_int32(uint8_t i2c_address, int32_t *read_data, uint16_t address)
Read the four byte long data from the EEPROM starting at address.
Definition: QuikEval_EEPROM.cpp:478
UserInterface.h
read_int
int32_t read_int()
Definition: UserInterface.cpp:93
print_user_command
static void print_user_command(uint8_t menu)
Display selected differential channels.
Definition: DC571A.ino:447
LTC2418_CH6
#define LTC2418_CH6
Definition: LTC2418.h:122
read_float
float read_float()
Definition: UserInterface.cpp:78
x
int32_t x
Definition: LTC2492_Thermocouple_Meter.ino:119
LTC2418_CH15
#define LTC2418_CH15
Definition: LTC2418.h:131
BUILD_COMMAND_DIFF
const uint8_t BUILD_COMMAND_DIFF[16]
Lookup table to build the command for differential mode channels.
Definition: DC571A.ino:126
quikeval_I2C_init
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
Definition: LT_I2C.cpp:394
LTC2418_P4_N5
#define LTC2418_P4_N5
Definition: LTC2418.h:143
LTC2418_CH1
#define LTC2418_CH1
Definition: LTC2418.h:117
LTC2418_P10_N11
#define LTC2418_P10_N11
Definition: LTC2418.h:152
MISO_TIMEOUT
const uint16_t MISO_TIMEOUT
The MISO timeout (ms)
Definition: DC571A.ino:132
store_calibration
static void store_calibration()
Store measured calibration parameters to nonvolatile EEPROM on demo board.
Definition: DC571A.ino:504
LTC2418_P3_N2
#define LTC2418_P3_N2
Definition: LTC2418.h:141
LTC2418_CH14
#define LTC2418_CH14
Definition: LTC2418.h:130
EEPROM_CAL_KEY
#define EEPROM_CAL_KEY
Definition: QuikEval_EEPROM.h:59
adc_code
static uint32_t adc_code
Definition: DC2071AA.ino:113
LTC2418_P9_N8
#define LTC2418_P9_N8
Definition: LTC2418.h:150
LTC2418_read
void LTC2418_read(uint8_t cs, uint8_t adc_command, uint32_t *adc_code)
Reads the LTC2418 result and programs the configuration for the next conversion.
Definition: LTC2418.cpp:92
LTC2418_P0_N1
#define LTC2418_P0_N1
Definition: LTC2418.h:137