113 Serial.begin(115200);
124 if (Serial.available())
127 if (user_command !=
'm')
128 Serial.println(user_command);
130 switch (user_command)
145 Serial.println(
"Incorrect Option");
161 Serial.print(F(
"*************************\n\n"));
162 Serial.println (F(
"0-Enter External Frequency"));
163 Serial.println (F(
"1-Set Gain"));
164 Serial.println (F(
"2-Set Lowpass"));
165 Serial.println (F(
"3-Set No Function Code"));
166 Serial.println (F(
"4-Upload Filter Settings"));
167 Serial.print (F(
"m-Main Menu\n"));
168 Serial.print (F(
"\nEnter a Command: "));
170 if (user_command ==
'm')
173 Serial.println(user_command);
176 switch (user_command)
179 Serial.println (F(
"Enter Frequency(MHz) between 12MHz-80MHZ"));
184 Serial.println (F(
"incorrect option"));
187 Serial.println (F(
"Gain: 0-0dB, 1-6dB, 2-12dB, 3-24dB"));
189 switch (user_command)
204 Serial.println (F(
"incorrect option"));
208 Serial.println (F(
"Lowpass Divider: 0-32 1-32 2-128 3-512"));
211 switch (user_command)
226 Serial.println (F(
"incorrect option"));
230 Serial.println (F(
"No Function Hex Code: 0-0x04, 1-0x08, 2-0x00, 3-0x0C"));
232 switch (user_command)
247 Serial.println (F(
"incorrect option"));
255 Serial.println(
"Incorrect Option");
258 Serial.print (
"\Control byte 0x" + String(
control_byte, HEX) +
"\n");
268 Serial.print(F(
"*************************\n\n"));
269 Serial.println(F(
"0-Set GPIO Low"));
270 Serial.println (F(
"1-Set GPIO High"));
271 Serial.print(F(
"m-Main Menu\n"));
272 Serial.print(F(
"\nEnter a Command: "));
274 if (user_command ==
'm')
277 Serial.println(user_command);
279 switch (user_command)
292 Serial.println (F(
"incorrect option"));
295 Serial.print (
"\Control byte 0x" + String(
control_byte, HEX) +
"\n");
301 Serial.print(F(
"* The LTC6603 is powered down *\n"));
305 Serial.print (
"\Control byte 0x" + String(
control_byte, HEX) +
"\n");
311 Serial.print(F(
"* The LTC6603 is turning on *\n"));
315 Serial.print (
"\Control byte 0x" + String(
control_byte, HEX) +
"\n");
323 (F(
"\n*****************************************************************\n"));
324 Serial.print(F(
"* DC1304A-B Demonstration Program *\n"));
325 Serial.print(F(
"* *\n"));
326 Serial.print(F(
"* This program demonstrates how to send data to the LTC6603. *\n"));
327 Serial.print(F(
"* *\n"));
328 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
329 Serial.print(F(
"* *\n"));
330 Serial.print(F(
"*****************************************************************\n"));
336 Serial.print(F(
"\n1-Filter Setting\n"));
337 Serial.print(F(
"2-Set General Purpose Output\n"));
338 Serial.print(F(
"3-Power Down LTC6603\n"));
339 Serial.print(F(
"4-Power Up LTC6603\n"));
340 Serial.print(F(
"5-Change the LTC6903 clock frequency\n"));
342 Serial.print(F(
"Enter a command:"));
347 float div0 = freq/32;
348 float div1 = freq/32;
349 float div2 = freq/128;
350 float div3 = freq/512;
352 Serial.println (
"Lowpass Frequency: 0-" + String(div0,3) +
"MHz 1-" + String(div1,3) +
"MHz 2-" + String(div2,3) +
"MHz 3-"+String(div3,3) +
"MHz");
#define LTC6603_CS
Define the SPI CS pin.
unsigned char user_command
static uint8_t filter_lp_settings
#define LTC6603_FREQ_MIN
Define external frequency range.
#define LTC6603_PRUP
Turns on LTC6603.
Header File for Linduino Libraries and Demo Code.
#define LTC6603_NOFUNC_MASK
static void print_user_command(uint8_t menu)
static uint8_t gpio_settings
static uint8_t control_byte
static void print_prompt()
Prints main menu.
#define LTC6603_GPO_HIGH
Sets the general purpose.
#define LTC6603_ONOFF_MASK
static void menu_4_poweron()
static uint8_t filter_gain_settings
static void menu_1_filter_settings()
Set filter settings.
#define LTC6603_GAIN_12dB
static uint8_t shdn_settings
#define LTC6603_GAIN_24dB
void LTC6603_write(uint8_t cs, uint8_t *tx, uint8_t length)
Sends Data to the LTC6603.
static void print_title()
Prints the title block when program first starts.
#define LTC6603_SHDN
Shuts down LTC6603.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
static void menu_3_shutdown()
static void loop()
Repeats Linduino loop.
LTC6603: Dual, Matched, High Frequency Bandpass/Lowpass Filters.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
#define LTC6603_GAIN_MASK
static void calculate_FreqLow(float freq)
static uint8_t filter_noFunc_settings
static float freq_settings
static void menu_2_set_gpo()
static void setup()
Initialize Linduino.