123 Serial.begin(115200);
134 if (Serial.available())
137 if (user_command !=
'm')
138 Serial.println(user_command);
139 switch (user_command)
154 Serial.println(
" Invalid Option");
181 display_code = display_code & 0xFFF;
183 display_code = display_code & 0x3FFF;
185 Serial.print(F(
" Received Code: b"));
186 Serial.println(display_code, BIN);
191 Serial.print(F(
" Equivalent voltage: "));
192 Serial.print(adc_voltage, 4);
193 Serial.println(F(
"V"));
203 Serial.println(F(
" 12 = 231X-12"));
204 Serial.println(F(
" 14 = 231X-14"));
205 Serial.print(F(
" Enter a Command, based upon the resolution of the part under test: "));
208 Serial.println(user_command);
209 switch (user_command)
213 Serial.println(F(
" 12 bits selected"));
217 Serial.println(F(
" 14 bits selected"));
221 Serial.println(
" Invalid Option");
235 Serial.println(F(
" 0 = 2.048V Vref (Vdd = 3.3V)"));
236 Serial.println(F(
" 1 = 4.096V Vref (Vdd = 5V)"));
237 Serial.print(F(
" Enter a Command, based upon the position of JP3: "));
240 Serial.println(user_command);
241 switch (user_command)
246 Serial.println(F(
" 2.048V Vref selected"));
251 Serial.println(F(
" 4.096V Vref selected"));
255 Serial.println(
" Invalid Option");
269 Serial.println(F(
" 0 = LTC2314/2315"));
270 Serial.println(F(
" 1 = LTC2312/2313"));
271 Serial.print(F(
" Enter a Command: "));
274 Serial.println(user_command);
275 switch (user_command)
279 Serial.println(F(
" LTC2314/2315 selected"));
283 Serial.println(F(
" LTC2312/2313 selected"));
286 Serial.println(
" Invalid Option");
297 Serial.println(F(
"*****************************************************************"));
298 Serial.println(F(
"* DC1563A Demonstration Program *"));
299 Serial.println(F(
"* *"));
300 Serial.println(F(
"* This program demonstrates how to receive data *"));
301 Serial.println(F(
"* from the following ADCs: *"));
302 Serial.println(F(
"* LTC2312-12 *"));
303 Serial.println(F(
"* LTC2312-14 *"));
304 Serial.println(F(
"* LTC2313-12 *"));
305 Serial.println(F(
"* LTC2313-14 *"));
306 Serial.println(F(
"* LTC2314-14 *"));
307 Serial.println(F(
"* LTC2315-12 *"));
308 Serial.println(F(
"* *"));
309 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
310 Serial.println(F(
"* *"));
311 Serial.println(F(
"*****************************************************************"));
318 Serial.println(F(
"*************************"));
319 Serial.println(F(
"1-Read ADC Input"));
320 Serial.println(F(
"2-Select Number of bits (Default is 12 bits)"));
321 Serial.println(F(
"3-Select Vref (Default is 4.096V)"));
322 Serial.println(F(
"4-Select Part (Default is LTC2314/2315)\n"));
323 Serial.print(F(
"Enter a command: "));
LTC2312-12: 12-Bit, 500Ksps ADC.
float LTC2315_code_to_voltage(uint16_t adc_code, uint8_t shift, float vref)
Calculates the LTC2315 input voltage given the binary data and lsb weight.
static void print_user_command(uint8_t menu)
unsigned char user_command
#define LTC2315_CS
Define the SPI CS pin.
static uint8_t LTC2315_JP3
Default set for 4.096V (Vdd = 5V)
Header File for Linduino Libraries and Demo Code.
static uint8_t LTC2315_shift
static void setup()
Initialize Linduino.
void LTC2315_read(uint8_t cs, uint16_t *adc_code)
Reads the LTC2315 and returns 32-bit data in offset binary format.
static void menu_4_select_part()
Select part.
static void print_prompt()
Prints main menu.
static void loop()
Repeats Linduino loop.
static void menu_1_read_input()
Read channel.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
static void menu_3_select_vref()
Select vref.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
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...
static int32_t display_code
static float LTC2315_vref
static void menu_2_select_bits()
Select number of bits.
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
static void print_title()
Prints the title block when program first starts.
static uint8_t LTC2315_bits
Default set for 12 bits.