| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

DC682A.ino
Go to the documentation of this file.
1 /*!
2 Linear Technology DC682A Demonstration Board.
3 LTC1859: 16-Bit, 8-Channel 100ksps SAR 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 voltage source (preferably low-noise) and a precision voltmeter. No
11 external power supply is required. Ensure all jumpers on the demo board are
12 installed in their default positions from the factory. Refer to Demo Manual
13 DC682A.
14
15 How to test Single-Ended mode:
16 Bipolar Mode:
17 The voltage source should be connected to one of the inputs CH0,...CH7. Ensure the input is
18 within its specified absolute input voltage range. (It is easiest
19 to tie the voltage source negative terminal to COM.) Ensure the voltage
20 source is set within the range of 0V to +5V for low range, or 0V to 10V for high range.
21 (Swapping input voltages results in a reversed polarity reading.)
22
23 Unipolar Mode:
24 The voltage source should be connected to one of the inputs CH0,...CH7. Ensure the input is
25 within its specified absolute input voltage range. (It is easiest
26 to tie the voltage source negative terminal to COM.) Ensure the voltage
27 source is set within the range of 0V to +5V for low range, or 0V to 10V for high range.
28
29 How to test Differential Mode:
30 Bipolar Mode:
31 The voltage source should be connected between paired channels. Ensure both
32 inputs are within their specified absolute input voltage range. (It is easiest
33 to tie the voltage source negative terminal to COM or GND.) Ensure the voltage
34 source is set within the range of 0V to +5V for low range, or 0V to 10V for high range (differential voltage range).
35 (Swapping input voltages results in a reversed polarity reading.)
36
37 Unipolar Mode:
38 The voltage source should be connected between paired channels. (It is easiest
39 to tie the voltage source negative terminal to COM or GND.) Ensure both inputs
40 are within their specified absolute input voltage range. (It is easiest to tie
41 the voltage source negative terminal to COM or GND.) Ensure the voltage source
42 is set within the range of 0V to +5V for low range, or 0V to 10V for high range (differential voltage range).
43
44 USER INPUT DATA FORMAT:
45 decimal : 1024
46 hex : 0x400
47 octal : 02000 (leading 0 "zero")
48 binary : B10000000000
49 float : 1024.0
50
51 @endverbatim
52
53 http://www.linear.com/product/LTC1859
54
55 http://www.linear.com/product/LTC1859#demoboards
56
57
58 Copyright 2018(c) Analog Devices, Inc.
59
60 All rights reserved.
61
62 Redistribution and use in source and binary forms, with or without
63 modification, are permitted provided that the following conditions are met:
64 - Redistributions of source code must retain the above copyright
65 notice, this list of conditions and the following disclaimer.
66 - Redistributions in binary form must reproduce the above copyright
67 notice, this list of conditions and the following disclaimer in
68 the documentation and/or other materials provided with the
69 distribution.
70 - Neither the name of Analog Devices, Inc. nor the names of its
71 contributors may be used to endorse or promote products derived
72 from this software without specific prior written permission.
73 - The use of this software may or may not infringe the patent rights
74 of one or more patent holders. This license does not release you
75 from the requirement that you obtain separate licenses from these
76 patent holders to use this software.
77 - Use of the software either in source or binary form, must be run
78 on or directly connected to an Analog Devices Inc. component.
79
80 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
81 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
82 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
83 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
84 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
85 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
86 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
87 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
88 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
89 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
90 */
91
92 /*! @file
93 @ingroup LTC1859
94 */
95
96 #include <Arduino.h>
97 #include <stdint.h>
98 #include "Linduino.h"
99 #include "LT_SPI.h"
100 #include "UserInterface.h"
101 #include "LT_I2C.h"
102 #include "QuikEval_EEPROM.h"
103 #include "LTC1859.h"
104 #include <SPI.h>
105 #include <Wire.h>
106
107 // Function Declaration
108 void print_title(); // Print the title block
109 void print_prompt(); // Prompt the user for an input command
110 uint8_t print_user_command_differential(); // Display selected differential channels
111 uint8_t print_user_command_single_ended(); // Display selected single ended channels
112 void print_channel_selection(uint8_t menu);
113
114 void menu_1_read_input(); // Read channels
115 void menu_2_select_single_ended_differential(); // Sets LTC1859 to Single-Ended or Differential
116 void menu_3_select_uni_bipolar(); // Sets LTC1859 to Bipolar or Unipolar
117 void menu_4_select_range(); // Sets LTC1859 to high or low input range
118 void menu_5_sleep();
119
120 // Global variables
121 static uint8_t uni_bipolar = LTC1859_UNIPOLAR_MODE; //!< Default set for unipolar mode
122 static uint8_t single_ended_differential = LTC1859_SINGLE_ENDED_MODE; //!< LTC1859 Unipolar or Bipolar mode selection
123 static uint8_t range_low_high = LTC1859_HIGH_RANGE_MODE; //!< Default set for high range mode
124 static float LTC1859_bits = 16; //!< Resolution (16 bits)
125 static float LTC1859_vref = 10;
126
127 // Constants
128 //! Lookup table to build the command for single-ended mode, input with respect to GND
129 const uint8_t BUILD_COMMAND_SINGLE_ENDED[8] = {LTC1859_CH0, LTC1859_CH1, LTC1859_CH2, LTC1859_CH3,
130 LTC1859_CH4, LTC1859_CH5, LTC1859_CH6, LTC1859_CH7
131 }; //!< Builds the command for single-ended mode, input with respect to GND
132
133 //! Lookup table to build the command for differential mode with the selected uni/bipolar mode
134 const uint8_t BUILD_COMMAND_DIFF[8] = {LTC1859_P0_N1, LTC1859_P2_N3, LTC1859_P4_N5, LTC1859_P6_N7,
135 LTC1859_P1_N0, LTC1859_P3_N2, LTC1859_P5_N4, LTC1859_P7_N6
136 }; //!< Build the command for differential mode
137
138
139 //! Initialize Linduino
140 void setup()
141 {
142 uint16_t adc_code;
143
144 quikeval_SPI_init(); // Configure the spi port for 4MHz SCK
145 quikeval_SPI_connect(); // Connect SPI to main data port
146 Serial.begin(115200); // Initialize the serial port to the PC
147 print_title();
148 print_prompt();
149 }
150
151 //! Repeats Linduino loop
152 void loop()
153 {
154 uint16_t user_command;
155
156 if (Serial.available()) // Check for user input
157 {
158 user_command = read_int(); // Read the user command
159 if (user_command != 'm')
160 Serial.println(user_command); // Prints the user command to com port
161 Serial.flush();
162 switch (user_command)
163 {
164 case 1:
165 menu_1_read_input();
166 break;
167 case 2:
168 menu_2_select_single_ended_differential();
169 break;
170 case 3:
171 menu_3_select_uni_bipolar();
172 break;
173 case 4:
174 menu_4_select_range();
175 break;
176 case 5:
177 menu_5_sleep();
178 break;
179 default:
180 Serial.println(F("Invalid Option"));
181 break;
182 }
183 Serial.println();
184 Serial.println(F("*************************"));
185 print_prompt();
186 }
187 }
188
189
190 // Function Definitions
191 //! Read channels
192 //! @return 1 if successful, 0 if not
193 void menu_1_read_input()
194 {
195 uint8_t user_command;
196 uint16_t adc_command; // The LTC1859 command byte
197 uint16_t adc_code = 0; // The LTC1859 code
198 uint8_t x, y, startcount, endcount;
199 float adc_voltage;
200
201 if (uni_bipolar == LTC1859_UNIPOLAR_MODE)
202 {
203 if (single_ended_differential == LTC1859_SINGLE_ENDED_MODE)
204 {
205 Serial.println(F(" Read Input in Single-Ended, Unipolar mode:"));
206 Serial.println(F(" Note that in Unipolar mode, input voltages less than zero are reported as 0.0V"));
207 user_command = print_user_command_single_ended();
208 }
209 else
210 {
211 Serial.println(F(" Read Input in Differential, Unipolar mode:"));
212 Serial.println(F(" Note that in Unipolar mode, input voltages less than zero are reported as 0.0V"));
213 user_command = print_user_command_differential();
214 }
215 }
216 else
217 {
218 if (single_ended_differential == LTC1859_SINGLE_ENDED_MODE)
219 {
220 Serial.println(F(" Read Input in Single-Ended, Bipolar mode:"));
221 user_command = print_user_command_single_ended();
222 }
223 else
224 {
225 Serial.println(F(" Read Input in Differential, Bipolar mode:"));
226 user_command = print_user_command_differential();
227 }
228 }
229
230 if (user_command == 8) //read all channels
231 {
232 startcount = 0;
233 endcount = 7;
234 }
235 else
236 {
237 startcount = user_command;
238 endcount = user_command;
239 }
240
241 if (single_ended_differential == LTC1859_SINGLE_ENDED_MODE) //read single-ended
242 {
243 adc_command = BUILD_COMMAND_SINGLE_ENDED[0] | uni_bipolar | range_low_high;
244 LTC1859_read(LTC1859_CS, adc_command, &adc_code); // Throws out last reading and starts CH0 conversion
245 for (x = startcount; x <= endcount; x++)
246 {
247 adc_command = BUILD_COMMAND_SINGLE_ENDED[x % 8] | uni_bipolar | range_low_high; // Send channel config for the NEXT conversion to take place
248 LTC1859_read(LTC1859_CS, adc_command, &adc_code); // Read previous channel conversion (x-1) and start next one (x)
249 LTC1859_read(LTC1859_CS, adc_command, &adc_code); // Read previous channel conversion (x-1) and start next one (x)
250 Serial.print(F(" Received Code: b"));
251 Serial.println(adc_code, BIN);
252
253 adc_voltage = LTC1859_code_to_voltage(adc_code, LTC1859_vref, range_low_high, uni_bipolar);
254 Serial.print(F(" Voltage read on "));
255 Serial.print(F("Ch"));
256 Serial.print(x);
257 Serial.print(F(": "));
258 Serial.print(adc_voltage, 4);
259 Serial.println(F("V"));
260 Serial.println();
261 }
262 }
263
264 else //read differential
265 {
266 adc_command = BUILD_COMMAND_DIFF[0] | uni_bipolar | range_low_high;
267 LTC1859_read(LTC1859_CS, adc_command, &adc_code); // Throws out last reading and starts CH0 conversion
268 for (x = startcount; x <= endcount; x++)
269 {
270 adc_command = BUILD_COMMAND_DIFF[x % 8] | uni_bipolar | range_low_high; // Send channel config for the NEXT conversion to take place
271 LTC1859_read(LTC1859_CS, adc_command, &adc_code); // Read previous channel conversion (x-1) and start next one (x)
272 LTC1859_read(LTC1859_CS, adc_command, &adc_code); // Read previous channel conversion (x-1) and start next one (x)
273 Serial.print(F(" Received Code: b"));
274 Serial.println(adc_code,BIN);
275
276 adc_voltage = LTC1859_code_to_voltage(adc_code, LTC1859_vref, range_low_high, uni_bipolar);
277 Serial.print(F(" Voltage read between Chs "));
278 print_channel_selection(x + y);
279 Serial.print(adc_voltage, 4);
280 Serial.println(F("V"));
281 Serial.println();
282 }
283 }
284 }
285
286
287 //! Sets LTC1859 to Single-Ended or Differential
288 void menu_2_select_single_ended_differential()
289 {
290 uint8_t user_command;
291
292 Serial.println(F("\n 0 = Single-Ended"));
293 Serial.println(F(" 1 = Differential"));
294 Serial.print(F(" Enter a Command: "));
295
296 user_command = read_int(); // Read user input for uni_bipolar
297 Serial.println(user_command);
298 switch (user_command)
299 {
300 case 0:
301 Serial.println(F(" Single-Ended mode selected"));
302 single_ended_differential = LTC1859_SINGLE_ENDED_MODE;
303 break;
304 case 1:
305 Serial.println(F(" Differential mode selected"));
306 single_ended_differential = LTC1859_DIFFERENTIAL_MODE;
307 break;
308 default:
309 {
310 Serial.println(" Invalid Option");
311 return;
312 }
313 break;
314 }
315 }
316
317
318 //! Select unipolar (0-REFCOMP) or bipolar (+/- 0.5 x REFCOMP) mode
319 //! @return void
320 void menu_3_select_uni_bipolar()
321 {
322 uint8_t user_command;
323
324 Serial.println(F("\n 0 = Unipolar"));
325 Serial.println(F(" 1 = Bipolar"));
326 Serial.print(F(" Enter a Command: "));
327
328 user_command = read_int(); // Read user input for uni_bipolar
329 Serial.println(user_command);
330 switch (user_command)
331 {
332 case 0:
333 Serial.println(F(" Unipolar mode selected"));
334 uni_bipolar = LTC1859_UNIPOLAR_MODE;
335 break;
336 case 1:
337 Serial.println(F(" Bipolar mode selected"));
338 uni_bipolar = LTC1859_BIPOLAR_MODE;
339 break;
340 default:
341 Serial.println(" Invalid Option");
342 return;
343 break;
344 }
345 }
346
347
348 //! Select low range or high range mode
349 //! @return void
350 void menu_4_select_range()
351 {
352 uint8_t user_command;
353
354 Serial.println(F("\n 0 = High Range"));
355 Serial.println(F(" 1 = Low Range"));
356 Serial.print(F(" Enter a Command: "));
357 user_command = read_int(); // Read user input for range select
358 Serial.println(user_command);
359
360 switch (user_command)
361 {
362 case 0:
363 Serial.println(F(" High Range selected"));
364 range_low_high = LTC1859_HIGH_RANGE_MODE;
365 break;
366 case 1:
367 Serial.println(F(" Low Range selected"));
368 range_low_high = LTC1859_LOW_RANGE_MODE;
369 break;
370 default:
371 {
372 Serial.println(" Invalid Option");
373 return;
374 }
375 break;
376 }
377 }
378
379
380 //! Put LTC1859 to sleep (low power)
381 //! @return void
382 void menu_5_sleep()
383 {
384 // Sleep Mode
385 uint16_t user_command;
386 uint16_t adc_code = 0; // The LTC1859 code
387 LTC1859_read(LTC1859_CS, LTC1859_SLEEP_MODE, &adc_code); // Build ADC command for sleep mode
388 Serial.println();
389 Serial.print(F(" ADC Command: B"));
390 Serial.println(LTC1859_SLEEP_MODE, BIN);
391 Serial.println(F(" LTC1859 Is Now In Sleep Mode"));
392 Serial.println(F(" Enter RETURN to exit Sleep Mode"));
393 user_command = read_int();
394 LTC1859_read(LTC1859_CS, LTC1859_NORMAL_MODE, &adc_code); // Exit Sleep Mode
395 }
396
397
398 //! Prints the title block when program first starts.
399 void print_title()
400 {
401 Serial.println();
402 Serial.println(F("*****************************************************************"));
403 Serial.println(F("* DC682A Demonstration Program *"));
404 Serial.println(F("* *"));
405 Serial.println(F("* This program demonstrates how to send data and receive data *"));
406 Serial.println(F("* from the LTC1859 16-bit ADC. *"));
407 Serial.println(F("* *"));
408 Serial.println(F("* Set the baud rate to 115200 and select the newline terminator.*"));
409 Serial.println(F("* *"));
410 Serial.println(F("*****************************************************************"));
411 }
412
413
414 //! Prints main menu.
415 void print_prompt()
416 {
417 Serial.println(F("1-Read ADC Input "));
418 Serial.println(F("2-Select Single-Ended / Differential measurement (default is Single_Ended)"));
419 Serial.println(F("3-Select Unipolar / Bipolar measurement (default is Unipolar)"));
420 Serial.println(F("4-Set Input Range (default is High Range)"));
421 Serial.println(F("5-Select Sleep Mode"));
422 Serial.println();
423 Serial.print(F("Enter a command: "));
424 }
425
426
427 //! Display selected differential channels. Displaying single-ended channels is
428 //! straightforward; not so with differential because the inputs can take either polarity.
429 uint8_t print_user_command_differential()
430 {
431 uint8_t user_command;
432
433 Serial.println(F("*************************"));
434 Serial.println(F(" 0 = 0P-1N"));
435 Serial.println(F(" 1 = 2P-3N"));
436 Serial.println(F(" 2 = 4P-5N"));
437 Serial.println(F(" 3 = 6P-7N"));
438 Serial.println(F(" 4 = 1P-0N"));
439 Serial.println(F(" 5 = 3P-2N"));
440 Serial.println(F(" 6 = 5P_4N"));
441 Serial.println(F(" 7 = 7P = 6N"));
442 Serial.println(F(" 8 = ALL Even_P-Odd_N"));
443 Serial.println(F(" m = Main Menu"));
444 Serial.println();
445 Serial.print(F(" Enter a Command: "));
446
447 user_command = read_int(); // Read the menu command
448 Serial.println(user_command);
449 if (user_command == 'm')
450 return(0);
451
452 switch (user_command) //check for invalid selection
453 {
454 case 0:
455 Serial.println(F(" 0P-1N selected"));
456 break;
457 case 1:
458 Serial.println(F(" 2P-3N selected"));
459 break;
460 case 2:
461 Serial.println(F(" 4P-5N selected"));
462 break;
463 case 3:
464 Serial.println(F(" 6P-7N selected"));
465 break;
466 case 4:
467 Serial.println(F(" 1P-0N selected"));
468 break;
469 case 5:
470 Serial.println(F(" 3P-2N selected"));
471 break;
472 case 6:
473 Serial.println(F(" 5P-4N selected"));
474 break;
475 case 7:
476 Serial.println(F(" 7P-6N selected"));
477 break;
478 case 8:
479 Serial.println(F(" ALL Even_P-Odd_N selected"));
480 break;
481 default:
482 Serial.println(F(" Invalid Option"));
483 break;
484 }
485 return(user_command);
486 }
487
488
489 //! Display selected differential channels. Displaying single-ended channels is
490 //! straightforward; not so with differential because the inputs can take either polarity.
491 void print_channel_selection(uint8_t menu)
492 {
493 switch (menu)
494 {
495 case 0:
496 Serial.print(F(" 0P-1N:"));
497 break;
498 case 1:
499 Serial.print(F(" 2P-3N:"));
500 break;
501 case 2:
502 Serial.print(F(" 4P-5N:"));
503 break;
504 case 3:
505 Serial.print(F(" 6P-7N:"));
506 break;
507 case 4:
508 Serial.print(F(" 1P-0N:"));
509 break;
510 case 5:
511 Serial.print(F(" 3P-2N:"));
512 break;
513 case 6:
514 Serial.print(F(" 5P-4N:"));
515 break;
516 case 7:
517 Serial.print(F(" 7P-6N:"));
518 break;
519 }
520 }
521
522
523 //! Display selected single-ended channel.
524 uint8_t print_user_command_single_ended()
525 {
526 uint8_t user_command;
527
528 Serial.println(F("*************************"));
529 Serial.println(F(" 0 = CH0"));
530 Serial.println(F(" 1 = CH1"));
531 Serial.println(F(" 2 = CH2"));
532 Serial.println(F(" 3 = CH3"));
533 Serial.println(F(" 4 = CH4"));
534 Serial.println(F(" 5 = CH5"));
535 Serial.println(F(" 6 = CH6"));
536 Serial.println(F(" 7 = CH7"));
537 Serial.println(F(" 8 = ALL"));
538 Serial.println(F(" m = Main Menu"));
539 Serial.println();
540 Serial.print(F(" Enter a Command: "));
541
542 user_command = read_int(); // Read the single-ended menu command
543 Serial.println(user_command);
544 if (user_command == 'm')
545 return(0);
546
547 switch (user_command) //check for invalid selection
548 {
549 case 0:
550 Serial.println(F(" CH0 selected"));
551 break;
552 case 1:
553 Serial.println(F(" CH1 selected"));
554 break;
555 case 2:
556 Serial.println(F(" CH2 selected"));
557 break;
558 case 3:
559 Serial.println(F(" CH3 selected"));
560 break;
561 case 4:
562 Serial.println(F(" CH4 selected"));
563 break;
564 case 5:
565 Serial.println(F(" CH5 selected"));
566 break;
567 case 6:
568 Serial.println(F(" CH6 selected"));
569 break;
570 case 7:
571 Serial.println(F(" CH7 selected"));
572 break;
573 case 8:
574 Serial.println(F(" All selected"));
575 break;
576 default:
577 Serial.println(F(" Invalid Option"));
578 break;
579 }
580
581 return(user_command);
582 }
583
loop
static void loop()
Repeats Linduino loop.
Definition: DC682A.ino:152
user_command
unsigned char user_command
Definition: Serial_EEPROM_Test.ino:75
adc_command
static uint8_t adc_command
Definition: DC2071AA.ino:111
single_ended_differential
static uint8_t single_ended_differential
LTC1859 Unipolar or Bipolar mode selection.
Definition: DC682A.ino:122
uni_bipolar
static uint8_t uni_bipolar
Default set for unipolar mode.
Definition: DC682A.ino:121
LTC1859_SINGLE_ENDED_MODE
#define LTC1859_SINGLE_ENDED_MODE
Definition: LTC1859.h:136
print_user_command_differential
static uint8_t print_user_command_differential()
Display selected differential channels.
Definition: DC682A.ino:429
LTC1859_CH6
#define LTC1859_CH6
Definition: LTC1859.h:110
Linduino.h
Header File for Linduino Libraries and Demo Code.
LTC1859_P3_N2
#define LTC1859_P3_N2
Definition: LTC1859.h:121
LTC1859_P1_N0
#define LTC1859_P1_N0
Definition: LTC1859.h:118
LTC1859_HIGH_RANGE_MODE
#define LTC1859_HIGH_RANGE_MODE
Definition: LTC1859.h:140
LTC1859_P0_N1
#define LTC1859_P0_N1
Definition: LTC1859.h:117
LTC1859_DIFFERENTIAL_MODE
#define LTC1859_DIFFERENTIAL_MODE
Definition: LTC1859.h:137
menu_2_select_single_ended_differential
static void menu_2_select_single_ended_differential()
Sets LTC1859 to Single-Ended or Differential.
Definition: DC682A.ino:288
BUILD_COMMAND_DIFF
const uint8_t BUILD_COMMAND_DIFF[8]
Lookup table to build the command for differential mode with the selected uni/bipolar mode...
Definition: DC682A.ino:134
BUILD_COMMAND_SINGLE_ENDED
const uint8_t BUILD_COMMAND_SINGLE_ENDED[8]
Lookup table to build the command for single-ended mode, input with respect to GND.
Definition: DC682A.ino:129
menu_1_read_input
static void menu_1_read_input()
Read channels.
Definition: DC682A.ino:193
print_prompt
static void print_prompt()
Prints main menu.
Definition: DC682A.ino:415
adc_voltage
static float adc_voltage
Definition: DC2071AA.ino:115
range_low_high
static uint8_t range_low_high
Default set for high range mode.
Definition: DC682A.ino:123
LTC1859_CH3
#define LTC1859_CH3
Definition: LTC1859.h:107
LTC1859_P7_N6
#define LTC1859_P7_N6
Definition: LTC1859.h:127
LTC1859_bits
static float LTC1859_bits
Resolution (16 bits)
Definition: DC682A.ino:124
LTC1859_P2_N3
#define LTC1859_P2_N3
Definition: LTC1859.h:120
QuikEval_EEPROM.h
QuikEval EEPROM Library.
LTC1859_P4_N5
#define LTC1859_P4_N5
Definition: LTC1859.h:123
LTC1859_CH0
#define LTC1859_CH0
Definition: LTC1859.h:104
LTC1859_read
void LTC1859_read(uint8_t cs, uint8_t adc_command, uint16_t *adc_code)
Reads the ADC and returns 16-bit data.
Definition: LTC1859.cpp:86
quikeval_SPI_init
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
Definition: LT_SPI.cpp:151
LTC1859_CH1
#define LTC1859_CH1
Definition: LTC1859.h:105
LTC1859_CH7
#define LTC1859_CH7
Definition: LTC1859.h:111
LTC1859.h
LTC1859: 16-bit 8-channel 100ksps ADC.
LT_SPI.h
LT_SPI: Routines to communicate with ATmega328P&#39;s hardware SPI port.
menu_5_sleep
static void menu_5_sleep()
Put LTC1859 to sleep (low power)
Definition: DC682A.ino:382
LTC1859_CH4
#define LTC1859_CH4
Definition: LTC1859.h:108
LTC1859_UNIPOLAR_MODE
#define LTC1859_UNIPOLAR_MODE
Definition: LTC1859.h:133
LTC1859_P6_N7
#define LTC1859_P6_N7
Definition: LTC1859.h:126
LT_I2C.h
LT_I2C: Routines to communicate with ATmega328P&#39;s hardware I2C port.
LTC1859_CS
#define LTC1859_CS
Define the SPI CS pin.
Definition: LTC1859.h:98
menu_3_select_uni_bipolar
static void menu_3_select_uni_bipolar()
Select unipolar (0-REFCOMP) or bipolar (+/- 0.5 x REFCOMP) mode.
Definition: DC682A.ino:320
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
read_int
int32_t read_int()
Definition: UserInterface.cpp:93
LTC1859_NORMAL_MODE
#define LTC1859_NORMAL_MODE
Definition: LTC1859.h:147
LTC1859_BIPOLAR_MODE
#define LTC1859_BIPOLAR_MODE
Definition: LTC1859.h:134
x
int32_t x
Definition: LTC2492_Thermocouple_Meter.ino:119
LTC1859_vref
static float LTC1859_vref
Definition: DC682A.ino:125
menu_4_select_range
static void menu_4_select_range()
Select low range or high range mode.
Definition: DC682A.ino:350
LTC1859_code_to_voltage
float LTC1859_code_to_voltage(uint16_t adc_code, float vref, uint8_t range_low_high, uint8_t uni_bipolar)
Calculates the LTC1859 input&#39;s unipolar voltage given the binary data and lsb weight.
Definition: LTC1859.cpp:93
print_channel_selection
static void print_channel_selection(uint8_t menu)
Display selected differential channels.
Definition: DC682A.ino:491
LTC1859_CH5
#define LTC1859_CH5
Definition: LTC1859.h:109
LTC1859_P5_N4
#define LTC1859_P5_N4
Definition: LTC1859.h:124
print_title
static void print_title()
Prints the title block when program first starts.
Definition: DC682A.ino:399
LTC1859_SLEEP_MODE
#define LTC1859_SLEEP_MODE
Definition: LTC1859.h:146
LTC1859_LOW_RANGE_MODE
#define LTC1859_LOW_RANGE_MODE
Definition: LTC1859.h:139
print_user_command_single_ended
static uint8_t print_user_command_single_ended()
Display selected single-ended channel.
Definition: DC682A.ino:524
setup
static void setup()
Initialize Linduino.
Definition: DC682A.ino:140
adc_code
static uint32_t adc_code
Definition: DC2071AA.ino:113
LTC1859_CH2
#define LTC1859_CH2
Definition: LTC1859.h:106