58 #define LTC2380_CNV QUIKEVAL_CS 90 if (Serial.available())
93 if (user_command !=
'm')
94 Serial.println(user_command);
104 Serial.println(
" Invalid Option");
123 Serial.print(
"\n24-bit decimal data: 0x ");
124 Serial.println(adc_code & 0xFFFFFF, HEX);
125 Serial.print(
"Voltage calculated: ");
126 Serial.print(adc_voltage);
127 Serial.println(
" V");
128 Serial.print(
"No:of averaging cycles: ");
129 Serial.println(cycles + 1);
138 Serial.println(F(
" 0 = No Gain Compression"));
139 Serial.println(F(
" 1 = Gain Compression"));
140 Serial.print(F(
" Enter a Command, based upon the position of jumper JP6: "));
143 Serial.println(user_command);
144 switch (user_command)
147 Serial.println(F(
" No Gain compression"));
151 Serial.println(F(
" Gain compression"));
156 Serial.println(
" Invalid Option");
166 Serial.println(F(
"*************************"));
167 Serial.println(F(
"1-Read ADC Input"));
168 Serial.println(F(
"2-Select No Gain Compression / Gain Compression (default is no compression)"));
169 Serial.print(F(
"Enter a command:"));
176 Serial.println(F(
"*****************************************************************"));
177 Serial.println(F(
"* DC2289A Demonstration Program *"));
178 Serial.println(F(
"* *"));
179 Serial.println(F(
"* This program demonstrates how to read data *"));
180 Serial.println(F(
"* from LTC2380-24 bit part. *"));
181 Serial.println(F(
"* *"));
182 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
183 Serial.println(F(
"* *"));
184 Serial.println(F(
"*****************************************************************"));
190 DDRB = DDRB | B00000100;
static void print_title()
Prints the title block when program first starts.
unsigned char user_command
static void loop()
Repeats Linduino loop.
static uint8_t LTC2380_dgc
Default set for no gain compression.
Header File for Linduino Libraries and Demo Code.
static void configureCNV()
Function to configure CNV pin as an output.
void LTC2380_read(uint8_t cs, int32_t *ptr_adc_code)
Reads the LTC2380 and returns 32-bit data in 2's complement format.
LTC2380-24: Low Noise, High Speed, 24-Bit SAR ADC With Digital Filter.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
static void menu_2_select_gain_compression()
Select gain compression.
static void print_prompt()
Prints main menu.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
float LTC2380_code_to_voltage(int32_t adc_code, uint8_t gain_compression, float vref)
Calculates the LTC2380 input voltage given the binary data and lsb weight.
static void menu_1_read_input()
Read Input voltage.
static void setup()
Initialize Linduino.
static float LTC2380_vref