123 Serial.begin(115200);
133 Serial.println(F(
"EEPROM not detected, will attempt to proceed"));
146 if (Serial.available())
149 if (user_command !=
'm')
150 Serial.println(user_command);
152 switch (user_command)
164 Serial.println(F(
"Incorrect Option"));
166 Serial.print(F(
"\n*************************\n"));
177 Serial.print(F(
"\n*****************************************************************\n"));
178 Serial.print(F(
"* DC1490A Demonstration Program *\n"));
179 Serial.print(F(
"* *\n"));
180 Serial.print(F(
"* This program demonstrates how to send data and receive data *\n"));
181 Serial.print(F(
"* from the 16-bit ADC. *\n"));
182 Serial.print(F(
"* *\n"));
183 Serial.print(F(
"* *\n"));
184 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
185 Serial.print(F(
"* *\n"));
186 Serial.print(F(
"*****************************************************************\n"));
192 Serial.print(F(
"\n1-Read Single-Ended\n"));
193 Serial.print(F(
"2-2X Mode Settings\n"));
194 Serial.print(F(
"3-Sleep\n"));
195 Serial.print(F(
"Enter a Command: "));
209 Serial.print(F(
"*************************\n\n"));
210 Serial.print(F(
"1-Read\n"));
211 Serial.print(F(
"m-Main Menu\n"));
212 Serial.print(F(
"Enter a Command: "));
215 if (user_command ==
'm')
222 Serial.println(user_command);
224 Serial.print(F(
"ADC Command: 0x"));
225 Serial.println(adc_command, HEX);
234 Serial.print(F(
"Received Code: 0x"));
235 Serial.println(((adc_code>>16) & 0x0000FFFF), HEX);
237 Serial.print(F(
" ****"));
238 Serial.print(F(
"Voltage"));
239 Serial.print(F(
": "));
240 Serial.print(adc_voltage, 4);
241 Serial.print(F(
"V\n\n"));
256 Serial.print(F(
"2X Mode Settings\n\n"));
257 Serial.print(F(
"0-Disable\n"));
258 Serial.print(F(
"1-Enable\n"));
259 Serial.print(F(
"Enter a Command: "));
261 Serial.println(user_command);
263 if (user_command == 0)
266 Serial.print(F(
"2X Mode Disabled, offset calibration enabled\n"));
271 Serial.print(F(
"2X Mode Enabled, offset calibration disabled\n"));
278 Serial.print(
"Putting LTC2460 into sleep mode");
#define LTC2460_CS
Define the SPI CS pin.
unsigned char user_command
static uint8_t adc_command
LTC2460 Ultra-Tiny, 16-bit delta sigma ADCs with 10ppm/degree C Max Precision Reference.
Header File for Linduino Libraries and Demo Code.
float LTC2460_code_to_voltage(int32_t adc_code, float vref)
Calculates the voltage corresponding to an adc code, given the reference (in volts) ...
static void print_title()
Prints the title block when program first starts.
static void print_prompt()
Prints main menu.
LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
int8_t discover_demo_board(char *demo_name)
Read the ID string from the EEPROM and determine if the correct board is connected.
static void setup()
Initialize Linduino.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
static void menu_1_read_single_ended()
Read channels in single-ended mode.
void LTC2460_read(uint8_t cs, uint8_t adc_command, int32_t *adc_code)
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
const uint16_t BUILD_1X_2X_COMMAND[2]
Lookup table to build 1X / 2X bits.
static uint8_t demo_board_connected
Set to 1 if the board is connected.
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 menu_3_sleep()
static uint16_t eoc_timeout
static void loop()
Repeats Linduino loop.
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
static void menu_2_set_1X2X()
Set 1X or 2X mode.
static float LTC2460_vref
static int16_t two_x_mode
The LTC2460 2X Mode settings.