71 #define LTC3886_I2C_ADDRESS 0x4F 72 #define MFR_PWM_COMP 0xD3 // PMBus command for setting the compensation network gm and Rth 73 #define PAGE 0x00 // PMBus command for selecting output 93 static float ith_vals[] = {0, .25, .5, .75, 1, 1.25, 1.5, 1.75, 2, 2.5, 3, 3.5, 4, 4.5, 5, 5.5, 6, 7, 8, 9, 11, 13, 15, 17, 20, 24, 28, 32, 38, 46, 54, 62};
94 static float gm_vals[] = {1, 1.68, 2.35, 3.02, 3.69, 4.36, 5.04, 5.73};
95 static uint8_t
ith_vals_hex[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07,0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F, 0x10, 0x11, 0x12, 0x13, 0x14, 0x15, 0x16, 0x17,0x18, 0x19, 0x1A, 0x1B, 0x1C, 0x1D, 0x1E, 0x1F};
96 static uint8_t
gm_vals_hex[] = {0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07};
102 Serial.begin(115200);
115 if (Serial.available())
121 Serial.print(F(
"\nEnter desired gm (1-5.73), this will be rounded to nearest legal value:\n"));
134 Serial.print(F(
"\nEnter desired ith (0-62), this will be rounded to nearest legal value:\n"));
173 Serial.print(F(
"\n*****************************************************************\n"));
174 Serial.print(F(
"* LTC3886 Adjustable Compensation Program *\n"));
175 Serial.print(F(
"* *\n"));
176 Serial.print(F(
"* This is an example program for adjusting LTC3886 compensation.*\n"));
177 Serial.print(F(
"* *\n"));
178 Serial.print(F(
"*****************************************************************\n"));
185 Serial.print(F(
"\n 1-Adjust gm\n"));
186 Serial.print(F(
" 2-Adjust ith\n"));
187 Serial.print(F(
" 3-Switch Channel"));
201 Serial.print(F(
"\nCH"));
203 Serial.print(F(
" "));
204 Serial.print(F(
"Configuration, (gm, ith): ("));
206 Serial.print(F(
", "));
208 Serial.print(F(
")"));
LTC SMBus Support: API for a shared SMBus layer.
static float gm_hex2decimal(uint8_t gm)
Converts gm demo circuit hex value to its decimal equivalent.
static uint8_t gm_decimal2hex(float gm)
Converts gm decimal value to the demo circuit hex equivalent.
static void loop()
Repeats Linduino loop.
LTC SMBus Support: Implementation for a shared SMBus layer.
LTC SMBus Support: Implementation for a shared SMBus layer.
Header File for Linduino Libraries and Demo Code.
void writeByte(uint8_t address, uint8_t command, uint8_t data)
SMBus write byte command.
static float gm_nearest_legal_value(float gm)
Rounds decimal input gm to nearest legal decimal value.
static void print_prompt()
Prints main menu.
#define LTC3886_I2C_ADDRESS
static float ith_nearest_legal_value(float ith)
Rounds decimal input ith to nearest legal decimal value.
TwoWire.h - TWI/I2C library for Arduino & Wiring Copyright (c) 2006 Nicholas Zambetti.
static void print_title()
Prints the title block when program first starts.
LT_I2CBus: Routines to communicate to I2C by Wire Library.
static void print_comp_config()
Prints current compensation configuration and saves ith, gm, and configuration hex values...
uint8_t readByte(uint8_t address, uint8_t command)
SMBus read byte command.
static void setup()
Initialize Linduino.
static uint8_t ltc3886_i2c_address
static float ith_hex2decimal(uint8_t ith)
Converts ith demo circuit hex value to its decimal equivalent.
LTC SMBus Support: Implementation for a shared SMBus layer.
static uint8_t ith_decimal2hex(float ith)
Converts ith decimal value to the demo circuit hex equivalent.
static uint8_t ith_vals_hex[]
static LT_SMBusNoPec * smbus
static uint8_t gm_vals_hex[]
LTC PMBus Support: Math conversion routines.
static uint8_t comp_config
LTC SMBus Support: Implementation for a shared SMBus layer.