90 {0x05, 0xba, 0x00, 0x78, 0xb3, 0x04, 0x30, 0x07, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x92, 0x00, 0x11},
91 {0x05, 0xba, 0x00, 0x74, 0xa3, 0x04, 0x06, 0x07, 0x00, 0x12, 0x00, 0x92, 0x06, 0x92, 0x06, 0x92, 0x06, 0x92, 0x06, 0x11},
92 {0x05, 0xba, 0x00, 0x74, 0xa3, 0x04, 0x06, 0x07, 0x00, 0x12, 0x00, 0x92, 0x06, 0x92, 0x06, 0x92, 0x06, 0x92, 0x06, 0x11},
93 {0x05, 0xba, 0x00, 0x74, 0xa3, 0x04, 0x06, 0x07, 0x00, 0x12, 0xc0, 0x92, 0x06, 0x92, 0x06, 0x92, 0x06, 0x92, 0x06, 0x11},
94 {0x05, 0xba, 0x00, 0x78, 0xb3, 0x04, 0x32, 0x07, 0x00, 0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0x90, 0x00, 0x92, 0x00, 0x11},
95 {0x05, 0xba, 0x00, 0x74, 0x83, 0x04, 0x19, 0x07, 0x00, 0x10, 0x00, 0x90, 0x07, 0x90, 0x07, 0x90, 0x07, 0x92, 0x07, 0x11},
96 {0x05, 0xba, 0x00, 0x74, 0xa3, 0x04, 0x06, 0x07, 0x00, 0x12, 0x00, 0x90, 0x06, 0x90, 0x06, 0x90, 0x06, 0x92, 0x06, 0x11},
97 {0x05, 0xba, 0x00, 0x74, 0x83, 0x04, 0x19, 0x07, 0x00, 0x10, 0xc0, 0x90, 0x07, 0x90, 0x07, 0x90, 0x07, 0x92, 0x07, 0x11},
98 {0x00, 0xba, 0x00, 0x74, 0x93, 0x04, 0x14, 0x07, 0x00, 0x20, 0xc0, 0xd3, 0x05, 0x30, 0x00, 0xdb, 0x09, 0x95, 0x05, 0x00},
99 {0x00, 0xba, 0x00, 0x74, 0x93, 0x04, 0x14, 0x07, 0x00, 0x20, 0xc0, 0xd3, 0x05, 0x30, 0x00, 0xdb, 0x09, 0x9b, 0x09, 0x00}
110 int8_t address_shift;
113 address_shift =(address << 1) | 0x01;
130 int bit_shift,
i, num_reg;
131 long field_val, maskbits, pow2;
138 bit_shift = (MSB_loc+1)- (numbits-num_reg*8);
139 field_val=
LTC6951_read(cs, (address+num_reg))+(field_val<<8);
142 while ((bit_shift<0) && (num_reg<4));
147 for (i=1, maskbits=1; i<numbits; i++)
150 maskbits = maskbits+pow2;
153 field_val=(field_val >>bit_shift) &maskbits;
179 address=address << 1;
193 long current_content, desired_content, reg_val;
194 int LSB_loc,
i, j, num_reg, bit_shift;
197 for (i=0; i<32 ; i++) temp_arr[i]=0;
204 bit_shift=(MSB_loc+1)-(numbits-num_reg*8);
205 current_content=
LTC6951_read(cs, (address+num_reg)) + (current_content<<8);
209 while ((bit_shift<0) && (num_reg<4));
210 for (i=0; i<(8*num_reg); i++)
212 temp_arr[
i]=(current_content>>
i) & 1;
216 LSB_loc = 8*(num_reg-1)+MSB_loc-numbits+1;
217 for (i=LSB_loc, j=0; i<=(MSB_loc+(num_reg-1)*8); i++, j++)
219 temp_arr[
i] = (field_data>>j) &1;
224 for (i=0; i<(8*num_reg); i++)
226 desired_content = desired_content | (temp_arr[
i]<<
i);
230 for (i=0; i<num_reg; i++)
232 reg_val = (desired_content >> 8*(num_reg-1-
i)) & 0xff;
285 void set_LTC6951_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,
286 uint8_t reg08, uint8_t reg09, uint8_t reg0A, uint8_t reg0B, uint8_t reg0C, uint8_t reg0D, uint8_t reg0E, uint8_t reg0F,
287 uint8_t reg10, uint8_t reg11, uint8_t reg12)
324 uint8_t val_temp,
i, RAO_bit, AUTOCAL_bit, SN_bit, SR_bit;
325 uint8_t val_reg2, val_reg3, val_regA;
331 *rx = SPI.transfer(val_temp);
335 *rx = SPI.transfer(val_temp);
343 RAO_bit = (val_reg3 & 0x04)>>2;
344 AUTOCAL_bit = (val_reg3 & 0x08)>>3;
347 SN_bit = (val_regA & 0x80)>>7;
348 SR_bit = (val_regA & 0x40)>>6;
350 if ((RAO_bit ==1) || (AUTOCAL_bit ==0))
352 val_reg2 = val_reg2 | 0x01;
355 *rx = SPI.transfer(val_temp);
356 *rx = SPI.transfer(val_reg2);
370 if ((RAO_bit==0) || ((RAO_bit == 1) && ((SN_bit+SR_bit)==0)))
372 val_reg2 = val_reg2 | 0x04;
375 *rx = SPI.transfer(val_temp);
376 *rx = SPI.transfer(val_reg2);
380 val_reg2 = val_reg2 - 0x04;
383 *rx = SPI.transfer(val_temp);
384 *rx = SPI.transfer(val_reg2);
393 Serial.print(F(
"ADDR"));
394 if (i<16) Serial.print(
"0");
395 Serial.print(i, HEX);
396 Serial.print(F(
" = 0x"));
397 Serial.println(val_temp, HEX);
402 Serial.println(F(
" ***************************************************************************** "));
403 Serial.println(F(
"If this is a EZSync Standalone Device ignore this message - LTC6951 has been SYNC'd via SPI "));
404 Serial.println(F(
"If this is a EZSync Controller Device toggle all EZSync Device's Sync pins "));
405 Serial.println(F(
"EZSync TIMING: Sync Pins must remain high for 1ms, and with <10us skew between all EZSync Sync pins "));
406 Serial.println(F(
" ***************************************************************************** "));
408 if ( (RAO_bit == 1) && ( (SN_bit+SR_bit)>0 ) )
410 Serial.println(F(
" ***************************************************************************** "));
411 Serial.println(F(
"ParallelSync Timing: See Datasheet for setup and hold times "));
412 Serial.println(F(
"USER MUST TOGGLE SYNC PINS ACROSS ALL PARALLLESYNC DEVICES "));
413 Serial.println(F(
"If a DC2430 is available:"));
414 Serial.println(F(
" - DC2430's J20-J22 circuitry can be used to create correct SYNC to REF setup and hold times"));
415 Serial.println(F(
" ***************************************************************************** "));
432 boolean REGx3toREGx5_change=
false;
433 boolean REGx9toREGx12_change=
false;
434 boolean REGx7toREGx8_change=
false;
435 uint8_t start_addr, end_addr, val_temp,
i, RAO_bit, AUTOCAL_bit, SN_bit, SR_bit;
436 uint8_t val_reg2, val_reg3, val_regA;
443 {0x05, 0xba, 0x00, 0x78, 0xb3, 0x04, 0x30, 0x07, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x11},
444 {0x05, 0xba, 0x00, 0x78, 0xb3, 0x04, 0x2c, 0x07, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x82, 0x00, 0x11}
453 val_temp = start_addr<<1;
454 *rx = SPI.transfer(val_temp);
455 for (i=start_addr; i<19; i++)
457 val_temp=local6951_lkup_tbl[lkup_tbl_row][
i];
458 *rx = SPI.transfer(val_temp);
464 REGx3toREGx5_change=
false;
467 if (local6951_lkup_tbl[0][i] != local6951_lkup_tbl[1][i]) REGx3toREGx5_change=
true;
471 REGx7toREGx8_change=
false;
474 if (local6951_lkup_tbl[0][i] != local6951_lkup_tbl[1][i]) REGx7toREGx8_change=
true;
478 REGx9toREGx12_change=
false;
479 for (i=9; i<=0x12; i++)
481 if (local6951_lkup_tbl[0][i] != local6951_lkup_tbl[1][i]) REGx9toREGx12_change=
true;
486 val_reg2 = local6951_lkup_tbl[lkup_tbl_row][2];
487 val_reg3 = local6951_lkup_tbl[lkup_tbl_row][3];
488 RAO_bit = (val_reg3 & 0x04)>>2;
489 AUTOCAL_bit = (val_reg3 & 0x08)>>3;
496 if (REGx3toREGx5_change==
true) start_addr=3;
498 if (REGx7toREGx8_change==
true) end_addr=8;
499 if (REGx9toREGx12_change==
true) end_addr=12;
502 val_temp = start_addr<<1;
503 *rx = SPI.transfer(val_temp);
504 for (i=start_addr; i<=end_addr; i++)
506 val_temp=local6951_lkup_tbl[lkup_tbl_row][
i];
507 *rx = SPI.transfer(val_temp);
515 if (RAO_bit || !AUTOCAL_bit)
518 val_temp = start_addr<<1;
519 val_reg2 = val_reg2 | 0x01;
522 *rx = SPI.transfer(val_temp);
523 *rx = SPI.transfer(val_reg2);
#define LTC6951_ALCULOK
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_LOCK
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_SYNCEN0
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_UNLOCK
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_PDPLL
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_INVSTAT
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_CPDN
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_CPUP
for spi_map array, defines location for field specific information used to create the spi map ...
uint8_t get_LTC6951_SPI_FIELD_RW(uint8_t f)
returns if the given field name is (0)read/write or (1)read_only field
uint8_t get_LTC6951_SPI_FIELD_NUMBITS(uint8_t f)
returns the number of bits for a given field name in the SPI map
#define LTC6951_CPMID
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_REFOK
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MUTE1
for spi_map array, defines location for field specific information used to create the spi map ...
#define output_high(pin)
Set "pin" high.
LTC6951: Ultra-Low Jitter 2MHz to 2.7GHz Multi-Output Clock Synthesizer with Integrated VCO...
#define LTC6951_CP
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MD2
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_FILT
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_PDVCO
for spi_map array, defines location for field specific information used to create the spi map ...
Header File for Linduino Libraries and Demo Code.
#define LTC6951_SYNCEN3
for spi_map array, defines location for field specific information used to create the spi map ...
void set_LTC6951_REGS_freq_jump(uint8_t lkup_tbl_row, uint8_t init_setup)
This function toggles between two frequencies.
#define LTC6951_DLY3
for spi_map array, defines location for field specific information used to create the spi map ...
long LTC6951_read_field(uint8_t cs, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6951 Read Single Field For SPI FIELDS located in 1 or multiple address location reads specific add...
uint8_t LTC6951_spi_map[(LTC6951_NUM_REGFIELD+1)][4]
LTC6951 spi map, stores MSB address location, MSB bit location, field length in bits, and R or RW capability.
void set_LTC6951_REGS_lkup_tbl(uint8_t lkup_tbl_row)
Writes values to ALL LTC6951 RW addresses from a look-up table.
uint8_t LTC6951_write_field(uint8_t cs, long field_data, uint8_t address, uint8_t MSB_loc, uint8_t numbits)
LTC6951 Write Single Field For SPI FIELDS in 1 or multiple address locations reads specific address/f...
#define LTC6951_OINV2
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_ALCEN
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_PART
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_POR
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_SSYNC
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MUTE2
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_DLY2
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MUTE3
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_ND
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MUTE4
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_PDALL
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MD4
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MC2
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_RAO
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MD1
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MC4
for spi_map array, defines location for field specific information used to create the spi map ...
uint8_t LTC6951_reg[LTC6951_NUM_REGADDR]
number of LTC6951 spi addresses
#define LTC6951_DLY1
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_BD
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_SR
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_CPWIDE
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_REV
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_ALCCAL
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_ALCHI
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_SYNCEN2
for spi_map array, defines location for field specific information used to create the spi map ...
uint16_t LT_uint16
16-bit unsigned integer to be converted to two bytes
#define LTC6951_MD0
for spi_map array, defines location for field specific information used to create the spi map ...
uint8_t LTC6951_read(uint8_t cs, int8_t address)
LTC6951 Read Single Address reads 8 bit Data field to LTC6951.
#define LTC6951_LKWIN
for spi_map array, defines location for field specific information used to create the spi map ...
#define output_low(pin)
Set "pin" low.
#define R_ONLY
used for 2nd dim of 2d spi_map array
void spi_transfer_word(uint8_t cs_pin, uint16_t tx, uint16_t *rx)
Reads and sends a word.
#define LTC6951_MUTE0
for spi_map array, defines location for field specific information used to create the spi map ...
uint8_t get_LTC6951_REGSIZE()
returns # of addresses in parts register map (array size)
#define LTC6951_MCO
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_NREFOK
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_LKCT
for spi_map array, defines location for field specific information used to create the spi map ...
void set_LTC6951_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, uint8_t reg0B, uint8_t reg0C, uint8_t reg0D, uint8_t reg0E, uint8_t reg0F, uint8_t reg10, uint8_t reg11, uint8_t reg12)
Writes values to ALL LTC6951 RW addresses.
#define LTC6951_ALCMON
for spi_map array, defines location for field specific information used to create the spi map ...
uint8_t LTC6951_lkup_tbl[10][LTC6951_NUM_REGADDR]
the following settings assume a 100MHz reference input
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
#define LTC6951_PDREFPK
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_ALCLO
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_AUTOCAL
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_OINV3
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MC3
for spi_map array, defines location for field specific information used to create the spi map ...
#define ADDRx
used for 2nd dim of 2d spi_map array
#define LTC6951_PDOUT
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_SYNCEN1
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_DLY4
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_BST
for spi_map array, defines location for field specific information used to create the spi map ...
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
#define LTC6951_RD
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MC1
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_SN
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_NUM_REGFIELD
Defines number of LTC6951 SPI fields, used in spi_map array.
#define LTC6951_DLY0
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_PD
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_MD3
for spi_map array, defines location for field specific information used to create the spi map ...
This union splits one int16_t (16-bit signed integer) or uint16_t (16-bit unsigned integer) into two ...
#define LTC6951_OINV4
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_x
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_CPRST
for spi_map array, defines location for field specific information used to create the spi map ...
void LTC6951_init()
Initializes the SPI MAP arrays The values set in initialization are used for all the LTC6951 SPI/WRIT...
void LTC6951_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6951 Write Single Address writes 8 bit Data field to LTC6951.
void set_LTC6951_SPI_FIELD(uint8_t cs, uint8_t f, long field_data)
Sets the LTC6951 SPI field value calls function LTC6951_read_field, which reads specific address/fiel...
#define LTC6951_SYNCEN4
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_OINV1
for spi_map array, defines location for field specific information used to create the spi map ...
long get_LTC6951_SPI_FIELD(uint8_t cs, uint8_t f)
Gets the LTC6951 SPI field value calls function LTC6951_read_field, which reads specific address loca...
uint8_t LT_byte[2]
2 bytes (unsigned 8-bit integers) to be converted to a 16-bit signed or unsigned integer ...
int8_t discover_demo_board_local(char *demo_name)
Read the ID string from the EEPROM and determine if any demo board is connected.
#define QUIKEVAL_CS
QuikEval CS pin (SPI chip select on QuikEval connector pin 6) connects to Arduino SS pin...
#define LTC6951_NLOCK
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6951_NUM_REGADDR
Defines number of LTC6951 SPI registers, used in spi_map array.
#define LTC6951_CAL
for spi_map array, defines location for field specific information used to create the spi map ...
uint8_t read_quikeval_id_string(char *buffer)
Read the id string from the EEPROM, then parse the product name, demo board name, and demo board opti...
char ui_buffer[UI_BUFFER_SIZE]
#define LTC6951_OINV0
for spi_map array, defines location for field specific information used to create the spi map ...
#define DxMSB
used for 2nd dim of 2d spi_map array