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(
"\nDC2610 FOUND ON DC2430 SITE "));
197 Serial.println(site_select);
204 Serial.print(F(
"\nDC2610 NOT FOUND ON DC2430 SITE "));
205 Serial.print(site_select);
209 while (site_select<8);
215 Serial.println(F(
"\n\nConnect DC2610 demo board to DC2430, then press the reset button."));
222 Serial.println(F(
"DC2610A 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 LTC6953 Configuration *****************"));
318 Serial.println(F(
"\n*****************************************************************"));
321 Serial.print(F(
"1- LTC6953 Front Page Datasheet Application\n"));
322 Serial.print(F(
"2- LTC6953 All output div 1\n"));
323 Serial.println(F(
"0 - Return to Main Menu\n"));
325 Serial.println(F(
"Load LTC6953 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 36-MD10 71-PDALL\n"));
482 Serial.print(F(
" 2-ADEL1 37-MODE0 72-PDVCOPK\n"));
483 Serial.print(F(
" 3-ADEL2 38-MODE1 73-PD10\n"));
484 Serial.print(F(
" 4-ADEL3 39-MODE2 74-PD9\n"));
485 Serial.print(F(
" 5-ADEL4 40-MODE3 75-PD8\n"));
486 Serial.print(F(
" 6-ADEL5 41-MODE4 76-PD7\n"));
487 Serial.print(F(
" 7-ADEL6 42-MODE5 77-PD6\n"));
488 Serial.print(F(
" 8-ADEL7 43-MODE6 78-PD5\n"));
489 Serial.print(F(
" 9-ADEL8 44-MODE7 79-PD4\n"));
490 Serial.print(F(
" 10-ADEL9 45-MODE8 80-PD3\n"));
491 Serial.print(F(
" 11-ADEL10 46-MODE9 81-PD2\n"));
492 Serial.print(F(
" 12-DDEL0 47-MODE10 82-PD1\n"));
493 Serial.print(F(
" 13-DDEL1 48-MP0 83-PD0\n"));
494 Serial.print(F(
" 14-DDEL2 49-MP1 84-POR\n"));
495 Serial.print(F(
" 15-DDEL3 50-MP2 85-REV\n"));
496 Serial.print(F(
" 16-DDEL4 51-MP3 86-SYSCT\n"));
497 Serial.print(F(
" 17-DDEL5 52-MP4 87-SRQMD\n"));
498 Serial.print(F(
" 18-DDEL6 53-MP5 88-SSRQ\n"));
499 Serial.print(F(
" 19-DDEL7 54-MP6 89-SRQEN0\n"));
500 Serial.print(F(
" 20-DDEL8 55-MP7 90-SRQEN1\n"));
501 Serial.print(F(
" 21-DDEL9 56-MP8 91-SRQEN2\n"));
502 Serial.print(F(
" 22-DDEL10 57-MP9 92-SRQEN3\n"));
503 Serial.print(F(
" 23-EZMD 58-MP10 93-SRQEN4\n"));
504 Serial.print(F(
" 24-FILTV 59-OINV0 94-SRQEN5\n"));
505 Serial.print(F(
" 25-INVSTAT 60-OINV1 95-SRQEN6\n"));
506 Serial.print(F(
" 26-MD0 61-OINV2 96-SRQEN7\n"));
507 Serial.print(F(
" 27-MD1 62-OINV3 97-SRQEN8\n"));
508 Serial.print(F(
" 28-MD2 63-OINV4 98-SRQEN9\n"));
509 Serial.print(F(
" 29-MD3 64-OINV5 99-SRQEN10\n"));
510 Serial.print(F(
" 30-MD4 65-OINV6 100-TEMPO\n"));
511 Serial.print(F(
" 31-MD5 66-OINV7 101-!VCOOK\n"));
512 Serial.print(F(
" 32-MD6 67-OINV8 102-VCOOK\n"));
513 Serial.print(F(
" 33-MD7 68-OINV9 103-x\n"));
514 Serial.print(F(
" 34-MD8 69-OINV10 \n"));
515 Serial.print(F(
" 35-MD9 70-PART \n"));
518 Serial.print(F(
"0 - Return to Main Menu\n"));
519 Serial.print(F(
"* = READ ONLY FIELD\n\n"));
521 Serial.print(F(
"Enter a command (1-105 to modify register, or '0' to return to Main Menu): "));
523 Serial.println(field_num);
560 for (uint8_t
i = 0;
i <= num_reg ;
i++)
565 Serial.println(F(
"PLL Settings Stored to EEPROM"));
577 uint8_t user_address;
593 for (uint8_t
i = 0;
i <= num_reg ;
i++)
599 Serial.println(F(
"LTC6953 Settings Restored"));
601 Serial.println(F(
"Syncs LTC6953 OUTPUTS"));
607 Serial.println(F(
"PLL Settings not found"));
632 Serial.println(F(
"\nCommand Summary:"));
635 Serial.println(F(
" 1-8MHz NOT Available with DC2430"));
639 Serial.println(F(
" 1-SPI Clock = 8MHz"));
641 Serial.println(F(
" 2-SPI Clock = 4MHz"));
642 Serial.println(F(
" 3-SPI Clock = 2MHz"));
643 Serial.println(F(
" 4-SPI Clock = 1MHz"));
644 Serial.println(F(
" 5-SPI Clock = 500kHz"));
646 Serial.print(F(
"Enter a command: "));
654 Serial.println(F(
"incorrect option"));
679 Serial.println(F(
"Incorrect Option"));
692 Serial.println(F(
"\nCommand Summary:"));
693 Serial.println(F(
" 0-Site 0"));
694 Serial.println(F(
" 1-Site 1"));
695 Serial.println(F(
" 2-Site 2"));
696 Serial.println(F(
" 3-Site 3"));
697 Serial.println(F(
" 4-Site 4"));
698 Serial.println(F(
" 5-Site 5"));
699 Serial.println(F(
" 6-Site 6"));
700 Serial.println(F(
" 7-Site 7"));
703 Serial.print(F(
"Enter a command: "));
765 Serial.println(F(
"Incorrect Option"));
775 Serial.println(F(
"\n*****************************************************************"));
776 Serial.println(F(
"* DC2610 Demonstration Program *"));
777 Serial.println(F(
"* - Input Voltage 3.3V (J30/J31) *"));
778 Serial.println(F(
"* *"));
779 Serial.println(F(
"* This program demonstrates how to send data to the LTC6953 *"));
780 Serial.println(F(
"* Ultra-Low Jitter, JESD204B Clock Distributor with Eleven *"));
781 Serial.println(F(
"* Programmable Outputs. *"));
782 Serial.println(F(
"* *"));
783 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
784 Serial.println(F(
"* *"));
785 Serial.println(F(
"* Recommendations on how to best use LTC6952Wizard and DC2610 *"));
786 Serial.println(F(
"* Linduino code together *"));
787 Serial.println(F(
"* Use LTC6952Wizard to *"));
788 Serial.println(F(
"* - determine best SPI register values for specific *"));
789 Serial.println(F(
"* frequenices and Sync Methods for all settings *"));
790 Serial.println(F(
"* - Simulate LTC6953 Phase noise and Time Domain response *"));
791 Serial.println(F(
"* - initial engineering evaluation *"));
792 Serial.println(F(
"* use DC2610 Linduino code *"));
793 Serial.println(F(
"* - Create a look up table of the SPI register values created *"));
794 Serial.println(F(
"* from LTC6952Wizard (option 1) *"));
795 Serial.println(F(
"* - Software development for reading and writing to specific *"));
796 Serial.println(F(
"* register/address (option 2 & 3) *"));
797 Serial.println(F(
"* - Storing demo board settings on the demo board EEPROM *"));
798 Serial.println(F(
"* - starting place to use the DC2610 with the DC2430 *"));
799 Serial.println(F(
"*****************************************************************"));
809 Serial.println(F(
"\nCommand Summary:"));
810 Serial.println(F(
" 1-Load Default Settings from a Look-up Table"));
811 Serial.println(F(
" 2-READ/WRITE to Registers Addresses"));
812 Serial.println(F(
" 3-READ/WRITE to Registers Fields"));
813 Serial.println(F(
" 4-Store LTC6953 SPI settings to the DC2610's EEPROM"));
814 Serial.println(F(
" 5-Restore LTC6953 SPI settings from the DC2610's EEPROM"));
815 Serial.println(F(
" 6-Adjust SPI frequency"));
818 Serial.println(F(
" 7-DC2430 Site Selector"));
821 Serial.print(F(
"Enter a command: "));
static int dc2430_site_DA2_Pin
DC2430 digital pin allows Linduino to control which DC2430 site is selected.
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.
#define LTC6953_SSRQ
for spi_map array, defines location for field specific information used to create the spi map ...
unsigned char user_command
boolean Using_DC2430
Indicator if DC2430 (Linduino Expander) is connected.
static void menu_4_store_settings()
Store PLL settings to nonvolatile EEPROM on demo board.
#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.
LTC6953: Ultra-Low Jitter, JESD204B Clock Distributor with Eleven Programmable Outputs.
uint8_t get_LTC6953_SPI_FIELD_RW(uint8_t f)
returns if the given field name is (0)read/write or (1)read_only field
static void dc2430_site_select(int site_select)
Called from function menu_8_DC2430_site_select(), programs DC2430 to site selected.
Header File for Linduino Libraries and Demo Code.
static void print_prompt()
Prints main menu.
static int8_t DC2610_board_connected
Demo Board Name stored in QuikEval EEPROM.
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 ...
void set_LTC6953_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
Sets the LTC6953 SPI field value calls function LTC6953_read_field, which reads specific address/fiel...
void spi_enable(uint8_t spi_clock_divider)
Setup the processor for hardware SPI communication.
long get_LTC6953_SPI_FIELD(uint8_t cs, uint8_t f)
Gets the LTC6953 SPI field value calls function LTC6953_read_field, which reads specific address loca...
void LTC6953_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6953 Write Single Address writes 8 bit Data field to LTC6953.
union LT_union_int32_4bytes data
static uint8_t First_Run
if first time through loop = 0, otherwise=1
static void menu_6_SPI_speed()
Read stored PLL settings from nonvolatile EEPROM on demo board.
static int dc2430_site_DA0_Pin
DC2430 digital pin allows Linduino to control which DC2430 site is selected.
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...
static void loop()
Repeats Linduino loop.
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_A1_APin
DC2430 resistor tree, if it reads 1.66V then DC2430 connected.
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...
void set_LTC6953_REGS_lkup_tbl(uint8_t lkup_tbl_row)
Writes values to ALL LTC6953 RW addresses from a look-up table.
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.
static int dc2430_site_DA1_Pin
DC2430 digital pin allows Linduino to control which DC2430 site is selected.
static void menu_7_DC2430_site_select()
Read stored PLL settings from nonvolatile EEPROM on demo board.
static int8_t demo_board_connected
Demo Board Name stored in QuikEval EEPROM.
static int dc2430_en_Pin
DC2430 digital pin enables Linduino to control which DC2430 site is selected & turns on DC2430 LED...
static void menu_5_restore_settings()
Read stored PLL settings from nonvolatile EEPROM on demo board.
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.
static void print_title()
Prints the title block when program first starts.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
uint8_t get_LTC6953_SPI_FIELD_NUMBITS(uint8_t f)
returns the number of bits for a given field name in the SPI map
void LTC6953_init()
Initializes the SPI MAP arrays The values set in initialization are used for all the LTC6953 SPI/WRIT...
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
static void setup()
Initialize Linduino.
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
static int dc2430_site_A0_APin
DC2430 resistor tree, if it reads 3.3V then DC2430 connected.
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
#define LTC6953_CS
Define the SPI CS pin.
uint8_t get_LTC6953_REGSIZE()
returns # of addresses in parts register map (array size)
int8_t discover_demo_board_local(char *demo_name)
Read the ID string from the EEPROM and determine if any demo board is connected.
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 DUTsync(uint16_t delay_num)
Syncs LTC6953 Outputs using SSYNC bit.
uint8_t LTC6953_read(uint8_t cs, int8_t address)
LTC6953 Read Single Address reads 8 bit Data field to LTC6953.
static int dc2430_site_A2_APin
DC2430 INFO ONLY, measures DC2226 (Linduino) VCCIO voltage.