110 Serial.begin(115200);
121 if (Serial.available())
124 if (user_command !=
'm')
125 Serial.println(user_command);
126 switch (user_command)
135 Serial.println(
" Invalid Option");
173 display_code = display_code & 0xFFFF;
175 display_code = display_code & 0x3FFFF;
177 Serial.print(F(
" Received Code: b"));
178 Serial.println(display_code, BIN);
183 Serial.print(F(
" Equivalent voltage: "));
184 Serial.print(adc_voltage, 4);
185 Serial.println(F(
"V"));
197 Serial.println(F(
" 16 bits selected"));
199 Serial.println(F(
" 18 bits selected"));
201 Serial.println(F(
" 16 = 2328-16"));
202 Serial.println(F(
" 18 = 2328-18"));
203 Serial.print(F(
" Enter a Command, based upon the resolution of the part under test: "));
206 Serial.println(user_command);
207 switch (user_command)
217 Serial.println(
" Invalid Option");
229 Serial.println(F(
"*****************************************************************"));
230 Serial.println(F(
"* DC2405A Demonstration Program *"));
231 Serial.println(F(
"* *"));
232 Serial.println(F(
"* This program demonstrates how to receive data from an *"));
233 Serial.println(F(
"* isolated LTC2328-18 ADC using the LTM2893 Isolated ADC *"));
234 Serial.println(F(
"* Serial Interface module. *"));
235 Serial.println(F(
"* *"));
236 Serial.println(F(
"* Set the baud rate to 115200 and select the newline terminator.*"));
237 Serial.println(F(
"* *"));
238 Serial.println(F(
"*****************************************************************"));
245 Serial.println(F(
"*************************"));
246 Serial.println(F(
"1-Read ADC Input"));
248 Serial.print(F(
"Enter a command:"));
unsigned char user_command
#define output_high(pin)
Set "pin" high.
Header File for Linduino Libraries and Demo Code.
static void menu_1_read_input()
Read channel.
static void print_title()
Prints the title block when program first starts.
static void setup()
Initialize Linduino.
static float LTC2328_vref
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
static void menu_2_select_bits()
Select number of bits.
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
float LTM2893_code_to_voltage(int32_t adc_code, float vref)
Calculates the LTM2893 input voltage given the binary data and lsb weight.
static void loop()
Repeats Linduino loop.
static void print_user_command(uint8_t menu)
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
void LTM2893_read(uint8_t cs, int32_t *ptr_adc_code)
Reads the LTM2893 and returns 32-bit data in 2's complement format.
#define LTM2893_CS
Define the SPI CS pin.
LTM2893-1: 100MHz ADC SPI Isolator.
static uint8_t LTC2328_bits
Default set for 18 bits.
static void print_prompt()
Prints main menu.