62 #define LTC2970_I2C_ADDRESS 0x5B //global 7-bit address 113 if (Serial.available())
117 switch (user_command)
121 Serial.print(F(
"\n****INITIALIZING THE LTC2970****\n"));
126 Serial.print(F(
"\n****ENABLE LTC2970 CHANNEL 0 AND CHANNEL 1****\n"));
135 Serial.print(F(
"\n****SOFT CONNECT LTC2970 DAC0 and DAC1****\n"));
141 Serial.print(F(
"\n****SERVO CHANNEL 0 and 1 VOLTAGES 10% LOW****\n"));
147 Serial.print(F(
"\n****SERVO CHANNEL 0 and 1 VOLTAGES TO NOMINAL****\n"));
153 Serial.print(F(
"\n****SERVO CHANNEL 0 and 1 VOLTAGES 10% HIGH****\n"));
159 Serial.print(F(
"\n****ADC CH_0 VOLTAGE (HEX VALUE)\n"));
161 Serial.print(((return_val & 0x7FFF)*500e-6), DEC);
162 Serial.print(F(
"\t(0x"));
163 Serial.print(return_val, HEX);
164 Serial.println(F(
")"));
166 Serial.print(F(
"\n****ADC CH_1 VOLTAGE (HEX VALUE)\n"));
169 Serial.print(5.035 - 5.025*((return_val & 0x7FFF)*500e-6), DEC);
170 Serial.print(F(
"\t(0x"));
171 Serial.print(return_val, HEX);
172 Serial.println(F(
")"));
174 Serial.print(F(
"\n****ADC CH_0 CURRENT (HEX VALUE)\n"));
178 Serial.print((((return_val & 0x7FFF)*500e-6)/0.0215), DEC);
179 Serial.print(F(
"\t(0x"));
180 Serial.print(return_val, HEX);
181 Serial.println(F(
")"));
183 Serial.print(F(
"\n****ADC CH_1 CURRENT (HEX VALUE)\n"));
186 return_val = ((return_val & 0x4000) == 0x4000) ? 0x0000 : return_val;
188 Serial.print((0.965*(return_val & 0x7FFF)*500e-6), DEC);
189 Serial.print(F(
"\t(0x"));
190 Serial.print(return_val, HEX);
191 Serial.println(F(
")"));
195 Serial.print(F(
"\n****PRINT FAULTS, CLEAR LATCHED FAULTS \n"));
200 Serial.print(F(
"\n****PRINT DIE TEMPERATURE \n"));
205 Serial.println(F(
"Incorrect Option"));
220 Serial.print(F(
"\n***************************************************************\n"));
221 Serial.print(F(
"* DC2467 Control Program *\n"));
222 Serial.print(F(
"* *\n"));
223 Serial.print(F(
"* This program provides a simple interface to control the *\n"));
224 Serial.print(F(
"* the DC2467 regulators through the LTC2970 *\n"));
225 Serial.print(F(
"* REQUIRES +12V POWER TO THE LINDUINO *\n"));
226 Serial.print(F(
"* *\n"));
227 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
228 Serial.print(F(
"* *\n"));
229 Serial.print(F(
"*****************************************************************\n"));
236 Serial.print(F(
"\n"));
237 Serial.print(F(
" 1 - Reset the LTC2970, Disable Regulators\n"));
238 Serial.print(F(
" 2 - Enable Channel 0 and Channel 1; DACs disconnected\n"));
239 Serial.print(F(
" 3 - Soft-Connect DAC0 and DAC1, and Confirm Connection\n"));
240 Serial.print(F(
" 4 - Servo Channel 0 and Channel 1 Voltages 10% low\n"));
241 Serial.print(F(
" 5 - Servo Channel 0 and Channel 1 Voltages to nominal\n"));
242 Serial.print(F(
" 6 - Servo Channel 0 and Channel 1 Voltages 10% high\n"));
243 Serial.print(F(
" 7 - Print Channel 0 & 1 Voltages and Currents\n"));
244 Serial.print(F(
" 8 - Print Fault Register Contents\n"));
245 Serial.print(F(
" 9 - Print LTC2970 Temperature\n"));
246 Serial.print(F(
"\nEnter a command number:"));
unsigned char user_command
#define LTC2970_CH1_A_SERVO
void writeWord(uint8_t address, uint8_t command, uint16_t data)
SMBus write word command.
static void print_prompt()
Prints main menu.
static void setup()
Initialize Linduino.
Header File for Linduino Libraries and Demo Code.
static void print_title()
Prints the title block when program first starts.
#define LTC2970_CH0_A_SERVO
void ltc2970_print_die_temp(LT_SMBus *smbus, uint8_t ltc2970_i2c_address)
Prints die temperature on the LTC2970.
void ltc2970_read_faults(LT_SMBus *smbus, uint8_t ltc2970_i2c_address)
Read FAULT, FAULT_LA, and FAULT_LA_INDEX registers print the results.
#define LTC2970_CH0_B_ADC
#define LTC2970_CH0_A_ADC
static LT_SMBusNoPec * smbus
static uint8_t ltc2970_i2c_address
static uint16_t servo1_value_hi
void ltc2970_dac_disconnect(LT_SMBus *smbus, uint8_t ltc2970_i2c_address, int dac_number)
Disconnect a DAC from its channel.
#define LTC2970_I2C_ADDRESS
void ltc2970_servo_to_adc_val(LT_SMBus *smbus, uint8_t ltc2970_i2c_address, int channel_number, uint16_t code)
Servo once to a given ADC value.
#define LTC2970_CH0_A_IDAC
LTC SMBus Support: Implementation for a shared SMBus layer.
static uint16_t servo0_value_low
Header for LTC2970: Dual I2C Power Supply Monitor and Margining Controller.
static void ltc2970_configure()
Writes configuration values to the LTC2970 registers.
static uint16_t servo1_value_nom
int ltc2970_soft_connect_dac(LT_SMBus *smbus, uint8_t ltc2970_i2c_address, int dac_number)
soft-connect DACn to its controlled node
static uint16_t servo0_value_nom
#define LTC2970_CH1_B_ADC
static uint16_t servo0_value_hi
static uint16_t servo1_value_low
#define LTC2970_CH1_A_IDAC
static void loop()
Main Linduino loop.
#define LTC2970_CH1_A_ADC
void ltc2970_gpio_up(LT_SMBus *smbus, uint8_t ltc2970_i2c_address, int gpio_number)
Set GPIO_n high.
uint16_t readWord(uint8_t address, uint8_t command)
SMBus read word command.