| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

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