67 #define _EASYSMU_ID_STRING "Linear Technology, EasySMU-1.01 DC2591A" 85 #define _EASYSMU_VOLTAGE_DAC LTC2655_DAC_A 87 #define _EASYSMU_CURRENT_PULLUP_DAC LTC2655_DAC_B 89 #define _EASYSMU_CURRENT_PULLDOWN_DAC LTC2655_DAC_C 91 #define _EASYSMU_ENABLE_OUTPUT_DAC LTC2655_DAC_D 97 #define _LTC2485_CONVERSION_TIME_1X 150 99 #define _LTC2485_CONVERSION_TIME_2X 75 101 #define _LTC2485_CONVERSION_TIME _LTC2485_CONVERSION_TIME_1X 105 #define EEPROM_FACTORY_CAL_STATUS_ADDRESS EEPROM_CAL_STATUS_ADDRESS+sizeof(eeprom_data_union) 107 #define EEPROM_FACTORY_CAL_INFO_ADDRESS EEPROM_FACTORY_CAL_STATUS_ADDRESS+sizeof(eeprom_data_union) 111 #define _SOURCE_ONLY 1 112 #define _SOURCE_AND_SINK 0 113 #define _SINK_ONLY -1 117 #define CAL_INFO_STRLEN 32 163 uint16_t currentSetValue,
165 float *fltUserOutput,
166 int32_t *lngVadc_code,
167 int32_t *lngIadc_code
270 int32_t *temperature_of_Iadc_code
283 EasySMU(uint8_t EEPROM_I2C_address_param,
284 uint8_t DAC_I2C_address_param,
285 uint8_t ADC_Vsense_I2C_address_param,
286 uint8_t ADC_Isense_I2C_address_param
float current_source_pullup_LSB
the current of one LSB in amps from the current pullup DAC channel
float MeasureCurrent()
Measure the current (with ADC).
float MeasureVoltage()
Measure the voltage (with ADC).
LTC2655: Quad I2C 16-/12-Bit Rail-to-Rail DACs with 10ppm/C Max Reference.
uint8_t DAC_I2C_address_
I2C address of LTC2655 used to control voltage and current settings.
int32_t current_measure_offset
the code from the current ADC that corresponds to 0A at the output
The EasySMU class contains functions for interacting with the EasySMU source measurement unit...
This struct holds all of the calibration data, i.e. offset integers, LSB floats, etc. The eeprom_data_union contains a byte_array that is used to write and read this data to/from the EEPROM.
float voltage_source_LSB
the voltage of one LSB in volts (from the voltage channel of the DAC)
void codeStepVoltageSourceSetting(int16_t stepSize)
Increase or decrease the voltage source setting.
LTC2485: 24-Bit Delta Sigma ADC with Easy Drive Input Current Cancellation and I2C Interface...
void fltStepCurrentSourceSetting(float fltStepSize)
Increase or decrease the current source setting by this value in amps.
int16_t WriteCalibration()
Write calibration to EEPROM.
float flt_measured_current_
measured current (in amps)
int8_t MeasureVoltageCurrent()
Measure the voltage and current (with ADCs).
float current_measure_output_resistance
This value is used to modify the output current measurement result based on output voltage...
int16_t IsPresent()
Check if this EasySMU is present.
int8_t codeSetCommitVoltageSource(int32_t lngVoltageSetParam)
Set and commit the voltage source setting immediately.
int16_t current_source_pulldown_offset
current DAC code that ideally would result in 0A at output, if the output current could be configured...
int8_t fltSetCommitVoltageSource(float fVoltage)
Commit the voltage source setting immediately to this float value.
int16_t ReadCalibration()
Read calibration from EEPROM.
uint8_t ADC_Vsense_I2C_address_
I2C address of LTC2485 used to measure output voltage.
float fltReadCurrentSourceSetting()
Read the current source setting.
float float_current_source_setting_
Current source setting.
union EasySMU::eeprom_data_union eeprom
int32_t Iadc_code_
raw code of current ADC
int8_t SetCalibration()
Perform calibration.
void DisableOutput()
Disables the LT1970 output.
EasySMU(uint8_t EEPROM_I2C_address_param, uint8_t DAC_I2C_address_param, uint8_t ADC_Vsense_I2C_address_param, uint8_t ADC_Isense_I2C_address_param)
EasySMU constructor. Remember each EasySMU instance has unique I2C addresses, so this configures each...
float voltage_measure_LSB
the voltage of one LSB in volts from the voltage ADC
float flt_measured_voltage_
measured voltage (in volts)
float fltReadVoltageSourceSetting()
Read the voltage source setting.
float current_measure_LSB
the current of one LSB in amps from the current ADC
void ResetCalibration()
Reset the calibration to a typical value.
int8_t SetCalibrationSinglePoint(uint16_t voltageSetValue, uint16_t currentSetValue, const char prompt[], float *fltUserOutput, int32_t *lngVadc_code, int32_t *lngIadc_code)
Configure a voltage and current setting and prompt for measurement from lab-grade multimeter...
int16_t cal_key
If this is set to the proper value, it indicates that a calibration has been performed.
int16_t WriteFactoryCalibration()
FOR FACTORY USE ONLY! Write calibration to factory calibration section of EEPROM. ...
float flt_temperature_of_Iadc_
current output setting (float)
void MeasureTemperatureOfADCs()
Measure the temperature of the voltage and current ADCs.
uint8_t RestoreFactoryCalibration()
Restore factory calibration from the EEPROM.
int8_t CommitVoltageSourceSetting()
Commit the voltage source setting.
void EnableOutput()
Enables the LT1970 output.
uint8_t EasySMU_EEPROM_I2C_address_
I2C address of the EEPROM that stores calibration data.
int16_t PrintFactoryCalibrationInfo()
Prints the factory calibration info from EEPROM to the serial port.
int32_t voltage_measure_offset
the voltage ADC code that corresponds to 0V at the output
prompt
Used to keep track to print voltage or print code.
int32_t temperature_Vadc_code
This is the temperature code read from the voltage ADC during calibration.
int8_t present_
Indicates if this channel is present.
Union that defines the calibration data stored in the EasySMU EEPROM.
uint16_t Idac_pulldown_code_
raw code of current pulldown DAC
float flt_temperature_of_Vadc_
Temperature of voltage ADC.
int32_t temperature_Iadc_code
This is the temperature code read from the current ADC during calibration.
int16_t voltage_source_offset
The output voltage is 0V when this code is stored in the voltage channel of the DAC.
int16_t current_source_pullup_offset
current DAC code that ideally would result in 0A at output, if the output current could be configured...
int8_t CommitCurrentSourceSetting()
Commit the current source setting.
uint16_t Idac_pullup_code_
raw code of current pullup DAC
struct EasySMU::eeprom_data_union::data_struct_type calibration
uint16_t Vdac_code_
raw code of voltage DAC
uint8_t ADC_Isense_I2C_address_
I2C address of LTC2485 used to measure output current.
int32_t Vadc_code_
raw code of voltage ADC
int8_t fltSetCommitCurrentSource(float fCurrent, int8_t up_down_both)
Change the current source setting immediately.
float current_source_pulldown_LSB
the current of one LSB in amps from the current pulldown DAC channel
char byte_array[sizeof(data_struct_type)]
int16_t WriteFactoryCalibrationInfo(char *buffer)
Write factory calibration info to EEPROM.