52 #include <LiquidCrystal.h> 74 int8_t
volts[5] = {0, 0, 0, 0, 0};
75 int8_t
hex[5] = {0x00, 0x00, 0x00, 0x00,0x02};
94 lcd.print(
"Voltage Source");
100 lcd.print(
"No Demo Board");
102 lcd.print(
" Detected");
113 lcd.print(
"HEX Mode");
141 if ((input <= 170) && (input >= 120))
143 if ((input <= 350) && (input >= 300))
145 if ((input <= 550) && (input >= 450))
147 if ((input <= 800) && (input >= 700))
190 voltage +=
volts[0]*.0001;
191 voltage +=
volts[1]*.001;
192 voltage +=
volts[2]*.01;
193 voltage +=
volts[3]*.1;
212 tx[2] =
data.byte[2];
213 tx[1] =
data.byte[1];
214 tx[0] =
data.byte[0];
234 lcd.print(
"Voltage Source");
326 lcd.print(
"Voltage Source");
330 lcd.print(
"DAC code:0x");
350 lcd.setCursor(15, 1);
352 lcd.setCursor(14, 1);
354 lcd.setCursor(13, 1);
356 lcd.setCursor(12, 1);
358 lcd.setCursor(11, 1);
413 code += (uint32_t)
hex[0];
414 code += ((uint32_t)
hex[1])<<4;
415 code += ((uint32_t)
hex[2])<<8;
416 code += ((uint32_t)
hex[3])<<12;
417 code += ((uint32_t)
hex[4])<<16;
422 tx[2] =
data.byte[2];
423 tx[1] =
data.byte[1];
424 tx[0] =
data.byte[0];
static int32_t LTC2756_offset
#define LTC2756_BIPOLAR_N5_P5
Header File for Linduino Libraries and Demo Code.
#define LTC2756_WRITE_CODE
static int8_t demo_board_connected
static void display_hex()
union LT_union_int32_4bytes data
static void set_voltage_hex()
LiquidCrystal lcd(RS, E, D4, D5, D6, D7)
#define input(pin)
Return the state of pin "pin".
LTC2756: Serial 18-Bit SoftSpan IOUT DAC.
void quikeval_SPI_init(void)
Configure the SPI port for 4Mhz SCK.
int8_t discover_demo_board(char *demo_name)
Read the ID string from the EEPROM and determine if the correct board is connected.
LT_SPI: Routines to communicate with ATmega328P's hardware SPI port.
static void set_voltage()
LT_I2C: Routines to communicate with ATmega328P's hardware I2C port.
uint32_t LTC2756_voltage_to_code(float dac_voltage, float LTC2756_lsb, int32_t LTC2756_offset)
Converts voltage to code.
#define LTC2756_CS
Define the CS pin.
char demo_name[]
Demo Board Name stored in QuikEval EEPROM.
void quikeval_SPI_connect()
Connect SPI pins to QuikEval connector through the Linduino MUX. This will disconnect I2C...
void quikeval_I2C_init(void)
Initializes Linduino I2C port.
void LTC2756_transfer_4bytes(uint8_t cs, uint8_t *tx, uint8_t *rx)
Transfers four bytes to the LTC2756.
static void display_decimal()
#define LTC2756_WRITE_SPAN
static int8_t read_switches()