109 Serial.println(user_command);
111 switch (user_command)
123 Serial.println(F(
"Invalid command"));
133 Serial.println(F(
"*****************************************************************"));
134 Serial.println(F(
"* DC726B Demonstration Program *"));
135 Serial.println(F(
"* *"));
136 Serial.println(F(
"* This program demonstrates how to send data to the *"));
137 Serial.println(F(
"* programmable oscillator *"));
138 Serial.println(F(
"* *"));
139 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
140 Serial.println(F(
"* *"));
141 Serial.println(F(
"*****************************************************************"));
148 Serial.println(F(
"1-Set frequency out"));
149 Serial.println(F(
"2-Manually set OCT and DAC code"));
150 Serial.println(F(
"3-Settings"));
152 Serial.print(F(
"Enter a command:"));
162 Serial.print(F(
"Enter the desired clock freq (KHz):"));
166 Serial.println(freq, 4);
182 Serial.print(F(
"Enter the OCT:"));
190 Serial.print(F(
"Enter the DAC code:"));
194 Serial.println(dac_code);
207 Serial.println(F(
"Output Configuration"));
208 Serial.println(F(
"1-CLK On and CLK INV ON"));
209 Serial.println(F(
"2-CLK Off and CLK INV ON"));
210 Serial.println(F(
"3-CLK On and CLK INV Off"));
211 Serial.println(F(
"4-Power Down"));
213 Serial.print(F(
"Enter a command:"));
217 Serial.println(user_command);
219 switch (user_command)
234 Serial.println(F(
"Invalid command"));
static void print_prompt()
Prints main menu.
unsigned char user_command
#define LTC6903_CS
Define the SPI CS pin.
static void set_frequency()
Sets the output frequency.
Header File for Linduino Libraries and Demo Code.
void LTC6903_write(uint8_t cs, uint16_t code)
Writes 2 bytes.
#define LTC6903_CLK_OFF_CLK_INV_ON
Clock off, inverted clock on.
static void print_title()
Prints the title block when program first starts.
static void setup()
Initialize Linduino.
static uint8_t output_config
Keeps track of output configuration.
#define LTC6903_CLK_ON_CLK_INV_OFF
Clock on, inverted clock off.
uint16_t LTC6903_frequency_to_code(float frequency, uint8_t clk)
Calculates the code necessary to create the clock frequency.
static void settings()
Configures the output.
#define LTC6903_POWER_DOWN
Powers down clocks.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
#define LTC6903_CLK_ON_CLK_INV_ON
Clock on, inverted clock on.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
static void manually_set_reg()
Manually Sets OCT and DAC Code.
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
static void loop()
Repeats Linduino loop.
LTC6903: 1kHz to 68MHz Serial Port Programmable Oscillator.