129 Serial.begin(115200);
140 if (Serial.available())
143 if (user_command !=
'm')
144 Serial.println(user_command);
145 switch (user_command)
154 Serial.println(
" Invalid Option");
181 display_code = display_code & 0xFFFF;
183 display_code = display_code & 0x3FFFF;
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"));
205 Serial.println(F(
" 16 bits selected"));
207 Serial.println(F(
" 18 bits selected"));
209 Serial.println(F(
" 16 = 2338-16"));
210 Serial.println(F(
" 18 = 2338-18"));
211 Serial.print(F(
" Enter a Command, based upon the resolution of the part under test: "));
214 Serial.println(user_command);
215 switch (user_command)
225 Serial.println(
" Invalid Option");
237 Serial.println(F(
"*****************************************************************"));
238 Serial.println(F(
"* DC1908A Demonstration Program *"));
239 Serial.println(F(
"* *"));
240 Serial.println(F(
"* This program demonstrates how to receive data *"));
241 Serial.println(F(
"* from the following ADCs: *"));
242 Serial.println(F(
"* LTC2326-16 *"));
243 Serial.println(F(
"* LTC2326-18 *"));
244 Serial.println(F(
"* LTC2327-16 *"));
245 Serial.println(F(
"* LTC2327-18 *"));
246 Serial.println(F(
"* LTC2328-16 *"));
247 Serial.println(F(
"* LTC2328-18 *"));
248 Serial.println(F(
"* LTC2336-18 *"));
249 Serial.println(F(
"* LTC2337-18 *"));
250 Serial.println(F(
"* LTC2338-18 *"));
251 Serial.println(F(
"* *"));
252 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
253 Serial.println(F(
"* *"));
254 Serial.println(F(
"*****************************************************************"));
261 Serial.println(F(
"*************************"));
262 Serial.println(F(
"1-Read ADC Input"));
263 Serial.println(F(
"2-Select Number of bits (Default is 18 bits)\n"));
264 Serial.print(F(
"Enter a command:"));
unsigned char user_command
Header File for Linduino Libraries and Demo Code.
LTC2326-16: 16-Bit, 250ksps Pseudo-differential input ADC.
static void loop()
Repeats Linduino loop.
static void menu_2_select_bits()
Select number of bits.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
static void print_user_command(uint8_t menu)
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
static float LTC2338_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 int32_t display_code
static void menu_1_read_input()
Read channel.
void LTC2338_read(uint8_t cs, int32_t *ptr_adc_code)
Reads the LTC2338 and returns 32-bit data in 2's complement format.
static void setup()
Initialize Linduino.
static void print_prompt()
Prints main menu.
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
float LTC2338_code_to_voltage(int32_t adc_code, float vref)
Calculates the LTC2338 input voltage given the binary data and lsb weight.
static void print_title()
Prints the title block when program first starts.
#define LTC2338_CS
Define the SPI CS pin.
static uint8_t LTC2338_bits
Default set for 18 bits.