100 Serial.begin(115200);
111 if (Serial.available())
114 if (user_command !=
'm')
115 Serial.println(user_command);
117 switch (user_command)
132 Serial.println(
"Incorrect Option");
148 Serial.print(F(
"*************************\n\n"));
149 Serial.println (F(
"0-Set Gain"));
150 Serial.println (F(
"1-Set Lowpass"));
151 Serial.println (F(
"2-Set Highpass"));
152 Serial.println (F(
"3-Upload Filter Settings"));
153 Serial.print (F(
"m-Main Menu\n"));
154 Serial.print (F(
"\nEnter a Command: "));
156 if (user_command ==
'm')
159 Serial.println(user_command);
162 switch (user_command)
165 Serial.println (F(
"Gain: 0-0dB, 1-12dB, 2-24dB, 3-30dB"));
167 switch (user_command)
182 Serial.println (F(
"incorrect option"));
186 Serial.println (F(
"Lowpass Divider: 0-100, 1-100, 2-300, 3-600"));
188 switch (user_command)
203 Serial.println (F(
"incorrect option"));
207 Serial.println (F(
"Highpass Divider: 0-1000, 1-2000, 2-6000, 3-Bypass HPF"));
209 switch (user_command)
224 Serial.println (F(
"incorrect option"));
232 Serial.println(
"Incorrect Option");
235 Serial.print (
"\Control byte 0x" + String(
control_byte, HEX) +
"\n");
245 Serial.print(F(
"*************************\n\n"));
246 Serial.println(F(
"0-Set GPIO Low"));
247 Serial.println (F(
"1-Set GPIO High"));
248 Serial.print(F(
"m-Main Menu\n"));
249 Serial.print(F(
"\nEnter a Command: "));
251 if (user_command ==
'm')
254 Serial.println(user_command);
256 switch (user_command)
269 Serial.println (F(
"incorrect option"));
272 Serial.print (
"\Control byte 0x" + String(
control_byte, HEX) +
"\n");
278 Serial.print(F(
"* The LTC6602 is powered down *\n"));
282 Serial.print (
"\Control byte 0x" + String(
control_byte, HEX) +
"\n");
288 Serial.print(F(
"* The LTC6602 is turning on *\n"));
292 Serial.print (
"\Control byte 0x" + String(
control_byte, HEX) +
"\n");
299 (F(
"\n*****************************************************************\n"));
300 Serial.print(F(
"* DC1304A-A Demonstration Program *\n"));
301 Serial.print(F(
"* *\n"));
302 Serial.print(F(
"* This program demonstrates how to send data to the LTC6602. *\n"));
303 Serial.print(F(
"* *\n"));
304 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
305 Serial.print(F(
"* *\n"));
306 Serial.print(F(
"*****************************************************************\n"));
312 Serial.print(F(
"\n1-Filter Setting\n"));
313 Serial.print(F(
"2-Set General Purpose Output\n"));
314 Serial.print(F(
"3-Power Down LTC6602\n"));
315 Serial.print(F(
"4-Power Up LTC6602\n"));
317 Serial.print(F(
"Enter a command:"));
#define LTC6602_GAIN_12dB
unsigned char user_command
static uint8_t filter_hp_settings
static uint8_t filter_lp_settings
Header File for Linduino Libraries and Demo Code.
static void print_user_command(uint8_t menu)
#define LTC6602_SHDN
Shuts down LTC6602.
static void print_prompt()
Prints main menu.
#define LTC6602_GPO_HIGH
Sets the general purpose.
static uint8_t gpio_settings
static uint8_t filter_gain_settings
static void menu_4_poweron()
static uint8_t control_byte
#define LTC6602_CS
Define the SPI CS pin.
static void menu_1_filter_settings()
Set filter settings.
static uint8_t shdn_settings
static void menu_3_shutdown()
static void print_title()
Prints the title block when program first starts.
static void loop()
Repeats Linduino loop.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
#define LTC6602_GAIN_30dB
#define LTC6602_GAIN_24dB
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
#define LTC6602_PRUP
Turns on LTC6602.
static void menu_2_set_gpo()
#define LTC6602_ONOFF_MASK
void LTC6602_write(uint8_t cs, uint8_t *tx, uint8_t length)
Sends Data to the LTC6602.
#define LTC6602_GAIN_MASK
static void setup()
Initialize Linduino.
LTC6602: Dual, Matched, High Frequency Bandpass/Lowpass Filters.