110 Serial.begin(115200);
122 if (Serial.available())
125 if (user_command !=
'm')
126 Serial.println(user_command);
127 switch (user_command)
136 Serial.println(
" Invalid Option");
162 display_code = display_code & 0xFFFFF;
164 Serial.print(F(
" Received Code: b"));
165 Serial.println(display_code, BIN);
169 Serial.print(F(
" Equivalent voltage: "));
170 Serial.print(adc_voltage, 4);
171 Serial.println(F(
"V"));
181 Serial.println(F(
" 0 = No Gain Compression"));
182 Serial.println(F(
" 1 = Gain Compression"));
183 Serial.print(F(
" Enter a Command, based upon the position of jumper JP6: "));
186 Serial.println(user_command);
187 switch (user_command)
190 Serial.println(F(
" No Gain compression"));
194 Serial.println(F(
" Gain compression"));
199 Serial.println(
" Invalid Option");
211 Serial.println(F(
"*****************************************************************"));
212 Serial.println(F(
"* DC1925A Demonstration Program *"));
213 Serial.println(F(
"* *"));
214 Serial.println(F(
"* This program demonstrates how to receive data *"));
215 Serial.println(F(
"* from the following ADCs: *"));
216 Serial.println(F(
"* LTC2376-20 *"));
217 Serial.println(F(
"* LTC2377-20 *"));
218 Serial.println(F(
"* LTC2378-20 *"));
219 Serial.println(F(
"* *"));
220 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
221 Serial.println(F(
"* *"));
222 Serial.println(F(
"*****************************************************************"));
229 Serial.println(F(
"*************************"));
230 Serial.println(F(
"1-Read ADC Input"));
231 Serial.println(F(
"2-Select No Gain Compression / Gain Compression (default is no compression)"));
232 Serial.print(F(
"Enter a command:"));
unsigned char user_command
Header File for Linduino Libraries and Demo Code.
static void print_title()
Prints the title block when program first starts.
static uint8_t LTC2378_dgc
Default set for no gain compression.
static void print_prompt()
Prints main menu.
#define LTC2378_CS
Define the SPI CS pin.
float LTC2378_code_to_voltage(int32_t adc_code, uint8_t gain_compression, float vref)
Calculates the LTC2378 input voltage given the binary data and lsb weight.
LTC2376-20: 20-Bit, 250Ksps ADC LTC2377-20: 20-Bit, 500Ksps ADC LTC2378-20: 20-Bit, 1Msps ADC.
static void menu_1_read_input()
Read channel.
void LTC2378_read(uint8_t cs, int32_t *ptr_adc_code)
Reads the LTC2378 and returns 32-bit data in 2's complement format.
static void print_user_command(uint8_t menu)
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
static float LTC2378_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 void menu_2_select_gain_compression()
Select gain compression.
static void loop()
Repeats Linduino loop.
static uint8_t LTC2378_bits
Default set for 20 bits.
static void setup()
Initialize Linduino.