125 Serial.begin(115200);
136 if (Serial.available())
139 if (user_command !=
'm')
140 Serial.println(user_command);
141 switch (user_command)
150 Serial.println(
"Invalid Option");
177 display_code = display_code & 0xFFFF;
179 display_code = display_code & 0x3FFFF;
181 Serial.print(F(
" Received Code: b"));
182 Serial.println(display_code, BIN);
187 Serial.print(F(
" Equivalent voltage: "));
188 Serial.print(adc_voltage, 4);
189 Serial.println(F(
"V"));
201 Serial.println(F(
" 16 bits selected"));
203 Serial.println(F(
" 18 bits selected"));
205 Serial.println(F(
" 16 = 2370-16"));
206 Serial.println(F(
" 18 = 2370-18"));
207 Serial.print(F(
" Enter a Command, based upon the resolution of the part under test: "));
210 Serial.println(user_command);
211 switch (user_command)
215 Serial.println(F(
" 16 bits selected"));
219 Serial.println(F(
" 18 bits selected"));
223 Serial.println(
" Invalid Option");
235 Serial.println(F(
"*****************************************************************"));
236 Serial.println(F(
"* DC1796A Demonstration Program *"));
237 Serial.println(F(
"* *"));
238 Serial.println(F(
"* This program demonstrates how to receive data *"));
239 Serial.println(F(
"* from the following ADCs: *"));
240 Serial.println(F(
"* LTC2364-16 *"));
241 Serial.println(F(
"* LTC2364-18 *"));
242 Serial.println(F(
"* LTC2367-16 *"));
243 Serial.println(F(
"* LTC2367-18 *"));
244 Serial.println(F(
"* LTC2368-16 *"));
245 Serial.println(F(
"* LTC2368-18 *"));
246 Serial.println(F(
"* LTC2369-18 *"));
247 Serial.println(F(
"* LTC2370-16 *"));
248 Serial.println(F(
"* *"));
249 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
250 Serial.println(F(
"* *"));
251 Serial.println(F(
"*****************************************************************"));
258 Serial.println(F(
"*************************"));
259 Serial.println(F(
"1-Read ADC Input"));
260 Serial.println(F(
"2-Select Number of bits (Default is 18 bits)\n"));
261 Serial.print(F(
"Enter a command:"));
#define LTC2370_CS
Define the SPI CS pin.
static void menu_1_read_input()
Read channel.
unsigned char user_command
void LTC2370_read(uint8_t cs, uint32_t *ptr_adc_code)
Reads the LTC2370 and returns 32-bit data in offset binary format.
static void setup()
Initialize Linduino.
static void loop()
Repeats Linduino loop.
static void menu_2_select_bits()
Select number of bits.
Header File for Linduino Libraries and Demo Code.
static void print_title()
Prints the title block when program first starts.
static void print_prompt()
Prints main menu.
LTC2364-16: 16-Bit, 250Ksps ADC.
float LTC2370_code_to_voltage(uint32_t adc_code, float vref)
Calculates the LTC2370 input voltage given the binary data and lsb weight.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
static uint8_t LTC2370_bits
Default set for 18 bits.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
static float LTC2370_vref
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 void print_user_command(uint8_t menu)
static int32_t display_code
void quikeval_I2C_init(void)
Initializes Linduino I2C port.