127 Serial.begin(115200);
138 if (Serial.available())
141 if (user_command !=
'm')
142 Serial.println(user_command);
143 switch (user_command)
155 Serial.println(
"Invalid Option");
182 display_code = display_code & 0xFFFF;
184 display_code = display_code & 0x3FFFF;
186 Serial.print(F(
" Received Code: b"));
187 Serial.println(display_code, BIN);
192 Serial.print(F(
" Equivalent voltage: "));
193 Serial.print(adc_voltage, 4);
194 Serial.println(F(
"V"));
204 Serial.println(F(
" 0 = No Gain Compression"));
205 Serial.println(F(
" 1 = Gain Compression"));
206 Serial.print(F(
" Enter a Command, based upon the position of jumper JP6: "));
209 Serial.println(user_command);
210 switch (user_command)
213 Serial.println(F(
" No Gain compression"));
217 Serial.println(F(
" Gain compression"));
222 Serial.println(
" Invalid Option");
236 Serial.println(F(
" 16 = 237X-16"));
237 Serial.println(F(
" 18 = 237X-18"));
238 Serial.print(F(
" Enter a Command, based upon the resolution of the part under test: "));
241 Serial.println(user_command);
242 switch (user_command)
245 Serial.println(F(
" 16 bits selected"));
249 Serial.println(F(
" 18 bits selected"));
254 Serial.println(
" Invalid Option");
266 Serial.println(F(
"*****************************************************************"));
267 Serial.println(F(
"* DC1783A Demonstration Program *"));
268 Serial.println(F(
"* *"));
269 Serial.println(F(
"* This program demonstrates how to receive data *"));
270 Serial.println(F(
"* from the following ADCs: *"));
271 Serial.println(F(
"* LTC2376-16 *"));
272 Serial.println(F(
"* LTC2376-18 *"));
273 Serial.println(F(
"* LTC2377-16 *"));
274 Serial.println(F(
"* LTC2376-18 *"));
275 Serial.println(F(
"* LTC2378-16 *"));
276 Serial.println(F(
"* LTC2378-18 *"));
277 Serial.println(F(
"* LTC2379-18 *"));
278 Serial.println(F(
"* LTC2380-16 *"));
279 Serial.println(F(
"* *"));
280 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
281 Serial.println(F(
"* *"));
282 Serial.println(F(
"*****************************************************************"));
289 Serial.println(F(
"*************************"));
290 Serial.println(F(
"1-Read ADC Input"));
291 Serial.println(F(
"2-Select No Gain Compression / Gain Compression (Default is no compression)"));
292 Serial.println(F(
"3-Select Number of bits (Default is 18 bits)\n"));
293 Serial.print(F(
"Enter a command:"));
static uint8_t LTC2380_bits
Default set for 18 bits.
unsigned char user_command
static void setup()
Initialize Linduino.
static void menu_1_read_input()
Read channel.
Header File for Linduino Libraries and Demo Code.
static void print_title()
Prints the title block when program first starts.
static void menu_2_select_gain_compression()
Select gain compression.
static void menu_3_select_bits()
Select number of bits.
#define LTC2380_CS
Define the SPI CS pin.
void LTC2380_read(uint8_t cs, int32_t *ptr_adc_code)
Reads the LTC2380 and returns 32-bit data in 2's complement format.
static void print_user_command(uint8_t menu)
static float LTC2380_vref
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
static void loop()
Repeats Linduino loop.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
static uint8_t LTC2380_dgc
Default set for no gain compression.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
static void print_prompt()
Prints main menu.
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 int32_t display_code
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
LTC2376-16: 16-Bit, 250Ksps ADC LTC2376-18: 18-Bit, 250Ksps ADC LTC2376-20: 20-Bit, 250Ksps ADC LTC2377-16: 16-Bit, 500Ksps ADC LTC2377-18: 18-Bit, 500Ksps ADC LTC2377-20: 20-Bit, 500Ksps ADC LTC2378-16: 16-Bit, 1Msps ADC LTC2378-18: 18-Bit, 1Msps ADC LTC2378-20: 20-Bit, 1Msps ADC LTC2379-18: 18-Bit, 1.6Msps ADC LTC2380-16: 16-Bit, 2Msps ADC.