100 Serial.begin(115200);
114 if (Serial.available())
117 if (user_command !=
'm')
118 Serial.println(user_command);
119 switch (user_command)
128 Serial.println(F(
"Invalid Option"));
152 display_code = adc_code >> 4;
153 display_code = display_code & 0xFFFF;
155 Serial.print(F(
" Received Code: 0x"));
156 Serial.println(display_code, HEX);
161 if (adc_code & 0x100000)
164 adc_voltage = adc_voltage * (-1);
167 Serial.print(F(
" Equivalent voltage: "));
168 Serial.print(adc_voltage, 4);
169 Serial.println(F(
" V"));
174 Serial.print(F(
"\n Enter the reference voltage: "));
177 Serial.println(F(
" V"));
185 Serial.print(F(
"\n*****************************************************************\n"));
186 Serial.print(F(
"* DC941A Demonstration Program *\n"));
187 Serial.print(F(
"* *\n"));
188 Serial.print(F(
"* This program demonstrates how to send data and receive data *\n"));
189 Serial.print(F(
"* from the 16-bit ADC. *\n"));
190 Serial.print(F(
"* *\n"));
191 Serial.print(F(
"* *\n"));
192 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
193 Serial.print(F(
"* *\n"));
194 Serial.print(F(
"*****************************************************************\n"));
200 Serial.print(F(
"\n1-Read Input\n"));
201 Serial.print(F(
"2-Change reference voltage\n"));
202 Serial.print(F(
"\nEnter a Command: "));
static void setup()
Initialize Linduino.
unsigned char user_command
Header File for Linduino Libraries and Demo Code.
LTC2482: 16-Bit Delta-Sigma ADC with Easy Drive Input Current Cancellation.
#define LTC2482_CS
Define the SPI CS pin.
LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs.
static float LTC2482_range
static void loop()
Repeats Linduino loop.
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 uint8_t demo_board_connected
Set to 1 if the board is connected.
float LTC2482_code_to_voltage(uint32_t adc_code, float vref)
Calculates the LTC2482 input voltage given the binary data, reference voltage and input gain...
static void print_title()
Prints the title block when program first starts.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
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_2_reference_voltage()
static int32_t display_code
static float LTC2482_vref
static void menu_1_read_input()
Read channel.
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
static void print_prompt()
Prints main menu.
void LTC2482_read(uint8_t cs, uint32_t *ptr_adc_code)
Reads the LTC2482 and returns 24-bit data.