| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

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