66 #define CS QUIKEVAL_CS 129 Serial.begin(115200);
130 Serial.println(F(
"Welcome to the LTC2442 Test Program\n"));
140 if (!demo_board_connected)
141 Serial.println(F(
"Standard demo board not detected, verify hardware connections to your circuit."));
154 switch (user_command)
169 while (Serial.available() ==
false);
173 Serial.println(F(
"Incorrect Option"));
182 Serial.println(F(
"S-Single Loop"));
183 Serial.println(F(
"C-Continuous Loop"));
184 Serial.println(F(
" Enter any character to exit Continuous Loop"));
186 Serial.print(F(
"Enter a command: "));
192 float floatresults[16];
193 int32_t rawresults[16];
197 #ifdef PRIME_BEFORE_SCAN // If defined, prime first channel so that data is "less stale" 204 delay(channel_delay);
223 Serial.print(floatresults[i], 8);
224 if (!((i+1)%array_size)) Serial.println();
225 else Serial.print(F(
" , "));
234 Serial.print(rawresults[i]);
235 if (!((i+1)%array_size)) Serial.println();
236 else Serial.print(F(
" , "));
static void print_prompt()
Print the Prompt.
unsigned char user_command
static uint8_t array_size
const uint8_t CHANNEL_ARRAY[2]
Build the command for differential mode.
static uint16_t loop_delay
Header File for Linduino Libraries and Demo Code.
static void setup()
Initialize Linduino.
int8_t LTC24XX_EOC_timeout(uint8_t cs, uint16_t miso_timeout)
Checks for EOC with a specified timeout.
static void print_all(float *results)
Displays the the data in the array.
LTC24XX General Library: Functions and defines for all SINC4 Delta Sigma ADCs.
void LTC24XX_SPI_16bit_command_32bit_data(uint8_t cs, uint8_t adc_command_high, uint8_t adc_command_low, int32_t *adc_code)
Reads from LTC24XX ADC that accepts a 16 bit configuration and returns a 32 bit result.
static uint16_t eoc_timeout
timeout in ms
#define LTC24XX_MULTI_CH_P2_N3
static void print_raw(int32_t *rawresults)
#define LTC24XX_MULTI_CH_OSR_16384
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.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
#define CS
LTC2442: 24-Bit High Speed 4-Channel Delta Sigma ADCs with Integrated Amplifier.
float LTC24XX_diff_code_to_voltage(int32_t adc_code, float vref)
Calculates the voltage corresponding to an ADC code, given the reference voltage. ...
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
static float LTC2442_vref
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
static uint16_t EOC_timout
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
#define LTC24XX_MULTI_CH_P0_N1
static void read_LTC2442(float vref, uint16_t eoc_timeout, uint16_t channel_delay)
Reads the LTC2442 and displays the results.
static uint16_t channel_read_delay
static void loop()
Repeats Linduino loop.
static uint8_t demo_board_connected
Set to 1 if the board is connected.