107 Serial.begin(115200);
111 if (demo_board_connected)
117 Serial.println(F(
"EEPROM not detected, will attempt to proceed"));
126 uint8_t acknowledge = 0;
127 if (Serial.available())
130 if (user_command !=
'm')
131 Serial.println(user_command);
133 switch (user_command)
148 Serial.println(F(
"Incorrect Option"));
151 Serial.println(F(
"***** I2C ERROR *****"));
152 Serial.print(F(
"\n*************************\n"));
162 Serial.print(F(
"\n*****************************************************************\n"));
163 Serial.print(F(
"* DC1716A Demonstration Program *\n"));
164 Serial.print(F(
"* *\n"));
165 Serial.print(F(
"* This program demonstrates how to send data and receive data *\n"));
166 Serial.print(F(
"* from the 16-bit ADC. *\n"));
167 Serial.print(F(
"* *\n"));
168 Serial.print(F(
"* *\n"));
169 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
170 Serial.print(F(
"* *\n"));
171 Serial.print(F(
"*****************************************************************\n"));
177 Serial.print(F(
"\n1-Read Differential\n"));
178 Serial.print(F(
"2-Set SPS\n"));
179 Serial.print(F(
"3-Sleep Mode\n"));
180 Serial.print(F(
"4-Set I2C Address\n"));
181 Serial.print(F(
"Enter a Command: "));
199 Serial.print(F(
"Received Code: 0x"));
200 Serial.println(adc_code >> 14, HEX);
202 Serial.print(F(
"\n ****"));
203 Serial.print(adc_voltage, 4);
204 Serial.print(F(
"V\n"));
208 Serial.println(F(
"Device NAK'd, please check I2C address"));
221 Serial.print(F(
"Samples Per Second Mode Settings\n\n"));
222 Serial.print(F(
"0-208 SPS\n"));
223 Serial.print(F(
"1-833 SPS\n"));
224 Serial.print(F(
"Enter a Command: "));
227 if (user_command == 0)
230 Serial.print(F(
"208 SPS Mode \n"));
235 Serial.print(F(
"833 SPS Mode \n"));
247 Serial.println(F(
"\nThe LTC2473 is in sleep mode"));
255 Serial.print(F(
"What is the I2C address of the part?\n"));
256 Serial.print(F(
"Please enter in 7-bit format, decimal\n"));
259 Serial.println(user_command);
static int8_t menu_2_set_sps()
Set the SPS.
static uint16_t timeout
The timeout in microseconds.
static uint8_t i2c_address
I2C address in 7 bit format for part.
unsigned char user_command
#define LTC2473_I2C_ADDRESS
I2C address of the LTC2473.
static uint8_t adc_command
static uint8_t menu_3_sleep()
Set LTC2473 to sleep mode.
uint8_t LTC2473_read(uint8_t i2c_address, int32_t *adc_code, uint16_t timeout)
Reads from LTC2473.
Header File for Linduino Libraries and Demo Code.
#define LTC2473_ENABLE_PROGRAMMING
float LTC2473_code_to_voltage(int32_t adc_code, float vref)
Calculates the voltage corresponding to an ADC code, given the reference (in volts) ...
static int8_t menu_1_read_differential()
Read the ADC.
static void print_user_command(uint8_t menu)
LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs.
uint8_t LTC2473_write(uint8_t i2c_address, uint8_t adc_command)
Writes to the LTC2473.
static void loop()
Repeats Linduino loop.
LTC2473: 16-Bit, Delta Sigma ADC with I2C interface.
int8_t discover_demo_board(char *demo_name)
Read the ID string from the EEPROM and determine if the correct board is connected.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
static void print_title()
Prints the title block when program first starts.
static float LTC2473_vref
The nominal reference voltage.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
static void setup()
Initialize Linduino.
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
void quikeval_I2C_connect(void)
Switch MUX to connect I2C pins to QuikEval connector.
static void print_prompt()
Prints main menu.
static void menu_4_set_address()
Set the I2C 7 bit address.
static uint8_t demo_board_connected
Set to 1 if the board is connected.