| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

DC1705C.ino
Go to the documentation of this file.
1 /*!
2 DC1705C
3 LTC6946: Ultralow Noise and Spurious 0.37GHz to 6.39GHz IntegerN Synthesizer with Integrated VCO
4
5 @verbatim
6
7 Setup:
8 Set the terminal baud rate to 115200 and select the newline terminator.
9 Refer to Demo Manual DC1705C.
10 Ensure all jumpers are installed in the factory default positions.
11 Two power supplies are needed for this demo board: a 5v and a 3.3v supply.
12 A reference frequency is also needed for this demo board, refer to the
13 DC1705 Demo Manual for details.
14
15
16 Command Description:
17
18 *****Main Menu*****
19 1- Load Default Settings- Loads the SPI map that is identical to file
20 LTC6946-x_100MHz.pllset that is supplied with the PLLWizard and mentioned
21 in the DC1705C user's manual. It assumes a 100MHz reference input and the
22 default DC1705C loop filter. It should output a 907MHz signal on RF+/-.
23
24 ** If you want to use a different loop filter, reference frequency or different
25 register settings. Please use PLLWizard for the loop filter design and initial
26 device setup. The register settings from PLLWizard can be entered into menu option 2.
27
28 2- READ/WRITE to Registers Addresses- Selecting this option will cause all the registers to
29 be read, stored to variables, and displayed. The user will then have the option
30 to write to one register address at a time.
31
32 3- READ/WRITE to Registers Fields- Selecting this option will allow the user
33 to read or write to one register field name at a time.
34
35 4- This function calculates and programs OD, ND, NUM based on the desired Frf,
36 the reference frequency, and the current RD value. Linduino One (Arduino Uno) are
37 limited to 32 bit floats, int and doubles. Significant rounding errors are created
38 with this 32 bit limitation. Therefore, this function uses 64bit math functions
39 specifically created to overcome this limitation. After OD, ND, and NUM are programmed,
40 the program calibrates the LTC6946. If other register need change see menu 2 or menu 3.
41
42 5- This function stores the current SPI settings in the demo boards EEPROM
43
44 6- This function loads SPI settings from the demo boards EEPROM to the device
45
46 USER INPUT DATA FORMAT:
47 decimal : 1024
48 hex : 0x400
49 octal : 02000 (leading 0 "zero")
50 binary : B10000000000
51 float : 1024.0
52
53 @endverbatim
54
55 http://www.linear.com/product/LTC6946
56
57 http://www.linear.com/product/LTC6946#demoboards
58
59
60 Copyright 2018(c) Analog Devices, Inc.
61
62 All rights reserved.
63
64 Redistribution and use in source and binary forms, with or without
65 modification, are permitted provided that the following conditions are met:
66 - Redistributions of source code must retain the above copyright
67 notice, this list of conditions and the following disclaimer.
68 - Redistributions in binary form must reproduce the above copyright
69 notice, this list of conditions and the following disclaimer in
70 the documentation and/or other materials provided with the
71 distribution.
72 - Neither the name of Analog Devices, Inc. nor the names of its
73 contributors may be used to endorse or promote products derived
74 from this software without specific prior written permission.
75 - The use of this software may or may not infringe the patent rights
76 of one or more patent holders. This license does not release you
77 from the requirement that you obtain separate licenses from these
78 patent holders to use this software.
79 - Use of the software either in source or binary form, must be run
80 on or directly connected to an Analog Devices Inc. component.
81
82 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
83 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
84 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
85 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
86 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
87 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
88 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
89 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
90 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
91 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
92 */
93
94 /*! @file
95 @ingroup LTC6946
96 */
97
98 #include <Arduino.h>
99 #include <stdint.h>
100 #include "Linduino.h"
101 #include "LT_SPI.h"
102 #include "UserInterface.h"
103 #include "LT_I2C.h"
104 #include "QuikEval_EEPROM.h"
105 #include "LTC6946.h"
106 #include <SPI.h>
107 #include <Wire.h>
108
109 // Function Declaration
110 void print_title(); // Print the title block
111 void print_prompt(); // Print the main menu
112 void menu_1_load_default_settings(); // Sub-menus
113 void menu_2_RW_to_reg_addresss();
114 void menu_3_RW_to_reg_field();
115 void menu_4_set_frf();
116 void menu_5_store_settings();
117 void menu_6_restore_settings();
118
119 // Global Variables
120 static uint8_t ref_out = 0; //!< Used to keep track of reference out status
121 static int8_t demo_board_connected; //!< Demo Board Name stored in QuikEval EEPROM
122 uint8_t First_Run=0; //!< if first time through loop = 0, otherwise=1
123
124
125 /* ------------------------------------------------------------------------- */
126 //! Initialize Linduino
127 //! @return void
128 void setup()
129 {
130 char demo_name[] = "DC1705"; // Demo Board Name stored in QuikEval EEPROM
131 uint8_t data;
132
133 quikeval_SPI_init(); //! Configure the spi port for 4MHz SCK
134 quikeval_SPI_connect(); //! Connect SPI to main data port
135 quikeval_I2C_init(); //! Configure the EEPROM I2C port for 100kHz
136 Serial.begin(115200); //! Initialize the serial port to the PC
137 LTC6946_init();
138 print_title();
139
140 demo_board_connected = discover_demo_board(demo_name); //! Checks if correct demo board is connected.
141
142 if (!demo_board_connected)
143 while (1); //! Does nothing if the demo board is not connected
144
145 Serial.print(demo_board.name);
146 Serial.println(F(" was found"));
147
148 print_prompt();
149 } // end of setup()
150
151
152 /* ------------------------------------------------------------------------- */
153 //! Repeats Linduino loop
154 //! @return void
155 void loop()
156 {
157 uint16_t user_command; // User input command
158
159 if (Serial.available()) // Check for user input
160 {
161 if (First_Run==0)
162 {
163 First_Run=1;
164 }
165
166 user_command = read_int(); //! Reads the user command
167 if (user_command != 'm')
168 Serial.println(user_command);
169
170 switch (user_command) //! Prints the appropriate submenu
171 {
172 case 1:
173 menu_1_load_default_settings();
174 break;
175
176 case 2:
177 menu_2_RW_to_reg_addresss();
178 break;
179
180 case 3:
181 menu_3_RW_to_reg_field();
182 break;
183
184 case 4:
185 menu_4_set_frf();
186 break;
187
188 case 5:
189 menu_5_store_settings();
190 break;
191
192 case 6:
193 menu_6_restore_settings();
194 break;
195
196 default:
197 Serial.println(F("Incorrect Option"));
198 break;
199 } // end of switch statement
200 Serial.println(F("\n*****************************************************************"));
201 print_prompt();
202 } // end of if statement
203 } // end of loop()
204
205 // Function Definitions
206 /* ------------------------------------------------------------------------- */
207 //! Menu 1: Load Default SPI Register Settings
208 //! This function identifies which of the 4 LTC6946 frequency versions are connected.
209 //! Based on the version connected, this function loads the register settings referenced
210 //! in the DC1705C demo manual's quick start section.
211 //! The register settings loaded are the same as PLL WIZARDS pllset files
212 //! DC1705-x(LTC6946-x)100MHz.pllset (where x=1,2,3,or 4)
213 //! The setting loaded with this function assume the LTC6946's reference is set to 100MHz and
214 //! the DC1705C's loop filter has not been modified.
215 //! @return void
216 void menu_1_load_default_settings()
217 {
218
219 // select which default register setting to load based on part number
220 if (demo_board.product_name[8]=='1') // if this is a LTC6946-1
221 set_LTC6946_ALLREGS(LTC6946_CS, 0x04,0x0C,0x00,0x64,0x0A,0x8C,0x33,0x9B,0x8B,0x00);
222 else if (demo_board.product_name[8]=='2') // if this is a LTC6946-2
223 set_LTC6946_ALLREGS(LTC6946_CS, 0x04,0x0C,0x00,0x64,0x0E,0x10,0x33,0x9C,0x8B,0x00);
224 else if (demo_board.product_name[8]=='3') // if this is a LTC6946-3
225 set_LTC6946_ALLREGS(LTC6946_CS, 0x04,0x0C,0x00,0x64,0x11,0x94,0x33,0x9D,0x8B,0x00);
226 else if (demo_board.product_name[8]=='4') // if this is a LTC6946-4
227 set_LTC6946_ALLREGS(LTC6946_CS, 0x04,0x0C,0x00,0x64,0x11,0x94,0x33,0x9D,0x8B,0x00);
228 else
229 {
230 Serial.print("No default file for this board: ");
231 Serial.println(demo_board.product_name);
232 } // end if-then-else statement
233
234 Serial.println(F("Registers Have Been Written"));
235 } // end menu_1_load_default_settings function
236
237
238 /* ------------------------------------------------------------------------- */
239 //! Menu 2: Reads and/or Writes the SPI register address
240 //! This function reads and displays all SPI register address settings in HEX format.
241 //! It then provides an option to modify(write to) individual registers one at time
242 //!
243 //! EXAMPLE:
244 //! - 0- ADDR00 = 0x40 (read only)
245 //! - 1- ADDR01 = 0x04
246 //! - ....
247 //! - 10- ADDR0A = 0x00
248 //! - 11- ADDR0B = 0x41 (read only)
249 //! - 0 - Return to Main Menu
250 //! - Enter a command (1-10 to modify register, or '0' to return to Main Menu):
251 //! @return void
252 void menu_2_RW_to_reg_addresss()
253 {
254 uint8_t i, regval, user_regval, num_reg;
255 uint16_t user_address; // User input command
256
257 num_reg = get_LTC6946_REGSIZE();
258 user_address=1;
259 // Read/Write loop, can exit loop by choosing '0'
260 while (user_address != 0)
261 {
262 Serial.println(F("\n*****************************************************************"));
263 // Read All Registers and display results
264 for (i=0; i<num_reg; i++)
265 {
266 regval = LTC6946_read(LTC6946_CS,i);
267 Serial.print(i);
268 if (i<16)
269 Serial.print(F("- ADDR0"));
270 else
271 Serial.print(F("- ADDR"));
272 Serial.print(i, HEX);
273 Serial.print(F(" = 0x"));
274 if (regval<16) Serial.print(F("0"));
275 Serial.print(regval, HEX);
276 if ((i==0)||(i==(num_reg-1))) Serial.print(" (read only) ");
277 if (i==2) Serial.print(" (warning: if D0=1 it resets all registers. Power On Reset Bit)");
278 Serial.println("");
279 } // end for loop
280 Serial.print("0 - Return to Main Menu\n\n");
281 // User input: Select which register to modify, or return to main menu
282 Serial.print("Enter a command (1-10 to modify register, or '0' to return to Main Menu): ");
283 user_address = read_int(); //! Reads the user command
284 Serial.println(user_address);
285
286 // User input: enter new setting for selected register
287 if (user_address >0 && user_address<(num_reg-1))
288 {
289 Serial.print("What value should ADDR");
290 Serial.print(user_address);
291 Serial.print(" be set to (ex: HEX format 0xff): ");
292 user_regval = read_int(); //! Reads the user command
293 Serial.println(user_regval);
294
295 // writes new setting to part
296 LTC6946_write(LTC6946_CS, (uint8_t)user_address, user_regval);
297 } // end if statement
298 } // end while loop
299 } // end menu_2_RW_to_reg_addresss
300
301
302 /* ------------------------------------------------------------------------- */
303 //! Support function for function menu_3_RW_to_reg_field
304 //! displays current state of select field
305 //! provides user the option to write to that field or return to menu
306 //! @return field value (user input) that will be written to part
307 long field_menu_RW(long field_val, //!< current state of the selected field
308 char field_name[], //!< SPI Field name selected
309 uint8_t f //!< SPI field identifier identifies selected fields information in SPI MAP arrays
310 )
311 {
312 long usr_field_val;
313 uint8_t field_size, i;
314 long max_num=1, pow2=1;
315
316 Serial.print("CURRENT STATE (HEX): ");
317 Serial.print(field_name);
318 Serial.print("= 0x");
319 Serial.println(field_val, HEX);
320
321 if (get_LTC6946_SPI_FIELD_RW(f)==0)
322 {
323 field_size=get_LTC6946_SPI_FIELD_NUMBITS(f);
324 for (i=1; i<field_size; i++)
325 {
326 pow2=pow2*2;
327 max_num=max_num + pow2;
328 }
329
330 Serial.print("What value should ");
331 Serial.print(field_name);
332 Serial.print(" be set to or type '-1' to exit: (ex: HEX format 0x00 to 0x");
333 Serial.print(max_num, HEX);
334 Serial.print(")");
335 usr_field_val = read_int(); //! Reads the user command
336
337 if (usr_field_val>=0 && usr_field_val<=max_num)
338 {
339 Serial.println(usr_field_val);
340 return usr_field_val;
341 }
342 else
343 {
344 return field_val;
345 } // end of if statement
346 } // end of if statement
347 } // end of field_menu_RW
348
349
350 /* ------------------------------------------------------------------------- */
351 //! Menu 3: Reads and/or Writes individual SPI fields
352 //! This function provides the user with a list of all SPI fields.
353 //! The user can select a SPI field to read its current value.
354 //! Then the user will be provided with an option to write to that field
355 //! or return to the selection menu.
356 //!
357 //! EXAMPLE:
358 //! - 1-ALCCAL 15-CPMID 29-PDALL
359 //! - 2-ALCEN 16-CPRST 30-PDOUT
360 //! - ....
361 //! - 13-CPDN 27-OMUTE 41-x
362 //! - 14-CPINV 28-PART *
363 //! - 0 - Return to Main Menu
364 //! - * = READ ONLY FIELD
365 //! - Enter a command (1-41 to modify register, or '0' to return to Main Menu):
366 //! @return void
367 void menu_3_RW_to_reg_field()
368 {
369 uint8_t field_num;
370 long field_val;
371
372 field_num=1;
373 // Read/Write loop, can exit loop by choosing 'm'
374 while (field_num != 0)
375 {
376 Serial.println(F("\n*****************************************************************"));
377 // Select Fields to read and write to
378 Serial.print(F("1-ALCCAL 15-CPMID 29-PDALL\n"));
379 Serial.print(F("2-ALCEN 16-CPRST 30-PDOUT\n"));
380 Serial.print(F("3-ALCHI * 17-CPUP 31-PDPLL\n"));
381 Serial.print(F("4-ALCLO * 18-CPWIDE 32-PDREFO\n"));
382 Serial.print(F("5-ALCMON 19-FILT 33-PDVCO\n"));
383 Serial.print(F("6-ALCULOK 20-LKCT 34-POR\n"));
384 Serial.print(F("7-BD 21-LKEN 35-RD\n"));
385 Serial.print(F("8-BST 22-LKWIN 36-REV *\n"));
386 Serial.print(F("9-CAL 23-LOCK * 37-RFO\n"));
387 Serial.print(F("10-CP 24-MTCAL 38-THI *\n"));
388 Serial.print(F("11-CPCHI 25-ND 39-TLO *\n"));
389 Serial.print(F("12-CPCLO 26-OD 40-UNLOK *\n"));
390 Serial.print(F("13-CPDN 27-OMUTE 41-x\n"));
391 Serial.print(F("14-CPINV 28-PART *\n"));
392 Serial.print("0 - Return to Main Menu\n");
393 Serial.print("* = READ ONLY FIELD\n\n");
394
395 Serial.print("Enter a command (1-41 to modify register, or '0' to return to Main Menu): ");
396 field_num = read_int(); //! Reads the user command
397 Serial.println(field_num);
398
399 // User input: enter new setting for selected register
400 if (field_num != 0)
401 {
402 switch (field_num) //! Prints the appropriate submenu
403 {
404 case LTC6946_ALCCAL:
405 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_ALCCAL); // reads selected field
406 field_val=field_menu_RW(field_val,"ALCCAL",LTC6946_ALCCAL); // user interface control and printout
407 if (field_val>-1)
408 {
409 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_ALCCAL, field_val); // updates selected field
410 }
411 break;
412
413 case LTC6946_ALCEN:
414 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_ALCEN); // reads selected field
415 field_val=field_menu_RW(field_val,"ALCEN",LTC6946_ALCEN); // user interface control and printout
416 if (field_val>-1)
417 {
418 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_ALCEN, field_val); // updates selected field
419 }
420 break;
421
422 case LTC6946_ALCHI:
423 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_ALCHI); // reads selected field
424 field_val=field_menu_RW(field_val,"ALCHI",LTC6946_ALCHI); // user interface control and printout
425 if (field_val>-1)
426 {
427 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_ALCHI, field_val); // updates selected field
428 }
429 break;
430
431 case LTC6946_ALCLO:
432 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_ALCLO); // reads selected field
433 field_val=field_menu_RW(field_val,"ALCLO",LTC6946_ALCLO); // user interface control and printout
434 if (field_val>-1)
435 {
436 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_ALCLO, field_val); // updates selected field
437 }
438 break;
439
440 case LTC6946_ALCMON:
441 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_ALCMON); // reads selected field
442 field_val=field_menu_RW(field_val,"ALCMON",LTC6946_ALCMON); // user interface control and printout
443 if (field_val>-1)
444 {
445 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_ALCMON, field_val); // updates selected field
446 }
447 break;
448
449 case LTC6946_ALCULOK:
450 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_ALCULOK); // reads selected field
451 field_val=field_menu_RW(field_val,"ALCULOK",LTC6946_ALCULOK); // user interface control and printout
452 if (field_val>-1)
453 {
454 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_ALCULOK, field_val); // updates selected field
455 }
456 break;
457
458 case LTC6946_BD:
459 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_BD); // reads selected field
460 field_val=field_menu_RW(field_val,"BD",LTC6946_BD); // user interface control and printout
461 if (field_val>-1)
462 {
463 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_BD, field_val); // updates selected field
464 }
465 break;
466
467 case LTC6946_BST:
468 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_BST); // reads selected field
469 field_val=field_menu_RW(field_val,"BST",LTC6946_BST); // user interface control and printout
470 if (field_val>-1)
471 {
472 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_BST, field_val); // updates selected field
473 }
474 break;
475
476 case LTC6946_CAL:
477 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CAL); // reads selected field
478 field_val=field_menu_RW(field_val,"CAL",LTC6946_CAL); // user interface control and printout
479 if (field_val>-1)
480 {
481 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CAL, field_val); // updates selected field
482 }
483 break;
484
485 case LTC6946_CP:
486 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CP); // reads selected field
487 field_val=field_menu_RW(field_val,"CP",LTC6946_CP); // user interface control and printout
488 if (field_val>-1)
489 {
490 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CP, field_val); // updates selected field
491 }
492 break;
493
494 case LTC6946_CPCHI:
495 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CPCHI); // reads selected field
496 field_val=field_menu_RW(field_val,"CPCHI",LTC6946_CPCHI); // user interface control and printout
497 if (field_val>-1)
498 {
499 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CPCHI, field_val); // updates selected field
500 }
501 break;
502
503 case LTC6946_CPCLO:
504 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CPCLO); // reads selected field
505 field_val=field_menu_RW(field_val,"CPCLO",LTC6946_CPCLO); // user interface control and printout
506 if (field_val>-1)
507 {
508 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CPCLO, field_val); // updates selected field
509 }
510 break;
511
512 case LTC6946_CPDN:
513 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CPDN); // reads selected field
514 field_val=field_menu_RW(field_val,"CPDN",LTC6946_CPDN); // user interface control and printout
515 if (field_val>-1)
516 {
517 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CPDN, field_val); // updates selected field
518 }
519 break;
520
521 case LTC6946_CPINV:
522 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CPINV); // reads selected field
523 field_val=field_menu_RW(field_val,"CPINV",LTC6946_CPINV); // user interface control and printout
524 if (field_val>-1)
525 {
526 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CPINV, field_val); // updates selected field
527 }
528 break;
529
530 case LTC6946_CPMID:
531 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CPMID); // reads selected field
532 field_val=field_menu_RW(field_val,"CPMID",LTC6946_CPMID); // user interface control and printout
533 if (field_val>-1)
534 {
535 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CPMID, field_val); // updates selected field
536 }
537 break;
538
539 case LTC6946_CPRST:
540 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CPRST); // reads selected field
541 field_val=field_menu_RW(field_val,"CPRST",LTC6946_CPRST); // user interface control and printout
542 if (field_val>-1)
543 {
544 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CPRST, field_val); // updates selected field
545 }
546 break;
547
548 case LTC6946_CPUP:
549 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CPUP); // reads selected field
550 field_val=field_menu_RW(field_val,"CPUP",LTC6946_CPUP); // user interface control and printout
551 if (field_val>-1)
552 {
553 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CPUP, field_val); // updates selected field
554 }
555 break;
556
557 case LTC6946_CPWIDE:
558 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_CPWIDE); // reads selected field
559 field_val=field_menu_RW(field_val,"CPWIDE",LTC6946_CPWIDE); // user interface control and printout
560 if (field_val>-1)
561 {
562 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_CPWIDE, field_val); // updates selected field
563 }
564 break;
565
566 case LTC6946_FILT:
567 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_FILT); // reads selected field
568 field_val=field_menu_RW(field_val,"FILT",LTC6946_FILT); // user interface control and printout
569 if (field_val>-1)
570 {
571 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_FILT, field_val); // updates selected field
572 }
573 break;
574
575 case LTC6946_LKCT:
576 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_LKCT); // reads selected field
577 field_val=field_menu_RW(field_val,"LKCT",LTC6946_LKCT); // user interface control and printout
578 if (field_val>-1)
579 {
580 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_LKCT, field_val); // updates selected field
581 }
582 break;
583
584 case LTC6946_LKEN:
585 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_LKEN); // reads selected field
586 field_val=field_menu_RW(field_val,"LKEN",LTC6946_LKEN); // user interface control and printout
587 if (field_val>-1)
588 {
589 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_LKEN, field_val); // updates selected field
590 }
591 break;
592
593 case LTC6946_LKWIN:
594 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_LKWIN); // reads selected field
595 field_val=field_menu_RW(field_val,"LKWIN",LTC6946_LKWIN); // user interface control and printout
596 if (field_val>-1)
597 {
598 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_LKWIN, field_val); // updates selected field
599 }
600 break;
601
602 case LTC6946_LOCK:
603 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_LOCK); // reads selected field
604 field_val=field_menu_RW(field_val,"LOCK",LTC6946_LOCK); // user interface control and printout
605 if (field_val>-1)
606 {
607 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_LOCK, field_val); // updates selected field
608 }
609 break;
610
611 case LTC6946_MTCAL:
612 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_MTCAL); // reads selected field
613 field_val=field_menu_RW(field_val,"MTCAL",LTC6946_MTCAL); // user interface control and printout
614 if (field_val>-1)
615 {
616 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_MTCAL, field_val); // updates selected field
617 }
618 break;
619
620 case LTC6946_ND:
621 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_ND); // reads selected field
622 field_val=field_menu_RW(field_val,"ND",LTC6946_ND); // user interface control and printout
623 if (field_val>-1)
624 {
625 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_ND, field_val); // updates selected field
626 }
627 break;
628
629 case LTC6946_OD:
630 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_OD); // reads selected field
631 field_val=field_menu_RW(field_val,"OD",LTC6946_OD); // user interface control and printout
632 if (field_val>-1)
633 {
634 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_OD, field_val); // updates selected field
635 }
636 break;
637
638 case LTC6946_OMUTE:
639 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_OMUTE); // reads selected field
640 field_val=field_menu_RW(field_val,"OMUTE",LTC6946_OMUTE); // user interface control and printout
641 if (field_val>-1)
642 {
643 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_OMUTE, field_val); // updates selected field
644 }
645 break;
646
647 case LTC6946_PART:
648 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_PART); // reads selected field
649 field_val=field_menu_RW(field_val,"PART",LTC6946_PART); // user interface control and printout
650 if (field_val>-1)
651 {
652 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_PART, field_val); // updates selected field
653 }
654 break;
655
656 case LTC6946_PDALL:
657 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_PDALL); // reads selected field
658 field_val=field_menu_RW(field_val,"PDALL",LTC6946_PDALL); // user interface control and printout
659 if (field_val>-1)
660 {
661 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_PDALL, field_val); // updates selected field
662 }
663 break;
664
665 case LTC6946_PDOUT:
666 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_PDOUT); // reads selected field
667 field_val=field_menu_RW(field_val,"PDOUT",LTC6946_PDOUT); // user interface control and printout
668 if (field_val>-1)
669 {
670 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_PDOUT, field_val); // updates selected field
671 }
672 break;
673
674 case LTC6946_PDPLL:
675 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_PDPLL); // reads selected field
676 field_val=field_menu_RW(field_val,"PDPLL",LTC6946_PDPLL); // user interface control and printout
677 if (field_val>-1)
678 {
679 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_PDPLL, field_val); // updates selected field
680 }
681 break;
682
683 case LTC6946_PDREFO:
684 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_PDREFO); // reads selected field
685 field_val=field_menu_RW(field_val,"PDREFO",LTC6946_PDREFO); // user interface control and printout
686 if (field_val>-1)
687 {
688 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_PDREFO, field_val); // updates selected field
689 }
690 break;
691
692 case LTC6946_PDVCO:
693 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_PDVCO); // reads selected field
694 field_val=field_menu_RW(field_val,"PDVCO",LTC6946_PDVCO); // user interface control and printout
695 if (field_val>-1)
696 {
697 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_PDVCO, field_val); // updates selected field
698 }
699 break;
700
701 case LTC6946_POR:
702 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_POR); // reads selected field
703 field_val=field_menu_RW(field_val,"POR",LTC6946_POR); // user interface control and printout
704 if (field_val>-1)
705 {
706 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_POR, field_val); // updates selected field
707 }
708 break;
709
710 case LTC6946_RD:
711 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_RD); // reads selected field
712 field_val=field_menu_RW(field_val,"RD",LTC6946_RD); // user interface control and printout
713 if (field_val>-1)
714 {
715 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_RD, field_val); // updates selected field
716 }
717 break;
718
719 case LTC6946_REV:
720 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_REV); // reads selected field
721 field_val=field_menu_RW(field_val,"REV",LTC6946_REV); // user interface control and printout
722 if (field_val>-1)
723 {
724 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_REV, field_val); // updates selected field
725 }
726 break;
727
728 case LTC6946_RFO:
729 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_RFO); // reads selected field
730 field_val=field_menu_RW(field_val,"RFO",LTC6946_RFO); // user interface control and printout
731 if (field_val>-1)
732 {
733 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_RFO, field_val); // updates selected field
734 }
735 break;
736
737 case LTC6946_THI:
738 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_THI); // reads selected field
739 field_val=field_menu_RW(field_val,"THI",LTC6946_THI); // user interface control and printout
740 if (field_val>-1)
741 {
742 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_THI, field_val); // updates selected field
743 }
744 break;
745
746 case LTC6946_TLO:
747 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_TLO); // reads selected field
748 field_val=field_menu_RW(field_val,"TLO",LTC6946_TLO); // user interface control and printout
749 if (field_val>-1)
750 {
751 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_TLO, field_val); // updates selected field
752 }
753 break;
754
755 case LTC6946_UNLOK:
756 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_UNLOK); // reads selected field
757 field_val=field_menu_RW(field_val,"UNLOK",LTC6946_UNLOK); // user interface control and printout
758 if (field_val>-1)
759 {
760 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_UNLOK, field_val); // updates selected field
761 }
762 break;
763
764 case LTC6946_x:
765 field_val=get_LTC6946_SPI_FIELD(LTC6946_CS,LTC6946_x); // reads selected field
766 field_val=field_menu_RW(field_val,"x",LTC6946_x); // user interface control and printout
767 if (field_val>-1)
768 {
769 set_LTC6946_SPI_FIELD(LTC6946_CS, LTC6946_x, field_val); // updates selected field
770 }
771 break;
772 } // end of switch statement
773 } // end if user_command != 0 statement
774 } // end while loop
775 } // end menu_3_RW_to_reg_field function
776
777 /* ------------------------------------------------------------------------- */
778 //! verifies reference frequency is within datasheet specifications
779 void LTC6946_Ref_Freq_Verification()
780 {
781 unsigned long temp_val, temp_fref_MHz, temp_fref_Hz;
782 boolean valid_input=false;
783
784 // USER INPUT
785 valid_input=false;
786
787
788 while (valid_input==false)
789 {
790 temp_fref_MHz=get_LTC6946_global_fref_MHz();
791 temp_fref_Hz=get_LTC6946_global_fref_Hz();
792 Serial.print(F("\nThe Reference frequency will be entered with 2 integers\n"));
793 Serial.print(F("1st number is the MHZ portion, the 2nd number is Hz portion\n"));
794 Serial.print(F(" - Example: A. 100\n"));
795 Serial.print(F(" B. 25\n"));
796 Serial.print(F(" equates to 100.000025MHZ\n\n"));
797 Serial.print(F("A. What is the MHz portion of the Reference Input Frequency(MHZ)? ["));
798 Serial.print(temp_fref_MHz);
799 Serial.print(F("]: "));
800 temp_val = read_float(); //! Reads the user command
801 // if user selects enter, keep same Fref. Otherwise set Fref and verify
802 if (temp_val!=0) temp_fref_MHz = abs(temp_val);
803 Serial.println(temp_fref_MHz);
804
805 Serial.print(F("B. What is the sub-MHz portion of the Reference Input Frequency(HZ)? "));
806 temp_val = read_float(); //! Reads the user command
807 temp_fref_Hz = abs(temp_val);
808 Serial.println(temp_fref_Hz);
809
810 // if valid input print the following to the screen
811 if (temp_fref_MHz >=LTC6946_MIN_REF_FREQ & temp_fref_MHz <= LTC6946_MAX_REF_FREQ)
812 {
813 set_LTC6946_global_fref(temp_fref_MHz,temp_fref_Hz);
814 temp_val= temp_fref_MHz*OneMHz + temp_fref_Hz;
815 Serial.print(F("Reference Frequency set to "));
816 Serial.print(temp_val);
817 Serial.println(F("Hz"));
818 valid_input=true;
819 }
820 else
821 {
822 Serial.print(F("Reference Frequency must be between 10MHz and 250MHz\n"));
823 } // end of if-else
824 } // end of while
825 } // end of LTC6946_Ref_Freq_Verification
826
827
828 /* ------------------------------------------------------------------------- */
829 //! verifies frf frequency is within datasheet specifications
830 void LTC6946_Fout_Freq_Verification(char part_version[])
831 {
832 unsigned long odiv, temp_fout_MHz, temp_fout_Hz, temp_val;
833 unsigned long frf[2];
834 boolean valid_input=false;
835
836 // USER INPUT
837 temp_fout_MHz=get_LTC6946_global_frf_MHz();
838 temp_fout_Hz=get_LTC6946_global_frf_Hz();
839
840 while (valid_input==false)
841 {
842 Serial.print(F("\nThe Output Frequency (Frf) will be entered with 2 integers\n"));
843 Serial.print(F("1st number is the MHZ portion, the 2nd number is Hz portion\n"));
844 Serial.print(F("C. What is the MHz portion of the Output Frequency(MHZ)? ["));
845 Serial.print(temp_fout_MHz);
846 Serial.print(F("]: "));
847 temp_val = read_int(); //! Reads the user command
848 // if user selects enter, keep same Fout. Otherwise set Fout and verify
849 if (temp_val!=0) temp_fout_MHz = abs(temp_val);
850 Serial.println(temp_fout_MHz);
851
852 Serial.print(F("D. What is the Hz portion of the Output Frequency(HZ)? "));
853 temp_val = read_int(); //! Reads the user command
854 temp_fout_Hz = abs(temp_val);
855 Serial.println(temp_fout_Hz);
856
857 HZto64(frf,temp_fout_MHz,temp_fout_Hz); // convert to 64 bit integer
858
859 // verify desired frequency falls within a divider range (1-6)
860 odiv = LTC6946_calc_odiv(part_version, frf);
861 valid_input=false;
862 if ((odiv>=1) && (odiv<=6)) valid_input=true;
863
864 // if valid input print the following to the screen
865 if (valid_input==true)
866 {
867 set_LTC6946_global_frf(temp_fout_MHz,temp_fout_Hz);
868 if (temp_fout_MHz < 4294)
869 {
870 temp_val= temp_fout_MHz*OneMHz + temp_fout_Hz;
871 Serial.print(F("Desired Output Frequency is "));
872 Serial.print(temp_val);
873 Serial.println(F("Hz"));
874 }
875 else // over flow condition
876 {
877 Serial.print(F("Desired Output Frequency is "));
878 Serial.print(temp_fout_MHz);
879 Serial.print(F("MHz + "));
880 Serial.print(temp_fout_Hz);
881 Serial.println(F("Hz"));
882 }
883 }
884 // if invalid input print the following to the screen
885 else
886 {
887 Serial.println(F("Invalid Fout frequency chosen"));
888 } // end of if/else (valid_input==true)
889 } // end of while(valid_input=false)
890 } // end of Fout_Freq_Verification
891
892
893 /* ------------------------------------------------------------------------- */
894 //! Menu 4: Calculates and programs OD, ND based on desired Frf
895 //! This function calculates and programs OD, ND based on desired Frf,
896 //! the reference frequency, and current RD value.
897 //! Linduino One (Arduino Uno) are limited to 32 bit floats, int and doubles.
898 //! Significant rounding errors are created with this 32 bit limitation. Therefore,
899 //! This function uses 64bit math functions specifically created to overcome this limitation.
900 //! After OD, ND are programmed, the program calibrates the LTC6946
901 //! If RD needs to change see menu 2 or menu 3
902 //! @return void
903 void menu_4_set_frf()
904 {
905 Serial.print(F("\nThis function calculates and programs OD and ND\n"));
906 Serial.print(F("based on the value input for Frf and Fref. It then calibrates the part.\n"));
907 Serial.print(F("It assumes all other register settings are correct\n"));
908 Serial.print(F("The PLLWizard tool can verify the correctness of the other register settings.\n"));
909
910 LTC6946_Ref_Freq_Verification();
911 LTC6946_Fout_Freq_Verification(demo_board.product_name);
912 LTC6946_set_frf(demo_board.product_name);
913 }
914
915 /* ------------------------------------------------------------------------- */
916 //! Store PLL settings to nonvolatile EEPROM on demo board
917 //! @return void
918 void menu_5_store_settings()
919 {
920 // Store the PLL Settings to the EEPROM
921 uint8_t regval;
922
923 uint8_t addr_offset;
924 uint8_t num_reg;
925
926 addr_offset=2;
927 num_reg = get_LTC6946_REGSIZE();
928
929 eeprom_write_int16(EEPROM_I2C_ADDRESS, EEPROM_CAL_KEY, EEPROM_CAL_STATUS_ADDRESS); // Cal key
930
931 for (uint8_t i = 0; i <= num_reg ; i++)
932 {
933 regval = LTC6946_read(LTC6946_CS,i);
934 eeprom_write_byte(EEPROM_I2C_ADDRESS,(char) regval, EEPROM_CAL_STATUS_ADDRESS+ i+addr_offset);
935 }
936 Serial.println(F("PLL Settings Stored to EEPROM"));
937
938 }
939
940
941 /* ------------------------------------------------------------------------- */
942 //! Read stored PLL settings from nonvolatile EEPROM on demo board
943 //! @return void
944 void menu_6_restore_settings()
945 {
946 // Read the PLL settings from EEPROM
947 int16_t cal_key;
948 uint8_t regval;
949 uint8_t user_address;
950
951 uint8_t addr_offset;
952 uint8_t num_reg;
953
954 addr_offset=2;
955 num_reg = get_LTC6946_REGSIZE();
956
957 // read the cal key from the EEPROM
958 eeprom_read_int16(EEPROM_I2C_ADDRESS, &cal_key, EEPROM_CAL_STATUS_ADDRESS);
959 if (cal_key == EEPROM_CAL_KEY)
960 {
961 // PLL Settings has been stored, read PLL Settings
962 user_address=2;
963 for (uint8_t i = 0; i <= num_reg ; i++)
964 {
965 eeprom_read_byte(EEPROM_I2C_ADDRESS,(char *) &regval, EEPROM_CAL_STATUS_ADDRESS + i+addr_offset);
966 LTC6946_write(LTC6946_CS, (uint8_t)i, regval);
967 user_address++;
968 }
969 Serial.println(F("PLL Settings Restored"));
970 }
971 else
972 {
973 Serial.println(F("PLL Settings not found"));
974 }
975
976 }
977
978 /* ------------------------------------------------------------------------- */
979 //! Prints the title block when program first starts.
980 void print_title()
981 {
982
983 Serial.println(F("*****************************************************************"));
984 Serial.println(F("* DC1705 Demonstration Program *"));
985 Serial.println(F("* *"));
986 Serial.println(F("* This program demonstrates how to send data to the LTC6946 *"));
987 Serial.println(F("* Ultra Low Noise & Spurious IntegerN Synthesizer with *"));
988 Serial.println(F("* Integrated VCO. *"));
989 Serial.println(F("* Set the baud rate to 115200 and select the newline terminator.*"));
990 Serial.println(F("* *"));
991 Serial.println(F("* For loop filter design please use the PLL Wizard software. *"));
992 Serial.println(F("* - It is recommended to use Pll Wizard to determine the *"));
993 Serial.println(F("* correct SPI register values for the initial setup. These *"));
994 Serial.println(F("* values can be entered into this program via menu option 2 *"));
995 Serial.println(F("* below. These values can then be stored and recalled from the *"));
996 Serial.println(F("* DC1705 EEPROM using options 5 and 6 below. *"));
997 Serial.println(F("*****************************************************************"));
998 Serial.println();
999 } // end of print_title
1000
1001
1002 /* ------------------------------------------------------------------------- */
1003 //! Prints main menu.
1004 void print_prompt()
1005 {
1006
1007 Serial.println(F("\nCommand Summary:"));
1008 Serial.println(F(" 1-Load Default Settings (same as the PLL Wizard's DC1705-x(LTC6946-x)100MHz.pllset settings)"));
1009 Serial.println(F(" 2-READ/WRITE to Registers Addresses"));
1010 Serial.println(F(" 3-READ/WRITE to Registers Fields"));
1011 Serial.println(F(" 4-Set Output Frequency (Frf)"));
1012 Serial.println(F(" 5-Store LTC6946 SPI settings to the DC1705's EEPROM"));
1013 Serial.println(F(" 6-Restore LTC6946 SPI settings from the DC1705's EEPROM"));
1014 Serial.println("");
1015 Serial.print(F("Enter a command: "));
1016 } // end of print_prompt
1017
1018
demo_board
struct demo_board_type demo_board
Instantiate demo board structure.
Definition: QuikEval_EEPROM.cpp:71
LTC6946_THI
#define LTC6946_THI
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:118
LTC6946_MIN_REF_FREQ
#define LTC6946_MIN_REF_FREQ
LTC6946 lower reference frequency limit.
Definition: LTC6946.h:144
menu_3_RW_to_reg_field
static void menu_3_RW_to_reg_field()
Menu 3: Reads and/or Writes individual SPI fields This function provides the user with a list of all ...
Definition: DC1705C.ino:367
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
LTC6946_MAX_REF_FREQ
#define LTC6946_MAX_REF_FREQ
LTC6946 upper reference frequency limit.
Definition: LTC6946.h:145
user_command
unsigned char user_command
Definition: Serial_EEPROM_Test.ino:75
get_LTC6946_global_fref_MHz
unsigned long get_LTC6946_global_fref_MHz()
returns global LTC6946_Fref_MHz
Definition: LTC6946.cpp:484
loop
static void loop()
Repeats Linduino loop.
Definition: DC1705C.ino:155
EEPROM_I2C_ADDRESS
#define EEPROM_I2C_ADDRESS
Definition: QuikEval_EEPROM.h:60
eeprom_write_byte
uint8_t eeprom_write_byte(uint8_t i2c_address, char data, uint16_t address)
Write the data byte to the EEPROM with i2c_address starting at EEPROM address.
Definition: QuikEval_EEPROM.cpp:214
demo_board_type::name
char name[15]
Demo Circuit number (DC1678)
Definition: QuikEval_EEPROM.h:71
LTC6946_init
void LTC6946_init()
Initializes the SPI MAP arrays The values set in initialization are used all the LTC6946 SPI/WRITE an...
Definition: LTC6946.cpp:299
First_Run
static uint8_t First_Run
if first time through loop = 0, otherwise=1
Definition: DC1705C.ino:122
LTC6946_TLO
#define LTC6946_TLO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:119
LTC6946_CPINV
#define LTC6946_CPINV
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:94
Linduino.h
Header File for Linduino Libraries and Demo Code.
LTC6946_CP
#define LTC6946_CP
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:90
LTC6946_RD
#define LTC6946_RD
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:115
LTC6946_REV
#define LTC6946_REV
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:116
LTC6946_ALCULOK
#define LTC6946_ALCULOK
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:86
menu_4_set_frf
static void menu_4_set_frf()
Menu 4: Calculates and programs OD, ND based on desired Frf This function calculates and programs OD...
Definition: DC1705C.ino:903
OneMHz
#define OneMHz
1MHz in long format, used in 64 bit math
Definition: LTC6945.h:121
LTC6946_CS
#define LTC6946_CS
Define the SPI CS pin.
Definition: LTC6946.h:76
LTC6946_PDOUT
#define LTC6946_PDOUT
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:110
HZto64
void HZto64(unsigned long an[], unsigned long MHzPart, unsigned long HzPart)
create a 64 bit Hz number from 32 bit xxxx MHz number and 32 bit yyy yyy Hz number.
Definition: LTC6945.cpp:729
menu_6_restore_settings
static void menu_6_restore_settings()
Read stored PLL settings from nonvolatile EEPROM on demo board.
Definition: DC1705C.ino:944
demo_board_connected
static int8_t demo_board_connected
Demo Board Name stored in QuikEval EEPROM.
Definition: DC1705C.ino:121
setup
static void setup()
Initialize Linduino.
Definition: DC1705C.ino:128
print_prompt
static void print_prompt()
Prints main menu.
Definition: DC1705C.ino:1004
LTC6946_BD
#define LTC6946_BD
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:87
LTC6946_OD
#define LTC6946_OD
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:106
LTC6946_Fout_Freq_Verification
static void LTC6946_Fout_Freq_Verification(char part_version[])
verifies frf frequency is within datasheet specifications
Definition: DC1705C.ino:830
LTC6946_ALCMON
#define LTC6946_ALCMON
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:85
data
union LT_union_int32_4bytes data
Definition: DC2094A.ino:138
LTC6946_CPWIDE
#define LTC6946_CPWIDE
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:98
get_LTC6946_SPI_FIELD_NUMBITS
uint8_t get_LTC6946_SPI_FIELD_NUMBITS(uint8_t f)
returns the number of bits for a given field name in the SPI map
Definition: LTC6946.cpp:242
set_LTC6946_ALLREGS
void set_LTC6946_ALLREGS(uint8_t cs, uint8_t reg01, uint8_t reg02, uint8_t reg03, uint8_t reg04, uint8_t reg05, uint8_t reg06, uint8_t reg07, uint8_t reg08, uint8_t reg09, uint8_t reg0A)
Writes values to ALL LTC6946 RW address.
Definition: LTC6946.cpp:275
LTC6946_MTCAL
#define LTC6946_MTCAL
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:104
menu_2_RW_to_reg_addresss
static void menu_2_RW_to_reg_addresss()
Menu 2: Reads and/or Writes the SPI register address This function reads and displays all SPI registe...
Definition: DC1705C.ino:252
LTC6946_ALCLO
#define LTC6946_ALCLO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:84
get_LTC6946_global_fref_Hz
unsigned long get_LTC6946_global_fref_Hz()
returns global LTC6946_Fref_Hz
Definition: LTC6946.cpp:489
LTC6946_PDVCO
#define LTC6946_PDVCO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:113
LTC6946_LKEN
#define LTC6946_LKEN
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:101
menu_1_load_default_settings
static void menu_1_load_default_settings()
Menu 1: Load Default SPI Register Settings This function identifies which of the 4 LTC6946 frequency ...
Definition: DC1705C.ino:216
LTC6946_FILT
#define LTC6946_FILT
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:99
LTC6946_ALCHI
#define LTC6946_ALCHI
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:83
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
LTC6946_calc_odiv
unsigned long LTC6946_calc_odiv(char part_version[], unsigned long frf[2])
calculates the output divider setting based on the frf and version of LTC6946
Definition: LTC6946.cpp:510
eeprom_read_byte
uint8_t eeprom_read_byte(uint8_t i2c_address, char *data, uint16_t address)
Read a data byte at address from the EEPROM with i2c_address.
Definition: QuikEval_EEPROM.cpp:282
menu_5_store_settings
static void menu_5_store_settings()
Store PLL settings to nonvolatile EEPROM on demo board.
Definition: DC1705C.ino:918
QuikEval_EEPROM.h
QuikEval EEPROM Library.
set_LTC6946_SPI_FIELD
void set_LTC6946_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
Sets the LTC6946 SPI field value calls function LTC6946_read_field, which reads specific address/fiel...
Definition: LTC6946.cpp:265
LTC6946_CPRST
#define LTC6946_CPRST
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:96
get_LTC6946_REGSIZE
uint8_t get_LTC6946_REGSIZE()
returns # of addresses in parts register map (array size)
Definition: LTC6946.cpp:232
quikeval_SPI_init
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
Definition: LT_SPI.cpp:151
LTC6946_PDREFO
#define LTC6946_PDREFO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:112
EEPROM_CAL_STATUS_ADDRESS
#define EEPROM_CAL_STATUS_ADDRESS
Definition: QuikEval_EEPROM.h:58
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
LTC6946_BST
#define LTC6946_BST
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:88
LTC6946_write
void LTC6946_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6946 Write Single Address writes 8 bit Data field to LTC6946.
Definition: LTC6946.cpp:165
LTC6946_CAL
#define LTC6946_CAL
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:89
LTC6946_LOCK
#define LTC6946_LOCK
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:103
LT_SPI.h
LT_SPI: Routines to communicate with ATmega328P&#39;s hardware SPI port.
LTC6946.h
LTC6946: Ultralow Noise and Spurious 0.37GHz to 6.39GHz Integer-N Synthesizer with Integrated VCO...
LTC6946_PDALL
#define LTC6946_PDALL
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:109
LT_I2C.h
LT_I2C: Routines to communicate with ATmega328P&#39;s hardware I2C port.
LTC6946_ALCCAL
#define LTC6946_ALCCAL
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:81
get_LTC6946_global_frf_MHz
unsigned long get_LTC6946_global_frf_MHz()
returns global LTC6946_Frf_MHz
Definition: LTC6946.cpp:494
LTC6946_RFO
#define LTC6946_RFO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:117
demo_name
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
Definition: DC1880A.ino:97
ref_out
static uint8_t ref_out
Used to keep track of reference out status.
Definition: DC1705C.ino:120
LTC6946_set_frf
void LTC6946_set_frf(char part_version[])
FUNCTION: LTC6946_set_frf Calculates the integer (N), fractional (NUM) and output divider (OD) SPI va...
Definition: LTC6946.cpp:609
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
field_menu_RW
long field_menu_RW(long field_val, char field_name[], uint8_t f)
Support function for function menu_3_RW_to_reg_field displays current state of select field provides ...
Definition: DC1705C.ino:307
read_float
float read_float()
Definition: UserInterface.cpp:78
LTC6946_ALCEN
#define LTC6946_ALCEN
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:82
LTC6946_UNLOK
#define LTC6946_UNLOK
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:120
demo_board_type::product_name
char product_name[15]
LTC Product (LTC2654-L16)
Definition: QuikEval_EEPROM.h:70
set_LTC6946_global_frf
void set_LTC6946_global_frf(unsigned long frf_MHz, unsigned long frf_Hz)
sets globals LTC6946_Frf_MHz and LTC6946_Frf_Hz
Definition: LTC6946.cpp:478
LTC6946_LKWIN
#define LTC6946_LKWIN
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:102
LTC6946_PDPLL
#define LTC6946_PDPLL
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:111
get_LTC6946_global_frf_Hz
unsigned long get_LTC6946_global_frf_Hz()
returns global LTC6946_Frf_Hz
Definition: LTC6946.cpp:499
LTC6946_LKCT
#define LTC6946_LKCT
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:100
quikeval_I2C_init
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
Definition: LT_I2C.cpp:394
LTC6946_CPUP
#define LTC6946_CPUP
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:97
i
static int i
Definition: DC2430A.ino:184
LTC6946_OMUTE
#define LTC6946_OMUTE
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:107
LTC6946_CPCHI
#define LTC6946_CPCHI
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:91
LTC6946_read
uint8_t LTC6946_read(uint8_t cs, int8_t address)
LTC6946 Read Single Address reads 8 bit Data field to LTC6946.
Definition: LTC6946.cpp:98
LTC6946_x
#define LTC6946_x
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:121
get_LTC6946_SPI_FIELD_RW
uint8_t get_LTC6946_SPI_FIELD_RW(uint8_t f)
returns if the given field name is (0)read/write or (1)read_only field
Definition: LTC6946.cpp:252
LTC6946_PART
#define LTC6946_PART
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:108
LTC6946_POR
#define LTC6946_POR
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:114
LTC6946_CPDN
#define LTC6946_CPDN
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:93
EEPROM_CAL_KEY
#define EEPROM_CAL_KEY
Definition: QuikEval_EEPROM.h:59
get_LTC6946_SPI_FIELD
long get_LTC6946_SPI_FIELD(uint8_t cs, uint8_t f)
Gets the LTC6946 SPI field value calls function LTC6946_read_field, which reads specific address loca...
Definition: LTC6946.cpp:154
LTC6946_CPCLO
#define LTC6946_CPCLO
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:92
LTC6946_Ref_Freq_Verification
static void LTC6946_Ref_Freq_Verification()
verifies reference frequency is within datasheet specifications
Definition: DC1705C.ino:779
print_title
static void print_title()
Prints the title block when program first starts.
Definition: DC1705C.ino:980
LTC6946_ND
#define LTC6946_ND
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:105
set_LTC6946_global_fref
void set_LTC6946_global_fref(unsigned long fref_MHz, unsigned long fref_Hz)
sets globals LTC6946_Fref_MHz and LTC6946_Fref_Hz
Definition: LTC6946.cpp:472
LTC6946_CPMID
#define LTC6946_CPMID
for spi_map array, defines location for field specific information used to create the spi map ...
Definition: LTC6946.h:95