106 Serial.begin(115200);
116 Serial.println(F(
"EEPROM not detected, will attempt to proceed"));
128 if (Serial.available())
131 if (user_command !=
'm')
132 Serial.println(user_command);
134 switch (user_command)
143 Serial.println(F(
"Incorrect Option"));
145 Serial.print(F(
"\n*************************\n"));
156 Serial.print(F(
"\n*****************************************************************\n"));
157 Serial.print(F(
"* DC570A Demonstration Program *\n"));
158 Serial.print(F(
"* *\n"));
159 Serial.print(F(
"* This program demonstrates how to send data and receive data *\n"));
160 Serial.print(F(
"* from the 24-bit ADC. *\n"));
161 Serial.print(F(
"* *\n"));
162 Serial.print(F(
"* *\n"));
163 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
164 Serial.print(F(
"* *\n"));
165 Serial.print(F(
"*****************************************************************\n"));
171 Serial.print(F(
"\n1-Read Differential\n"));
172 Serial.print(F(
"2-OSR Mode Settings\n"));
173 Serial.print(F(
"Enter a Command: "));
183 uint16_t miso_timeout = 1000;
191 Serial.println(F(
"\n ***SPI Error*** \n"));
199 Serial.println(F(
"\n ***SPI Error*** \n"));
203 Serial.print(F(
"Received Code: 0x"));
204 Serial.println(adc_code, HEX);
206 Serial.print(F(
"\n ****"));
207 Serial.print(adc_voltage, 4);
208 Serial.print(F(
"V\n"));
217 Serial.print(F(
"OSR Settings\n\n"));
218 Serial.print(F(
"0-64\n"));
219 Serial.print(F(
"1-128\n"));
220 Serial.print(F(
"2-256\n"));
221 Serial.print(F(
"3-512\n"));
222 Serial.print(F(
"4-1024\n"));
223 Serial.print(F(
"5-2048\n"));
224 Serial.print(F(
"6-4096\n"));
225 Serial.print(F(
"7-8192\n"));
226 Serial.print(F(
"8-16384\n"));
227 Serial.print(F(
"9-32768\n"));
228 Serial.print(F(
"Enter a Command: "));
230 Serial.println(user_command);
232 switch (user_command)
float LTC2440_code_to_voltage(int32_t adc_code, float vref)
Calculates the voltage corresponding to an adc code, given the reference (in volts) ...
static float LTC2440_vref
unsigned char user_command
static uint8_t adc_command
static void loop()
Repeats Linduino loop.
int8_t LTC2440_EOC_timeout(uint8_t cs, uint16_t miso_timeout)
Checks for EOC with a specified timeout.
static void print_user_command(uint8_t menu)
Header File for Linduino Libraries and Demo Code.
LTC2440: 24-Bit, Differential Delta Sigma ADCs with Selectable Speed/Resolution.
static void print_title()
Prints the title block when program first starts.
static void menu_1_read_differential()
Read channels in differential mode.
LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs.
static int16_t OSR_mode
The LTC2440 OSR mode settings.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
#define LTC2440_OSR_16384
int8_t discover_demo_board(char *demo_name)
Read the ID string from the EEPROM and determine if the correct board is connected.
#define LTC2440_CS
Define the SPI CS pin.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
static void menu_set_OSR()
Set the OSR.
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
static void print_prompt()
Prints main menu.
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
static void setup()
Initialize Linduino.
static uint8_t demo_board_connected
Set to 1 if the board is connected.
void LTC2440_read(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
Reads from LTC2440.
#define LTC2440_OSR_32768
static void menu_2_set_OSR()