| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

DC1466.ino
Go to the documentation of this file.
1 /*!
2 Linear Technology DC1466 Demonstration Board.
3 LTC2636: Octal 12-/10-/8-Bit SPI VOUT DACs with 10ppm/°C Reference.
4
5 Linear Technology DC1488 Demonstration Board.
6 LTC2634: Quad 12-/10-/8-Bit SPI VOUT DACs with 10ppm/°C Reference.
7
8 @verbatim
9 NOTES
10 Setup:
11 Set the terminal baud rate to 115200 and select the newline terminator.
12 The program displays calculated voltages which are based on the voltage
13 of the reference used, be it internal or external. A precision voltmeter
14 is needed to verify the actual measured voltages against the calculated
15 voltage displayed. If an external reference is used, a precision voltage
16 source is required to apply the external reference voltage. A
17 precision voltmeter is also required to measure the external reference
18 voltage. No external power supply is required. Any assembly option
19 may be used: DC1466A-A, DC1466A-B, DC1466A-C, DC1466A-D.
20
21
22 Explanation of Commands:
23 1- Select DAC: Select one of four DACs to test : A, B, C, D.
24
25 2- Write to DAC input register: Value is stored in the DAC for updating
26 later, allowing multiple channels to be updated at once, either
27 through a software "Update All" command or by asserting the LDAC# pin.
28 User will be prompted to enter either a code in hex or decimal, or a
29 voltage. If a voltage is entered, a code will be calculated based on
30 the active scaling and reference parameters - ideal values if no
31 calibration was ever stored.
32
33 3- Write and Update: Similar to item 1, but DAC is updated immediately.
34
35 4- Update DAC: Copies the value from the input register into the DAC
36 Register. Note that a "write and update" command writes the code to
37 BOTH the input register and DAC register, so subsequent "update"
38 commands will simply re-copy the same data (no change in output.)
39
40 5- Power Down DAC: Disable DAC output. Power supply current is reduced.
41 DAC code present in DAC registers at time of shutdown are preserved.
42
43 6- Set reference mode, either internal or external: Selecting external
44 mode prompts for the external reference voltage, which is used directly
45 if no individual DAC calibration is stored. The selection and entered
46 voltage are stored to EEPROM so it is persistent across reset / power cycles.
47
48 USER INPUT DATA FORMAT:
49 decimal : 1024
50 hex : 0x400
51 octal : 02000 (leading 0 "zero")
52 binary : B10000000000
53 float : 1024.0
54
55 @endverbatim
56
57 http://www.linear.com/product/LTC2636
58 http://www.linear.com/product/LTC2634
59
60 http://www.linear.com/product/LTC2636#demoboards
61 http://www.linear.com/product/LTC2634#demoboards
62
63
64 Copyright 2018(c) Analog Devices, Inc.
65
66 All rights reserved.
67
68 Redistribution and use in source and binary forms, with or without
69 modification, are permitted provided that the following conditions are met:
70 - Redistributions of source code must retain the above copyright
71 notice, this list of conditions and the following disclaimer.
72 - Redistributions in binary form must reproduce the above copyright
73 notice, this list of conditions and the following disclaimer in
74 the documentation and/or other materials provided with the
75 distribution.
76 - Neither the name of Analog Devices, Inc. nor the names of its
77 contributors may be used to endorse or promote products derived
78 from this software without specific prior written permission.
79 - The use of this software may or may not infringe the patent rights
80 of one or more patent holders. This license does not release you
81 from the requirement that you obtain separate licenses from these
82 patent holders to use this software.
83 - Use of the software either in source or binary form, must be run
84 on or directly connected to an Analog Devices Inc. component.
85
86 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
87 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
88 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
89 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
90 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
91 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
92 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
93 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
94 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
95 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
96 */
97
98 /*! @file
99 @ingroup LTC2636
100 */
101
102 #include <Arduino.h>
103 #include <stdint.h>
104 #include "Linduino.h"
105 #include "LT_SPI.h"
106 #include "UserInterface.h"
107 #include "LT_I2C.h"
108 #include "QuikEval_EEPROM.h"
109 #include "LTC2636.h"
110 #include <SPI.h>
111 #include <Wire.h>
112
113 // DAC Reference State
114 // Could have been zero or 1, this allows you to use the
115 // variable "reference_mode" as the command argument to a write
116 #define REF_INTERNAL LTC2636_CMD_INTERNAL_REFERENCE //!< Stored reference state is Internal
117 #define REF_EXTERNAL LTC2636_CMD_EXTERNAL_REFERENCE //!< Stored reference state is External
118
119 // Function Declaration
120 void restore_calibration(); // Read the DAC calibration from EEPROM, Return 1 if successful, 0 if not
121 void print_title(); // Print the title block
122 void print_prompt(int16_t selected_dac); // Prompt the user for an input command
123 int16_t prompt_voltage_or_code();
124 uint16_t get_voltage(float LTC2636_lsb, int16_t LTC2636_offset);
125 uint16_t get_code();
126
127 void menu_1_select_dac(int16_t *selected_dac);
128 void menu_2_write_to_input_register(int16_t selected_dac);
129 void menu_3_write_and_update_dac(int16_t selected_dac);
130 void menu_4_update_power_up_dac(int16_t selected_dac);
131 void menu_5_power_down_dac(int16_t selected_dac);
132 void menu_6_set_reference_mode(); // Int, ext, if ext, prompt for voltage
133 int8_t menu_7_calibrate_dacs();
134
135 // Global variables
136 static uint8_t demo_board_connected; //!< Set to 1 if the board is connected
137 static uint8_t shift_count; //!< The data align shift count. For 12-bits=4, 10-bits=6, 8-bits=8
138 static uint8_t reference_mode; //!< Tells whether to set internal or external reference
139 static float reference_voltage; //!< Reference voltage, either internal or external
140 static int16_t LTC2636_offset[9]; //!< DAC offset - index 8 for "all DACs"
141 static float LTC2636_lsb[9]; //!< The LTC2636 lsb - index 8 for "all DACs"
142 static uint8_t num_of_channels = 8; // Change to 4 for LTC2634.
143
144 // Constants
145 //! Lookup table for DAC address. Allows the "All DACs" address to be indexed right after DAC D in loops.
146 //! This technique is very useful for devices with non-monotonic channel addresses.
147 const uint8_t address_map[9] = {LTC2636_DAC_A, LTC2636_DAC_B, LTC2636_DAC_C, LTC2636_DAC_D, LTC2636_DAC_E, LTC2636_DAC_F, LTC2636_DAC_G, LTC2636_DAC_H, LTC2636_DAC_ALL}; //!< Map entered option 0..2 to DAC address
148
149 //! Used to keep track to print voltage or print code
150 enum
151 {
152 PROMPT_VOLTAGE = 0, /**< 0 */
153 PROMPT_CODE = 1 /**< 1 */
154 };
155
156 //! Initialize Linduino
157 void setup()
158 // Setup the program
159 {
160 char demo_name[] = "DC1466"; // Demo Board Name stored in QuikEval EEPROM
161 quikeval_SPI_init(); // Configure the spi port for 4MHz SCK
162 quikeval_SPI_connect(); // Connect SPI to main data port
163 quikeval_I2C_init(); // Configure the EEPROM I2C port for 100kHz
164 Serial.begin(115200); // Initialize the serial port to the PC
165 print_title();
166 demo_board_connected = discover_demo_board(demo_name);
167 if (demo_board_connected)
168 {
169 restore_calibration();
170 print_prompt(0);
171 }
172 }
173
174 //! Repeats Linduino loop
175 void loop()
176 {
177 int16_t user_command;
178 static int16_t selected_dac = 0; // The selected DAC to be updated (0=A, 1=B ... 8=All). Initialized to "A".
179 // The main control loop
180 if (demo_board_connected) // Do nothing if the demo board is not connected
181 {
182 if (Serial.available()) // Check for user input
183 {
184 user_command = read_int(); // Read the user command
185 Serial.println(user_command);
186 Serial.flush();
187 switch (user_command)
188 {
189 case 1:
190 menu_1_select_dac(&selected_dac);
191 break;
192 case 2:
193 menu_2_write_to_input_register(selected_dac);
194 break;
195 case 3:
196 menu_3_write_and_update_dac(selected_dac);
197 break;
198 case 4:
199 menu_4_update_power_up_dac(selected_dac);
200 break;
201 case 5:
202 menu_5_power_down_dac(selected_dac);
203 break;
204 case 6:
205 menu_6_set_reference_mode();
206 break;
207 case 7:
208 menu_7_calibrate_dacs();
209 restore_calibration();
210 break;
211 default:
212 Serial.println("Incorrect Option");
213 break;
214 }
215 Serial.println("\n*****************************************************************");
216 print_prompt(selected_dac);
217 }
218 }
219 }
220
221 // Function Definitions
222
223 //! Select which DAC to operate on
224 void menu_1_select_dac(int16_t *selected_dac)
225 {
226 // Select a DAC to operate on
227 Serial.print(F("Select DAC to operate on (0=A, 1=B, 2=C, 3=D, 4=E, 5=F, 6=G, 7=H, 8=All): "));
228 *selected_dac = read_int();
229 if (*selected_dac != num_of_channels)
230 Serial.println((char) (*selected_dac + 0x41));
231 else
232 Serial.println(F("All"));
233 }
234
235 //! Write data to input register, but do not update DAC output
236 void menu_2_write_to_input_register(int16_t selected_dac)
237 {
238 uint16_t dac_code;
239
240 if (prompt_voltage_or_code() == PROMPT_VOLTAGE)
241 dac_code = get_voltage(LTC2636_lsb[selected_dac], LTC2636_offset[selected_dac]);
242 else
243 dac_code = get_code();
244 LTC2636_write(LTC2636_CS, LTC2636_CMD_WRITE, address_map[selected_dac], dac_code << shift_count);
245 }
246
247 //!Write data to DAC register (which updates output immediately)
248 void menu_3_write_and_update_dac(int16_t selected_dac)
249 {
250 uint16_t dac_code;
251
252 if (prompt_voltage_or_code() == PROMPT_VOLTAGE)
253 dac_code = get_voltage(LTC2636_lsb[selected_dac], LTC2636_offset[selected_dac]);
254 else
255 dac_code = get_code();
256 Serial.print("Code: ");
257 Serial.println(dac_code, HEX);
258 LTC2636_write(LTC2636_CS,LTC2636_CMD_WRITE_UPDATE, address_map[selected_dac], dac_code << shift_count);
259 }
260
261 //! Update DAC with data that is stored in input register, power up if sleeping
262 void menu_4_update_power_up_dac(int16_t selected_dac)
263 {
264 // Update DAC
265 LTC2636_write(LTC2636_CS,LTC2636_CMD_UPDATE, address_map[selected_dac], 0x0000);
266 Serial.print("DAC ");
267 if (selected_dac != num_of_channels)
268 Serial.print((char) (selected_dac + 0x41));
269 else
270 Serial.print("All");
271 Serial.println(" powered up!");
272 }
273
274 //! Power down DAC
275 void menu_5_power_down_dac(int16_t selected_dac)
276 {
277 // Power down DAC
278 LTC2636_write(LTC2636_CS,LTC2636_CMD_POWER_DOWN, address_map[selected_dac], 0x0000);
279 Serial.print("DAC ");
280 if (selected_dac != num_of_channels)
281 Serial.print((char) (selected_dac + 0x41));
282 else
283 Serial.print("All");
284 Serial.println(" powered down!");
285 }
286
287 //! Set reference mode and store to EEPROM
288 void menu_6_set_reference_mode(void) // int, ext, if ext, prompt for voltage
289 {
290 int16_t user_input;
291 Serial.println("Select reference mode - 0 for Internal, 1 for External");
292 user_input = read_int();
293 if (user_input == 1)
294 {
295 reference_mode = REF_EXTERNAL;
296 Serial.println(F("External reference mode selected"));
297 }
298 else
299 {
300 reference_mode = REF_INTERNAL;
301 Serial.println(F("Internal reference mode selected"));
302 }
303 restore_calibration();
304 }
305
306 //! Calibrate all DACs by measuring two known outputs
307 //! @return 0
308 int8_t menu_7_calibrate_dacs()
309 {
310 // Calibrate the DACs using a multi-meter
311 uint8_t i;
312 for (i = 0; i < num_of_channels; i++)
313 {
314 calibrate_dac(i); // Run calibration routine
315 }
316 return (0);
317 }
318
319 //! Read stored calibration parameters from nonvolatile EEPROM on demo board
320 //! @return void
321 void restore_calibration()
322 {
323 uint8_t i;
324 float dac_count; // The number of codes, 4096 for 12 bits, 65536 for 16 bits
325
326 if (reference_mode == REF_EXTERNAL)
327 {
328 Serial.println(F("External reference mode set"));
329 Serial.print("Enter external reference voltage: ");
330 reference_voltage = read_float();
331 Serial.print(reference_voltage, 3);
332 Serial.println("V");
333 }
334 else // EITHER reference is set to internal, OR not programmed in which case default to internal
335 {
336 reference_mode = REF_INTERNAL; // Redundant if already set
337 Serial.println("Internal reference mode set");
338 }
339 LTC2636_write(LTC2636_CS, reference_mode, LTC2636_DAC_ALL, 0x0000);
340 // The following two IF statements are used to allow the program to run with
341 // a QuikEval string that does not contain the demo board option.
342 // If the demo board option is found then these values are overwritten.
343 if (strcmp(demo_board.product_name, "LTC2636-LM") == 0)
344 {
345 // LTC2636-LM, 12-bits, 2.5V full scale
346 shift_count = 4;
347 if (reference_mode == REF_INTERNAL)
348 {
349 reference_voltage = 2.5;
350 Serial.println("Internal reference voltage = 2.5 V");
351 }
352 dac_count = 4096;
353 }
354 if (strcmp(demo_board.product_name, "LTC2636-HZ") == 0)
355 {
356 // LTC2636-HZ, 12-bits, 4.096V full scale
357 shift_count = 4;
358 if (reference_mode == REF_INTERNAL)
359 {
360 reference_voltage = 4.096;
361 Serial.println("Internal reference voltage = 4.096 V");
362 }
363 dac_count = 4096;
364 }
365 if (strcmp(demo_board.product_name, "LTC2636-HM") == 0)
366 {
367 // LTC2636-HM, 12-bits, 4.096V full scale
368 shift_count = 4;
369 if (reference_mode == REF_INTERNAL)
370 {
371 reference_voltage = 4.096;
372 Serial.println("Internal reference voltage = 4.096 V");
373 }
374 dac_count = 4096;
375 }
376 if (strcmp(demo_board.product_name, "LTC2636-LZ") == 0)
377 {
378 // LTC2636-LZ, 12-bits, 4.096V full scale
379 shift_count = 4;
380 if (reference_mode == REF_INTERNAL)
381 {
382 reference_voltage = 4.096;
383 Serial.println("Internal reference voltage = 4.096 V");
384 }
385 dac_count = 4096;
386 }
387
388 for (i = 0; i <= num_of_channels; i++)
389 {
390 LTC2636_offset[i] = 0;
391 LTC2636_lsb[i] = reference_voltage / dac_count;
392 }
393 }
394
395 //! Prints the title block when program first starts.
396 void print_title()
397 {
398 Serial.println("");
399 Serial.println(F("*****************************************************************"));
400 Serial.println(F("* DC1678 Demonstration Program *"));
401 Serial.println(F("* *"));
402 Serial.println(F("* This program demonstrates how to send data to the LTC2636 *"));
403 Serial.println(F("* quad 16/12-bit DAC found on the DC1678 demo board. *"));
404 Serial.println(F("* *"));
405 Serial.println(F("* Set the baud rate to 115200 and select the newline terminator.*"));
406 Serial.println(F("* *"));
407 Serial.println(F("*****************************************************************"));
408 }
409
410 //! Prints main menu.
411 void print_prompt(int16_t selected_dac)
412 {
413 Serial.println(F("\nCommand Summary:"));
414 Serial.println(F(" 1-Select DAC"));
415 Serial.println(F(" 2-Write to input register (no update)"));
416 Serial.println(F(" 3-Write and update DAC"));
417 Serial.println(F(" 4-Update / power up DAC"));
418 Serial.println(F(" 5-Power down DAC"));
419 Serial.println(F(" 6-Set reference mode"));
420 Serial.println(F(" 7-Calibrate DAC"));
421
422 Serial.println("\nPresent Values:");
423 Serial.print(" Selected DAC: ");
424 if (selected_dac != num_of_channels)
425 Serial.println((char) (selected_dac + 0x41));
426 else
427 Serial.println("All");
428 Serial.print(" DAC Reference: ");
429 if (reference_mode == REF_INTERNAL)
430 Serial.println("Internal");
431 else
432 {
433 Serial.print(F("External "));
434 Serial.print(reference_voltage, 3);
435 Serial.println(F("V reference, please verify"));
436 }
437 Serial.print(F("Enter a command: "));
438 Serial.flush();
439 }
440
441 //! Prompt user to enter a voltage or digital code to send to DAC
442 //! @returns user input
443 int16_t prompt_voltage_or_code()
444 {
445 int16_t user_input;
446 Serial.print(F("Type 1 to enter voltage, 2 to enter code:"));
447 Serial.flush();
448 user_input = read_int();
449 Serial.println(user_input);
450
451 if (user_input != 2)
452 return(PROMPT_VOLTAGE);
453 else
454 return(PROMPT_CODE);
455 }
456
457 //! Get voltage from user input, calculate DAC code based on lsb, offset
458 //! @returns the DAC code
459 uint16_t get_voltage(float LTC2636_lsb, int16_t LTC2636_offset)
460 {
461 float dac_voltage;
462
463 Serial.print(F("Enter Desired DAC output voltage: "));
464 dac_voltage = read_float();
465 Serial.print(dac_voltage, 3);
466 Serial.println(" V");
467 Serial.flush();
468 return(LTC2636_voltage_to_code(dac_voltage, LTC2636_lsb, LTC2636_offset));
469 }
470
471 //! Get code to send to DAC directly, in decimal, hex, or binary
472 //! @return code from user
473 uint16_t get_code()
474 {
475 uint16_t returncode;
476 Serial.println("Enter Desired DAC Code");
477 Serial.print("(Format 32768, 0x8000, 0100000, or B1000000000000000): ");
478 returncode = (uint16_t) read_int();
479 Serial.print("0x");
480 Serial.println(returncode, HEX);
481 Serial.flush();
482 return(returncode);
483 }
484
485 //! Calibrate the selected DAC using a voltmeter. The routine
486 //! does a linear curve fit given two data points.
487 //! @return ACK bit (0=acknowledge, 1=no acknowledge)
488 int8_t calibrate_dac(uint8_t index)
489 {
490 int8_t ack=0;
491 uint16_t code1 = 0x0200; //! Calibration code 1
492 uint16_t code2 = 0x0FFF; //! Calibration code 2
493 float voltage1; //! Calibration voltage 1
494 float voltage2; //! Calibration voltage 2
495 Serial.println("");
496 Serial.print("Calibrating DAC ");
497 Serial.println((char) (0x41 + index));
498 // Left align 12-bit code1 to 16 bits & write to DAC
499 LTC2636_write(LTC2636_CS, LTC2636_CMD_WRITE_UPDATE, index, code1 << shift_count);
500 Serial.print("DAC code set to 0x");
501 Serial.println(code1, HEX);
502 Serial.print("Enter measured DAC voltage:");
503 voltage1 = read_float();
504 Serial.print(voltage1, 6);
505 Serial.println(" V");
506 // Left align 12-bit code2 to 16 bits & write to DAC
507 LTC2636_write(LTC2636_CS, LTC2636_CMD_WRITE_UPDATE, index, code2 << shift_count);
508 Serial.print("DAC code set to 0x");
509 Serial.println(code2, HEX);
510 Serial.print("Enter measured DAC voltage:");
511 voltage2 = read_float();
512 Serial.print(voltage2, 6);
513 Serial.println(" V");
514 LTC2636_calibrate(code1, code2, voltage1, voltage2, &LTC2636_lsb[index], &LTC2636_offset[index]);
515 return(ack);
516 }
LTC2636_CMD_WRITE_UPDATE
#define LTC2636_CMD_WRITE_UPDATE
Write to input register n, update (power up) all.
Definition: LTC2636.h:121
demo_board
struct demo_board_type demo_board
Instantiate demo board structure.
Definition: QuikEval_EEPROM.cpp:71
LTC2636.h
LTC2636: Octal 12-/10-/8-Bit SPI VOUT DACs with 10ppm/°C Reference.
shift_count
static uint8_t shift_count
The data align shift count.
Definition: DC1466.ino:137
LTC2636_lsb
static float LTC2636_lsb[9]
The LTC2636 lsb - index 8 for "all DACs".
Definition: DC1466.ino:141
user_command
unsigned char user_command
Definition: Serial_EEPROM_Test.ino:75
prompt_voltage_or_code
static int16_t prompt_voltage_or_code()
Prompt user to enter a voltage or digital code to send to DAC.
Definition: DC1466.ino:443
menu_2_write_to_input_register
static void menu_2_write_to_input_register(int16_t selected_dac)
Write data to input register, but do not update DAC output.
Definition: DC1466.ino:236
REF_INTERNAL
#define REF_INTERNAL
Stored reference state is Internal.
Definition: DC1466.ino:116
Linduino.h
Header File for Linduino Libraries and Demo Code.
menu_3_write_and_update_dac
static void menu_3_write_and_update_dac(int16_t selected_dac)
Write data to DAC register (which updates output immediately)
Definition: DC1466.ino:248
LTC2636_DAC_ALL
#define LTC2636_DAC_ALL
Definition: LTC2636.h:140
calibrate_dac
static int8_t calibrate_dac(uint8_t index)
Calibrate the selected DAC using a voltmeter.
Definition: DC1466.ino:488
demo_board_connected
static uint8_t demo_board_connected
Set to 1 if the board is connected.
Definition: DC1466.ino:136
print_prompt
static void print_prompt(int16_t selected_dac)
Prints main menu.
Definition: DC1466.ino:411
menu_7_calibrate_dacs
static int8_t menu_7_calibrate_dacs()
Calibrate all DACs by measuring two known outputs.
Definition: DC1466.ino:308
LTC2636_CS
#define LTC2636_CS
Define the SPI CS pin.
Definition: LTC2636.h:112
LTC2636_offset
static int16_t LTC2636_offset[9]
DAC offset - index 8 for "all DACs".
Definition: DC1466.ino:140
menu_1_select_dac
static void menu_1_select_dac(int16_t *selected_dac)
Select which DAC to operate on.
Definition: DC1466.ino:224
print_title
static void print_title()
Prints the title block when program first starts.
Definition: DC1466.ino:396
get_code
static uint16_t get_code()
Get code to send to DAC directly, in decimal, hex, or binary.
Definition: DC1466.ino:473
LTC2636_DAC_C
#define LTC2636_DAC_C
Definition: LTC2636.h:134
LTC2636_DAC_F
#define LTC2636_DAC_F
Definition: LTC2636.h:137
num_of_channels
static uint8_t num_of_channels
Definition: DC1466.ino:142
LTC2636_CMD_UPDATE
#define LTC2636_CMD_UPDATE
Update (power up) DAC register n.
Definition: LTC2636.h:119
reference_voltage
static float reference_voltage
Reference voltage, either internal or external.
Definition: DC1466.ino:139
QuikEval_EEPROM.h
QuikEval EEPROM Library.
LTC2636_voltage_to_code
uint16_t LTC2636_voltage_to_code(float dac_voltage, float LTC2636_lsb, int16_t LTC2636_offset)
Calculate a LTC2636 DAC code given the desired output voltage, offset, and LSB value.
Definition: LTC2636.cpp:99
quikeval_SPI_init
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
Definition: LT_SPI.cpp:151
LTC2636_CMD_WRITE
#define LTC2636_CMD_WRITE
Write to input register n.
Definition: LTC2636.h:118
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
restore_calibration
static void restore_calibration()
Read stored calibration parameters from nonvolatile EEPROM on demo board.
Definition: DC1466.ino:321
loop
static void loop()
Repeats Linduino loop.
Definition: DC1466.ino:175
LT_SPI.h
LT_SPI: Routines to communicate with ATmega328P&#39;s hardware SPI port.
LTC2636_calibrate
void LTC2636_calibrate(uint16_t dac_code1, uint16_t dac_code2, float voltage1, float voltage2, float *LTC2636_lsb, int16_t *LTC2636_offset)
Calculate the LTC2636 offset and LSB voltages given two measured voltages and their corresponding cod...
Definition: LTC2636.cpp:120
LTC2636_DAC_B
#define LTC2636_DAC_B
Definition: LTC2636.h:133
LTC2636_DAC_E
#define LTC2636_DAC_E
Definition: LTC2636.h:136
get_voltage
static uint16_t get_voltage(float LTC2636_lsb, int16_t LTC2636_offset)
Get voltage from user input, calculate DAC code based on lsb, offset.
Definition: DC1466.ino:459
LT_I2C.h
LT_I2C: Routines to communicate with ATmega328P&#39;s hardware I2C port.
demo_name
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
Definition: DC1880A.ino:97
menu_6_set_reference_mode
static void menu_6_set_reference_mode()
Set reference mode and store to EEPROM.
Definition: DC1466.ino:288
setup
static void setup()
Initialize Linduino.
Definition: DC1466.ino:157
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
index
static int index
Definition: device_logger.ino:91
read_float
float read_float()
Definition: UserInterface.cpp:78
demo_board_type::product_name
char product_name[15]
LTC Product (LTC2654-L16)
Definition: QuikEval_EEPROM.h:70
menu_5_power_down_dac
static void menu_5_power_down_dac(int16_t selected_dac)
Power down DAC.
Definition: DC1466.ino:275
PROMPT_CODE
1
Definition: DC1466.ino:153
quikeval_I2C_init
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
Definition: LT_I2C.cpp:394
address_map
const uint8_t address_map[9]
Lookup table for DAC address.
Definition: DC1466.ino:147
i
static int i
Definition: DC2430A.ino:184
LTC2636_CMD_POWER_DOWN
#define LTC2636_CMD_POWER_DOWN
Power down n.
Definition: LTC2636.h:122
REF_EXTERNAL
#define REF_EXTERNAL
Stored reference state is External.
Definition: DC1466.ino:117
PROMPT_VOLTAGE
0
Definition: DC1466.ino:152
LTC2636_DAC_D
#define LTC2636_DAC_D
Definition: LTC2636.h:135
reference_mode
static uint8_t reference_mode
Tells whether to set internal or external reference.
Definition: DC1466.ino:138
LTC2636_write
void LTC2636_write(uint8_t cs, uint8_t dac_command, uint8_t dac_address, uint16_t dac_code)
Write the 16-bit dac_code to the LTC2636.
Definition: LTC2636.cpp:84
LTC2636_DAC_A
#define LTC2636_DAC_A
Definition: LTC2636.h:132
LTC2636_DAC_H
#define LTC2636_DAC_H
Definition: LTC2636.h:139
menu_4_update_power_up_dac
static void menu_4_update_power_up_dac(int16_t selected_dac)
Update DAC with data that is stored in input register, power up if sleeping.
Definition: DC1466.ino:262
LTC2636_DAC_G
#define LTC2636_DAC_G
Definition: LTC2636.h:138