47 #include <LiquidCrystal.h> 70 int8_t
MHz[6] = {0, 0, 0, 0, 0, 1};
85 lcd.print(
"LTC Synthesizer");
93 lcd.print(
"No Demo Board");
95 lcd.print(
" Detected");
99 lcd.print(
"Found The");
140 lcd.setCursor(11, 0);
142 lcd.setCursor(10, 0);
186 if ((input <= 170) && (input >= 120))
188 if ((input <= 350) && (input >= 300))
190 if ((input <= 550) && (input >= 450))
192 if ((input <= 800) && (input >= 700))
210 uint8_t O_DIV_possible = 0;
234 O_DIV_possible = O_divide_1(f_rf, &O_DIV);
236 O_DIV_possible = O_divide_2(f_rf, &O_DIV);
238 O_DIV_possible = O_divide_3(f_rf, &O_DIV);
244 lcd.print(
"No Loop Solution");
250 R_DIV = R_divide(f_ref, &f_STEP, O_DIV);
253 f_PFD = f_pfd(f_ref, R_DIV);
256 N_DIV = N_divide(f_rf, O_DIV, f_PFD);
259 f_VCO = f_vco(f_ref, N_DIV, R_DIV);
262 B_DIV = B_div(f_PFD);
265 filt = filter(f_ref);
268 LKWIN = lkwin(f_PFD);
317 i_cp = LTC6946_CP_10;
320 i_cp = LTC6946_CP_11;
326 lkcnt = LTC6946_LKCNT_3;
328 lkcnt = LTC6946_LKCNT_2;
330 lkcnt = LTC6946_LKCNT_1;
332 lkcnt = LTC6946_LKCNT_0;
345 REG[3] = B_DIV |R[1];
357 REG[8] = BST | filt | O_DIV | rfo;
358 REG[9] = i_cp | LKWIN | lkcnt;
365 lcd.print(
"Loop Set");
374 for (uint8_t
i = 2;
i <= 10 ;
i++)
377 lcd.print(
"Settings Stored");
390 for (uint8_t
i = 2;
i <= 10 ;
i++)
397 lcd.print(
"Settings");
399 lcd.print(
"Restored");
405 lcd.print(
"No Settings");
struct demo_board_type demo_board
Instantiate demo board structure.
LiquidCrystal lcd(RS, E, D4, D5, D6, D7)
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 loop_design()
#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.
Header File for Linduino Libraries and Demo Code.
#define LTC6946_ALCULOK
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6946_CS
Define the SPI CS pin.
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
static int8_t read_switches()
static void restore_settings()
Read stored PLL settings from nonvolatile EEPROM on demo board.
#define LTC6946_MTCAL
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6946_LKEN
for spi_map array, defines location for field specific information used to create the spi map ...
static uint8_t ref_out
Used to keep track of reference out status.
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.
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.
#define input(pin)
Return the state of pin "pin".
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
#define LTC6946_PDREFO
for spi_map array, defines location for field specific information used to create the spi map ...
#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 int8_t demo_board_connected
Demo Board Name stored in QuikEval EEPROM.
void LTC6946_write(uint8_t cs, uint8_t address, uint8_t Data)
LTC6946 Write Single Address writes 8 bit Data field to LTC6946.
#define LTC6946_CAL
for spi_map array, defines location for field specific information used to create the spi map ...
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
LTC6946: Ultralow Noise and Spurious 0.37GHz to 6.39GHz Integer-N Synthesizer with Integrated VCO...
static uint8_t REG[12]
Register values to be written to read from.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
#define LTC6946_ALCCAL
for spi_map array, defines location for field specific information used to create the spi map ...
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
char product_name[15]
LTC Product (LTC2654-L16)
static void store_settings()
static void write_all()
Write all registers for the LTC6946 and displays them.
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
#define LTC6946_CPCHI
for spi_map array, defines location for field specific information used to create the spi map ...
#define LTC6946_CPCLO
for spi_map array, defines location for field specific information used to create the spi map ...