109 Serial.begin(115200);
120 if (Serial.available())
123 if (user_command !=
'm')
124 Serial.println(user_command);
125 switch (user_command)
131 Serial.println(
" Invalid Option");
155 Serial.print(F(
" Received Code: b"));
156 Serial.println(adc_code, BIN);
161 Serial.print(F(
" Equivalent voltage: "));
162 Serial.print(adc_voltage, 4);
163 Serial.println(F(
"V"));
171 Serial.println(F(
"*****************************************************************"));
172 Serial.println(F(
"* DC1571A Demonstration Program *"));
173 Serial.println(F(
"* *"));
174 Serial.println(F(
"* This program demonstrates how to receive data *"));
175 Serial.println(F(
"* from the following ADCs: *"));
176 Serial.println(F(
"* LTC2381-16 *"));
177 Serial.println(F(
"* LTC2382-16 *"));
178 Serial.println(F(
"* LTC2383-16 *"));
179 Serial.println(F(
"* *"));
180 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
181 Serial.println(F(
"* *"));
182 Serial.println(F(
"*****************************************************************"));
189 Serial.println(F(
"*************************"));
190 Serial.println(F(
"1-Read ADC Input"));
191 Serial.print(F(
"Enter a command:"));
unsigned char user_command
float LTC2383_code_to_voltage(int16_t adc_code, float vref)
Calculates the LTC2383 input voltage given the binary data and lsb weight.
Header File for Linduino Libraries and Demo Code.
static void setup()
Initialize Linduino.
static void print_title()
Prints the title block when program first starts.
static void loop()
Repeats Linduino loop.
#define LTC2383_CS
Define the SPI CS pin.
static void menu_1_read_input()
Read channel.
static void print_prompt()
Prints main menu.
LTC2381-16: 16-Bit, 250Ksps ADC.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
static void print_user_command(uint8_t menu)
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
void LTC2383_read(uint8_t cs, uint16_t *ptr_adc_code)
Reads the LTC2383 and returns 16-bit data in 2's complement format.
static float LTC2383_vref
void quikeval_I2C_init(void)
Initializes Linduino I2C port.