138 float dc2430_A0_fval=0;
139 float dc2430_A1_fval=0;
140 float dc2430_A2_fval=0;
142 Serial.println(F(
"--- start ---"));
149 Serial.begin(115200);
158 dc2430_A0_fval = (5.0*dc2430_A0_val)/1023;
161 dc2430_A1_fval = (5.0*dc2430_A1_val)/1023;
165 if ((dc2430_A0_fval>3.0) && (dc2430_A0_fval<3.6) && (dc2430_A1_fval>1.5) && (dc2430_A1_fval<1.8))
167 Serial.println(F(
"--- DC2430 Connected ---"));
185 Serial.println(F(
"\n********************************************************"));
191 dc2430_A2_fval = (5.0*dc2430_A2_val)/1023;
192 Serial.print(F(
"Linduino's JP3 VCCIO voltage = "));
193 Serial.println(dc2430_A2_fval);
195 Serial.println(F(
"Linduino's SPI Frequency = 4MHz, max DC2430 SPI speed"));
196 Serial.print(F(
"\nDC2609 FOUND ON DC2430 SITE "));
197 Serial.println(site_select);
204 Serial.print(F(
"\nDC2609 NOT FOUND ON DC2430 SITE "));
205 Serial.print(site_select);
209 while (site_select<8);
215 Serial.println(F(
"\n\nConnect DC2609 demo board to DC2430, then press the reset button."));
222 Serial.println(F(
"DC2609A CONNECTED TO LINDUINO"));
226 Serial.println(F(
"Linduino's SPI Frequency = 8MHz, max speed"));
245 if (Serial.available())
253 if (user_command !=
'm')
254 Serial.println(user_command);
256 switch (user_command)
288 Serial.println(F(
"Incorrect Option"));
291 Serial.println(F(
"\n*****************************************************************"));
314 while (field_num != 0)
316 Serial.print(F(
"\n*****************************************************************"));
317 Serial.print(F(
"\n************* Select LTC6952 Configuration *****************"));
318 Serial.println(F(
"\n*****************************************************************"));
321 Serial.print(F(
"1- LTC6952 Front Page Datasheet Application\n"));
322 Serial.print(F(
"2- LTC6952 All output div 1\n"));
323 Serial.println(F(
"0 - Return to Main Menu\n"));
325 Serial.println(F(
"Load LTC6952 register settings from a look up table (Settings created from LTC6952Wizard)"));
326 Serial.println(F(
"Enter a command (1-2), or '0' to return to Main Menu): "));
328 Serial.println(field_num);
333 field_num=field_num-1;
335 field_num=field_num+1;
357 uint8_t
i, regval, user_regval, num_reg;
358 uint16_t user_address;
363 while (user_address != 0)
365 Serial.println(F(
"\n*****************************************************************"));
367 for (i=0; i<num_reg; i++)
372 Serial.print(F(
"- ADDR0"));
374 Serial.print(F(
"- ADDR"));
375 Serial.print(i, HEX);
376 Serial.print(F(
" = 0x"));
377 if (regval<16) Serial.print(F(
"0"));
378 Serial.print(regval, HEX);
379 if (i==2) Serial.print(F(
" (warning: if D0=1 it resets all registers. POR Bit)"));
380 if ((i==0)||(i==(num_reg-1))) Serial.print(F(
" (read only) "));
381 if (i<4||(i==(num_reg-1))) Serial.println(
"");
382 else if ((i%2) == 1) Serial.println(
"");
383 else Serial.print(
" ");
385 Serial.print(F(
"0 - Return to Main Menu\n\n"));
387 Serial.print(F(
"Enter a command (1-55 to modify register, or '0' to return to Main Menu): "));
389 Serial.println(user_address);
392 if (user_address >0 && user_address<(num_reg-1))
394 Serial.print(F(
"What value should ADDR"));
395 Serial.print(user_address);
396 Serial.print(F(
" be set to (ex: HEX format 0xff): "));
398 Serial.println(user_regval);
418 uint8_t field_size,
i;
419 long max_num=1, pow2=1;
421 Serial.print(
"CURRENT STATE (HEX): 0x");
422 Serial.println(field_val, HEX);
427 for (i=1; i<field_size; i++)
430 max_num=max_num + pow2;
433 Serial.print(
"Set Value or type '-1' to exit: (ex: HEX format 0x00 to 0x");
434 Serial.print(max_num, HEX);
438 if (usr_field_val>=0 && usr_field_val<=max_num)
440 Serial.println(usr_field_val);
441 return usr_field_val;
477 while (field_num != 0)
479 Serial.println(F(
"\n*****************************************************************"));
481 Serial.print(F(
" 1-ADEL0 43-MD4 85-PART\n"));
482 Serial.print(F(
" 2-ADEL1 44-MD5 86-PDALL\n"));
483 Serial.print(F(
" 3-ADEL2 45-MD6 87-PDPLL\n"));
484 Serial.print(F(
" 4-ADEL3 46-MD7 88-PDREFPK\n"));
485 Serial.print(F(
" 5-ADEL4 47-MD8 89-PDVCOPK\n"));
486 Serial.print(F(
" 6-ADEL5 48-MD9 90-PD10\n"));
487 Serial.print(F(
" 7-ADEL6 49-MD10 91-PD9\n"));
488 Serial.print(F(
" 8-ADEL7 50-MODE0 92-PD8\n"));
489 Serial.print(F(
" 9-ADEL8 51-MODE1 93-PD7\n"));
490 Serial.print(F(
" 10-ADEL9 52-MODE2 94-PD6\n"));
491 Serial.print(F(
" 11-ADEL10 53-MODE3 95-PD5\n"));
492 Serial.print(F(
" 12-BST 54-MODE4 96-PD4\n"));
493 Serial.print(F(
" 13-CP 55-MODE5 97-PD3\n"));
494 Serial.print(F(
" 14-CPDN 56-MODE6 98-PD2\n"));
495 Serial.print(F(
" 15-CPINV 57-MODE7 99-PD1\n"));
496 Serial.print(F(
" 16-CPMID 58-MODE8 100-PD0\n"));
497 Serial.print(F(
" 17-CPRST 59-MODE9 101-POR\n"));
498 Serial.print(F(
" 18-CPUP 60-MODE10 102-RAO\n"));
499 Serial.print(F(
" 19-CPWIDE 61-MP0 103-RD\n"));
500 Serial.print(F(
" 20-DDEL0 62-MP1 104-nREFOK\n"));
501 Serial.print(F(
" 21-DDEL1 63-MP2 105-REFOK\n"));
502 Serial.print(F(
" 22-DDEL2 64-MP3 106-REV\n"));
503 Serial.print(F(
" 23-DDEL3 65-MP4 107-SYSCT\n"));
504 Serial.print(F(
" 24-DDEL4 66-MP5 108-SRQMD\n"));
505 Serial.print(F(
" 25-DDEL5 67-MP6 109-SSRQ\n"));
506 Serial.print(F(
" 26-DDEL6 68-MP7 110-SRQEN0\n"));
507 Serial.print(F(
" 27-DDEL7 69-MP8 111-SRQEN1\n"));
508 Serial.print(F(
" 28-DDEL8 70-MP9 112-SRQEN2\n"));
509 Serial.print(F(
" 29-DDEL9 71-MP10 113-SRQEN3\n"));
510 Serial.print(F(
" 30-DDEL10 72-ND 114-SRQEN4\n"));
511 Serial.print(F(
" 31-EZMD 73-OINV0 115-SRQEN5\n"));
512 Serial.print(F(
" 32-FILTR 74-OINV1 116-SRQEN6\n"));
513 Serial.print(F(
" 33-FILTV 75-OINV2 117-SRQEN7\n"));
514 Serial.print(F(
" 34-INVSTAT 76-OINV3 118-SRQEN8\n"));
515 Serial.print(F(
" 35-LKCT 77-OINV4 119-SRQEN9\n"));
516 Serial.print(F(
" 36-LKWIN 78-OINV5 120-SRQEN10\n"));
517 Serial.print(F(
" 37-nLOCK 79-OINV6 121-TEMPO\n"));
518 Serial.print(F(
" 38-LOCK 80-OINV7 122-UNLOCK\n"));
519 Serial.print(F(
" 39-MD0 81-OINV8 123-nVCOOK\n"));
520 Serial.print(F(
" 40-MD1 82-OINV9 124-VCOOK\n"));
521 Serial.print(F(
" 41-MD2 83-OINV10 125-x\n"));
522 Serial.print(F(
" 42-MD3 84-PARSYNC\n"));
524 Serial.print(F(
"0 - Return to Main Menu\n"));
525 Serial.print(F(
"* = READ ONLY FIELD\n\n"));
527 Serial.print(F(
"Enter a command (1-125 to modify register, or '0' to return to Main Menu): "));
529 Serial.println(field_num);
566 for (uint8_t
i = 0;
i <= num_reg ;
i++)
571 Serial.println(F(
"PLL Settings Stored to EEPROM"));
583 uint8_t user_address;
599 for (uint8_t
i = 0;
i <= num_reg ;
i++)
605 Serial.println(F(
"LTC6952 Settings Restored"));
607 Serial.println(F(
"Syncs LTC6952 OUTPUTS"));
613 Serial.println(F(
"PLL Settings not found"));
638 Serial.println(F(
"\nCommand Summary:"));
641 Serial.println(F(
" 1-8MHz NOT Available with DC2430"));
645 Serial.println(F(
" 1-SPI Clock = 8MHz"));
647 Serial.println(F(
" 2-SPI Clock = 4MHz"));
648 Serial.println(F(
" 3-SPI Clock = 2MHz"));
649 Serial.println(F(
" 4-SPI Clock = 1MHz"));
650 Serial.println(F(
" 5-SPI Clock = 500kHz"));
652 Serial.print(F(
"Enter a command: "));
660 Serial.println(F(
"incorrect option"));
685 Serial.println(F(
"Incorrect Option"));
698 Serial.println(F(
"\nCommand Summary:"));
699 Serial.println(F(
" 0-Site 0"));
700 Serial.println(F(
" 1-Site 1"));
701 Serial.println(F(
" 2-Site 2"));
702 Serial.println(F(
" 3-Site 3"));
703 Serial.println(F(
" 4-Site 4"));
704 Serial.println(F(
" 5-Site 5"));
705 Serial.println(F(
" 6-Site 6"));
706 Serial.println(F(
" 7-Site 7"));
709 Serial.print(F(
"Enter a command: "));
771 Serial.println(F(
"Incorrect Option"));
781 Serial.println(F(
"\n*****************************************************************"));
782 Serial.println(F(
"* DC2609 Demonstration Program *"));
783 Serial.println(F(
"* - Input Voltage 4-6V (J32) *"));
784 Serial.println(F(
"* - Input Voltage 9-12V (J30) *"));
785 Serial.println(F(
"* *"));
786 Serial.println(F(
"* This program demonstrates how to send data to the LTC6952 *"));
787 Serial.println(F(
"* Ultralow Jitter, 4.5GHz PLL with 11 Outputs and JESD204B *"));
788 Serial.println(F(
"* Support. *"));
789 Serial.println(F(
"* *"));
790 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
791 Serial.println(F(
"* *"));
792 Serial.println(F(
"* Recommendations on how to best use LTC6952Wizard and DC2609 *"));
793 Serial.println(F(
"* Linduino code together *"));
794 Serial.println(F(
"* Use LTC6952Wizard to *"));
795 Serial.println(F(
"* - determine best SPI register values for specific *"));
796 Serial.println(F(
"* frequenices and Sync Methods for all settings *"));
797 Serial.println(F(
"* - Simulate LTC6952 Phase noise and Time Domain response *"));
798 Serial.println(F(
"* - initial engineering evaluation *"));
799 Serial.println(F(
"* use DC2609 Linduino code *"));
800 Serial.println(F(
"* - Create a look up table of the SPI register values created *"));
801 Serial.println(F(
"* from LTC6952Wizard (option 1) *"));
802 Serial.println(F(
"* - Software development for reading and writing to specific *"));
803 Serial.println(F(
"* register/address (option 2 & 3) *"));
804 Serial.println(F(
"* - Storing demo board settings on the demo board EEPROM *"));
805 Serial.println(F(
"* - starting place to use the DC2609 with the DC2430 *"));
806 Serial.println(F(
"*****************************************************************"));
816 Serial.println(F(
"\nCommand Summary:"));
817 Serial.println(F(
" 1-Load Default Settings from a Look-up Table"));
818 Serial.println(F(
" 2-READ/WRITE to Registers Addresses"));
819 Serial.println(F(
" 3-READ/WRITE to Registers Fields"));
820 Serial.println(F(
" 4-Store LTC6952 SPI settings to the DC2609's EEPROM"));
821 Serial.println(F(
" 5-Restore LTC6952 SPI settings from the DC2609's EEPROM"));
822 Serial.println(F(
" 6-Adjust SPI frequency"));
825 Serial.println(F(
" 7-DC2430 Site Selector"));
828 Serial.print(F(
"Enter a command: "));
static int8_t demo_board_connected
Demo Board Name stored in QuikEval EEPROM.
#define LTC6952_SSRQ
for spi_map array, defines location for field specific information used to create the spi map ...
static int dc2430_site_DA2_Pin
DC2430 digital pin allows Linduino to control which DC2430 site is selected.
static int dc2430_site_A1_APin
DC2430 resistor tree, if it reads 1.66V then DC2430 connected.
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.
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 ...
unsigned char user_command
#define EEPROM_I2C_ADDRESS
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.
static void setup()
Initialize Linduino.
uint8_t get_LTC6952_REGSIZE()
returns # of addresses in parts register map (array size)
static int dc2430_site_DA1_Pin
DC2430 digital pin allows Linduino to control which DC2430 site is selected.
void set_LTC6952_REGS_lkup_tbl(uint8_t lkup_tbl_row)
Writes values to ALL LTC6952 RW addresses from a look-up table.
void LTC6952_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6952 Write Single Address writes 8 bit Data field to LTC6952.
Header File for Linduino Libraries and Demo Code.
static int dc2430_en_Pin
DC2430 digital pin enables Linduino to control which DC2430 site is selected & turns on DC2430 LED...
uint8_t get_LTC6952_SPI_FIELD_NUMBITS(uint8_t f)
returns the number of bits for a given field name in the SPI map
void spi_enable(uint8_t spi_clock_divider)
Setup the processor for hardware SPI communication.
static void print_prompt()
Prints main menu.
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 ...
static void print_title()
Prints the title block when program first starts.
static void loop()
Repeats Linduino loop.
union LT_union_int32_4bytes data
uint8_t LTC6952_read(uint8_t cs, int8_t address)
LTC6952 Read Single Address reads 8 bit Data field to LTC6952.
void LTC6952_init()
Initializes the SPI MAP arrays The values set in initialization are used for all the LTC6952 SPI/WRIT...
LTC6952: Ultralow Jitter, 4.5GHz PLL with 11 Outputs and JESD204B Support.
static void dc2430_site_select(int site_select)
Called from function menu_8_DC2430_site_select(), programs DC2430 to site selected.
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.
static int dc2430_site_A0_APin
DC2430 resistor tree, if it reads 3.3V then DC2430 connected.
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.
boolean Using_DC2430
Indicator if DC2430 (Linduino Expander) is connected.
static int8_t DC2609_board_connected
Demo Board Name stored in QuikEval EEPROM.
static int dc2430_site_DA0_Pin
DC2430 digital pin allows Linduino to control which DC2430 site is selected.
uint8_t get_LTC6952_SPI_FIELD_RW(uint8_t f)
returns if the given field name is (0)read/write or (1)read_only field
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
#define EEPROM_CAL_STATUS_ADDRESS
int8_t discover_demo_board(char *demo_name)
Read the ID string from the EEPROM and determine if the correct board is connected.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
static void menu_1_load_default_settings()
Menu 1: Load Default SPI Register Settings This function loads the register settings from a look up t...
long get_LTC6952_SPI_FIELD(uint8_t cs, uint8_t f)
Gets the LTC6952 SPI field value calls function LTC6952_read_field, which reads specific address loca...
#define LTC6952_CS
Define the SPI CS pin.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
static void DUTsync(uint16_t delay_num)
Syncs LTC6952 Outputs using SSYNC bit.
static void menu_6_SPI_speed()
Read stored PLL settings from nonvolatile EEPROM on demo board.
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
void set_LTC6952_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
Sets the LTC6952 SPI field value calls function LTC6952_read_field, which reads specific address/fiel...
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
static void menu_5_restore_settings()
Read stored PLL settings from nonvolatile EEPROM on demo board.
int8_t discover_demo_board_local(char *demo_name)
Read the ID string from the EEPROM and determine if any demo board is connected.
static uint8_t First_Run
if first time through loop = 0, otherwise=1
static int dc2430_site_A2_APin
DC2430 INFO ONLY, measures DC2226 (Linduino) VCCIO voltage.
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...
static void menu_4_store_settings()
Store PLL settings to nonvolatile EEPROM on demo board.
static void menu_7_DC2430_site_select()
Read stored PLL settings from nonvolatile EEPROM on demo board.