66 #define LTC7841_I2C_ADDRESS 0x20 101 if (Serial.available())
105 switch (user_command)
133 Serial.print(F(
"Enter voltage: "));
139 Serial.print(F(
"Enter voltage: "));
145 Serial.print(F(
"Enter voltage: "));
184 Serial.print(F(
"15\n"));
185 Serial.println(F(
"Incorrect Option"));
200 Serial.print(F(
"\n***************************************************************\n"));
201 Serial.print(F(
"* DC2978A Control Program *\n"));
202 Serial.print(F(
"* *\n"));
203 Serial.print(F(
"* This program provides a simple interface to control the *\n"));
204 Serial.print(F(
"* the LTC7841 on the DC2978A Demo Board *\n"));
205 Serial.print(F(
"* *\n"));
206 Serial.print(F(
"* Set the baud rate to 115200 and select the newline terminator.*\n"));
207 Serial.print(F(
"* *\n"));
208 Serial.print(F(
"*****************************************************************\n"));
215 Serial.print(F(
"\n"));
216 Serial.print(F(
" 1 - Reset\n"));
217 Serial.print(F(
" 2 - Clear faults\n"));
218 Serial.print(F(
" 3 - Turn off output\n"));
219 Serial.print(F(
" 4 - Turn on output\n"));
220 Serial.print(F(
" 5 - Margin high output\n"));
221 Serial.print(F(
" 6 - Margin low output\n"));
222 Serial.print(F(
" 7 - Set output voltage\n"));
223 Serial.print(F(
" 8 - Set output high voltage\n"));
224 Serial.print(F(
" 9 - Set output low voltage\n"));
225 Serial.print(F(
" 10 - Read output voltage\n"));
226 Serial.print(F(
" 11 - Read input voltage\n"));
227 Serial.print(F(
" 12 - Read output current\n"));
228 Serial.print(F(
" 13 - Read input current\n"));
229 Serial.print(F(
" 14 - Fast slew\n"));
230 Serial.print(F(
" 15 - Normal slew\n"));
231 Serial.print(F(
" 16 - Slow slew\n"));
233 Serial.print(F(
" 17 - Read status\n"));
235 Serial.print(F(
"\n Enter a command number: "));
288 double v_clamp = max(0.0,
min(v, 48.0));
289 double v_scale = (100.0 * v_clamp / 48.0) / 0.2;
290 uint16_t w = (uint16_t) v_scale;
299 double v_clamp = max(0.0,
min(v, 48.0));
300 double v_scale = (100.0 * v_clamp / 48.0) / 0.2;
301 uint16_t w = (uint16_t) v_scale;
310 double v_clamp = max(0.0,
min(v, 48.0));
311 double v_scale = (100.0 * v_clamp / 48.0) / 0.2;
312 uint16_t w = (uint16_t) v_scale;
326 v = 10.0E-3 * ((double) w);
327 Serial.print(F(
"VOUT: "));
340 v = 10.0E-3 * ((double) w);
341 Serial.print(F(
"VIN: "));
355 v = 50.0E-6 * R * ((double) w);
356 Serial.print(F(
"IIN: "));
370 v = 50.0E-6 * R * ((double) w);
371 Serial.print(F(
"IOUT: "));
394 Serial.print(F(
"STATUS WORD: "));
#define LTC7841_READ_VOUT
static uint8_t ltc7841_i2c_address
void sendByte(uint8_t address, uint8_t command)
SMBus send byte command.
static void set_output_high_voltage(double v)
Set output high voltage.
unsigned char user_command
void writeWord(uint8_t address, uint8_t command, uint16_t data)
SMBus write word command.
static void turn_on()
Turn on output.
#define LTC7841_STATUS_NONE
#define LTC7841_STATUS_COM
#define LTC7841_STATUS_TEMP
static void reset()
Reset.
static void margin_low()
Margin low output.
Header File for Linduino Libraries and Demo Code.
void writeByte(uint8_t address, uint8_t command, uint8_t data)
SMBus write byte command.
static void loop()
Main Linduino Loop.
#define LTC7841_STATUS_VOUT
static void read_output_current()
Read output current.
#define LTC7841_STATUS_PGOODB
#define LTC7841_STATUS_VOUT_OV
static void set_output_low_voltage(double v)
Set output low voltage.
#define LTC7841_CONFIG_NORMAL_SLEW
static void clear_faults()
Clear faults.
#define LTC7841_MFR_VOUT_COMMAND
static void read_output_voltage()
Read output voltage.
static void print_prompt()
Prints main menu.
static void set_output_voltage(double v)
Set output voltage.
#define LTC7841_READ_IOUT
#define LTC7841_MFR_RESET
#define LTC7841_CONFIG_SLOW_SLEW
#define LTC7841_STATUS_WORD
#define LTC7841_MFR_CONFIG
uint8_t readByte(uint8_t address, uint8_t command)
SMBus read byte command.
#define LTC7841_OPERATION
#define LTC7841_OPERATION_OFF
#define LTC7841_STATUS_OFF
#define LTC7841_OPERATION_ON
static void setup()
Initialize Linduino.
static void turn_off()
Turn off output.
LTC SMBus Support: Implementation for a shared SMBus layer.
#define LTC7841_CONFIG_FAST_SLEW
#define LTC7841_I2C_ADDRESS
Header for LTC7841: PolyPhase Synchronous Boost Controller with PMBus Interface.
#define LTC7841_OPERATION_MARGIN_LOW
static void margin_high()
Margin high output.
static LT_SMBusNoPec * smbus
static void set_slew(uint8_t s)
Set slew.
#define LTC7841_OPERATION_MARGIN_HIGH
#define LTC7841_MFR_VOUT_MARGIN_LOW
static void read_input_current()
Read input current.
static void read_input_voltage()
Read input voltage.
static void print_title()
Prints the title block when program first starts.
#define LTC7841_MFR_VOUT_MARGIN_HIGH
static void read_status()
Read status.
uint16_t readWord(uint8_t address, uint8_t command)
SMBus read word command.