![]() |
Linduino
1.3.0
Linear Technology Arduino-Compatible Demonstration Board
|
The EasySMU class contains functions for interacting with the EasySMU source measurement unit. More...
The EasySMU class contains functions for interacting with the EasySMU source measurement unit.
At a higher level (Top-Level Linduino Firmware), this EasySMU class is stored in an eight element array. Each element of the array contains data for one channel, allowing one Linduino to control up to eight EasySMU shields.
User Guide
Schematic
Top-Level Linduino Firmware for EasySMU
EasySMU Class Reference
EasySMU_IOpanel Class Reference
EasySMU Webpage
Data Structures | |
union | eeprom_data_union |
Union that defines the calibration data stored in the EasySMU EEPROM. More... | |
Public Member Functions | |
void | ResetCalibration () |
Reset the calibration to a typical value. More... | |
int8_t | SetCalibration () |
Perform calibration. More... | |
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. More... | |
int16_t | IsPresent () |
Check if this EasySMU is present. More... | |
int16_t | ReadCalibration () |
Read calibration from EEPROM. More... | |
int16_t | WriteCalibration () |
Write calibration to EEPROM. More... | |
int16_t | WriteFactoryCalibration () |
FOR FACTORY USE ONLY! Write calibration to factory calibration section of EEPROM. More... | |
int16_t | WriteFactoryCalibrationInfo (char *buffer) |
Write factory calibration info to EEPROM. More... | |
int16_t | PrintFactoryCalibrationInfo () |
Prints the factory calibration info from EEPROM to the serial port. More... | |
uint8_t | RestoreFactoryCalibration () |
Restore factory calibration from the EEPROM. More... | |
int8_t | CommitVoltageSourceSetting () |
Commit the voltage source setting. More... | |
int8_t | codeSetCommitVoltageSource (int32_t lngVoltageSetParam) |
Set and commit the voltage source setting immediately. More... | |
void | codeStepVoltageSourceSetting (int16_t stepSize) |
Increase or decrease the voltage source setting. More... | |
int8_t | fltSetCommitVoltageSource (float fVoltage) |
Commit the voltage source setting immediately to this float value. More... | |
float | fltReadVoltageSourceSetting () |
Read the voltage source setting. More... | |
int8_t | CommitCurrentSourceSetting () |
Commit the current source setting. More... | |
int8_t | fltSetCommitCurrentSource (float fCurrent, int8_t up_down_both) |
Change the current source setting immediately. More... | |
void | fltStepCurrentSourceSetting (float fltStepSize) |
Increase or decrease the current source setting by this value in amps. More... | |
float | fltReadCurrentSourceSetting () |
Read the current source setting. More... | |
int8_t | MeasureVoltageCurrent () |
Measure the voltage and current (with ADCs). More... | |
float | MeasureVoltage () |
Measure the voltage (with ADC). More... | |
float | MeasureCurrent () |
Measure the current (with ADC). More... | |
void | MeasureTemperatureOfADCs () |
Measure the temperature of the voltage and current ADCs. More... | |
void | MeasureTemperatureOfADCs (int32_t *temperature_of_Vadc_code, int32_t *temperature_of_Iadc_code) |
Measure the temperature of the voltage and current ADCs. More... | |
void | EnableOutput () |
Enables the LT1970 output. More... | |
void | DisableOutput () |
Disables the LT1970 output. More... | |
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 I2C address of this instance. More... | |
Data Fields | |
int8_t | present_ |
Indicates if this channel is present. More... | |
uint8_t | EasySMU_EEPROM_I2C_address_ |
I2C address of the EEPROM that stores calibration data. More... | |
uint8_t | DAC_I2C_address_ |
I2C address of LTC2655 used to control voltage and current settings. More... | |
uint8_t | ADC_Vsense_I2C_address_ |
I2C address of LTC2485 used to measure output voltage. More... | |
uint8_t | ADC_Isense_I2C_address_ |
I2C address of LTC2485 used to measure output current. More... | |
int32_t | Vadc_code_ |
raw code of voltage ADC More... | |
int32_t | Iadc_code_ |
raw code of current ADC More... | |
float | flt_measured_voltage_ |
measured voltage (in volts) More... | |
float | flt_measured_current_ |
measured current (in amps) More... | |
float | flt_temperature_of_Vadc_ |
Temperature of voltage ADC. More... | |
float | flt_temperature_of_Iadc_ |
current output setting (float) More... | |
float | float_current_source_setting_ |
Current source setting. More... | |
uint16_t | Vdac_code_ |
raw code of voltage DAC More... | |
uint16_t | Idac_pullup_code_ |
raw code of current pullup DAC More... | |
uint16_t | Idac_pulldown_code_ |
raw code of current pulldown DAC More... | |
union EasySMU::eeprom_data_union | eeprom |
int8_t EasySMU::codeSetCommitVoltageSource | ( | int32_t | lngVoltageSetParam | ) |
Set and commit the voltage source setting immediately.
The DAC that sets the output voltage is loaded with a raw code and the output voltage changes immediately. (Vdac_code_ holds a copy of the raw code.)
lngVoltageSetParam | the code written to the voltage DAC (and Vdac_code_) |
Definition at line 88 of file EasySMU.cpp.
void EasySMU::codeStepVoltageSourceSetting | ( | int16_t | stepSize | ) |
Increase or decrease the voltage source setting.
Updates the screen but does not actually change the output. This gives the user time to see (and optionally modify) the value before it is driven at the output. (Vdac_code_ is modified but not written to DAC yet.)
stepSize | increment the voltage DAC by this amount (raw code of step size) |
Definition at line 106 of file EasySMU.cpp.
int8_t EasySMU::CommitCurrentSourceSetting | ( | ) |
Commit the current source setting.
The DACs that set pullup and pulldown current are loaded with the values from Idac_pullup_code_ and Idac_pulldown_code_, and the output changes immediately. (Other functions such as codeStepCurrentSourceSetting, etc. update the screen but do not actually change the output.)
Definition at line 126 of file EasySMU.cpp.
int8_t EasySMU::CommitVoltageSourceSetting | ( | ) |
Commit the voltage source setting.
The DAC that sets the output voltage is loaded with the value in Vdac_code_, and the output changes immediately. (Other functions such as codeStepVoltageSourceSetting, etc. update the screen but do not actually change the output.)
Definition at line 79 of file EasySMU.cpp.
void EasySMU::DisableOutput | ( | ) |
Disables the LT1970 output.
After this command is run, the output is relatively high-impedance. Note that in this state the output is pulled to 2.76V with a roughly 50kohm impedance.
Definition at line 312 of file EasySMU.cpp.
void EasySMU::EnableOutput | ( | ) |
Enables the LT1970 output.
Before this command is run, the output is high-impedance.
Definition at line 307 of file EasySMU.cpp.
float EasySMU::fltReadCurrentSourceSetting | ( | ) |
Read the current source setting.
Definition at line 240 of file EasySMU.cpp.
float EasySMU::fltReadVoltageSourceSetting | ( | ) |
Read the voltage source setting.
Definition at line 120 of file EasySMU.cpp.
int8_t EasySMU::fltSetCommitCurrentSource | ( | float | fCurrent, |
int8_t | up_down_both | ||
) |
Change the current source setting immediately.
The DAC that sets the output current is loaded with a code based on the scaled version of fCurrent and the output changes immediately. (Idac_pullup_code_ and Idac_pulldown_code_ are updated also. Note that other functions such as codeStepCurrentSourceSetting, etc. update the screen but do not actually change the output.)
up_down_both | determines whether output sources current, sinks current, or both. Set to _SOURCE_ONLY, _SOURCE_AND_SINK, or _SINK_ONLY |
Definition at line 136 of file EasySMU.cpp.
int8_t EasySMU::fltSetCommitVoltageSource | ( | float | fVoltage | ) |
Commit the voltage source setting immediately to this float value.
The DAC that sets the output voltage is loaded with a code based on the scaled version of fVoltage and the output changes immediately. (Idac_pullup_code_ and Idac_pulldown_code_ are updated also. Note that other functions such as codeStepCurrentSourceSetting, etc. update the screen but do not actually change the output.)
fVoltage | the voltage to driven at the output |
Definition at line 113 of file EasySMU.cpp.
void EasySMU::fltStepCurrentSourceSetting | ( | float | fltStepSize | ) |
Increase or decrease the current source setting by this value in amps.
Updates the screen but does not actually change the output. This gives the user time to modify the value before it is driven at the output.
fltStepSize | adjust the current source setting by this value in amps |
Definition at line 186 of file EasySMU.cpp.
int16_t EasySMU::IsPresent | ( | ) |
Check if this EasySMU is present.
(Useful when the EasySMU class is stored in an array where not every possible channel is populated.)
Definition at line 653 of file EasySMU.cpp.
float EasySMU::MeasureCurrent | ( | ) |
void EasySMU::MeasureTemperatureOfADCs | ( | ) |
Measure the temperature of the voltage and current ADCs.
The results are stored in temperature_of_Iadc_code, temperature_of_Vadc_code, flt_temperature_of_Iadc_, and flt_TofVadc_
Definition at line 259 of file EasySMU.cpp.
void EasySMU::MeasureTemperatureOfADCs | ( | int32_t * | temperature_of_Vadc_code, |
int32_t * | temperature_of_Iadc_code | ||
) |
Measure the temperature of the voltage and current ADCs.
This will also update flt_temperature_of_Iadc_ and flt_temperature_of_Vadc_
temperature_of_Vadc_code | returns the raw code of the voltage ADC temperature reading |
temperature_of_Iadc_code | returns the raw code of the current ADC temperature reading |
Definition at line 274 of file EasySMU.cpp.
float EasySMU::MeasureVoltage | ( | ) |
int8_t EasySMU::MeasureVoltageCurrent | ( | ) |
Measure the voltage and current (with ADCs).
Use other member functions to read the value.
Definition at line 247 of file EasySMU.cpp.
int16_t EasySMU::PrintFactoryCalibrationInfo | ( | ) |
Prints the factory calibration info from EEPROM to the serial port.
This is the string returned by the *IDN? serial command.
Definition at line 598 of file EasySMU.cpp.
int16_t EasySMU::ReadCalibration | ( | ) |
Read calibration from EEPROM.
This normally runs during power-up to restore all offset, LSB size, etc. calibration values.
Definition at line 555 of file EasySMU.cpp.
void EasySMU::ResetCalibration | ( | ) |
Reset the calibration to a typical value.
Rarely used, as it is not factory calibration, but instead, a typical value.
Definition at line 318 of file EasySMU.cpp.
uint8_t EasySMU::RestoreFactoryCalibration | ( | ) |
Restore factory calibration from the EEPROM.
This is used in case the user has overwritten the calibration.
Definition at line 629 of file EasySMU.cpp.
int8_t EasySMU::SetCalibration | ( | ) |
Perform calibration.
Configures various voltage or current settings and prompts for value measured from accurate lab-grade multimeter.
Definition at line 361 of file EasySMU.cpp.
int8_t EasySMU::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.
Only used during calibration procedures.
voltageSetValue | code to load into voltage DAC |
currentSetValue | code to load into current DAC |
prompt | prompt to user during calibration. |
fltUserOutput | value entered by user |
lngVadc_code | code read from voltage ADC |
lngIadc_code | code read from current ADC |
Definition at line 339 of file EasySMU.cpp.
int16_t EasySMU::WriteCalibration | ( | ) |
Write calibration to EEPROM.
This is normally run once at the factory after calibration is performed.
Definition at line 582 of file EasySMU.cpp.
int16_t EasySMU::WriteFactoryCalibration | ( | ) |
FOR FACTORY USE ONLY! Write calibration to factory calibration section of EEPROM.
When the EasySMU leaves the factory, the "calibration" and "factory calibration" sections of the EEPROM are the same. This allows factory calibration to be restored in case the user recalibrates the EasySMU.
Definition at line 590 of file EasySMU.cpp.
int16_t EasySMU::WriteFactoryCalibrationInfo | ( | char * | buffer | ) |
Write factory calibration info to EEPROM.
This is the string returned by the *IDN? serial command.
buffer | string to be written into the calibration information section of the EEPROM. This is an information string, not calibration data. It is returned by the *IDN? serial command. |
Definition at line 614 of file EasySMU.cpp.
EasySMU::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 I2C address of this instance.
EEPROM_I2C_address_param | The EasySMU EEPROM I2C address |
DAC_I2C_address_param | The LTC2655 four-channel DAC I2C address. This configures the voltage and current settings. |
ADC_Vsense_I2C_address_param | The I2C address of the voltage ADC |
ADC_Isense_I2C_address_param | The I2C address of the current ADC |
Definition at line 70 of file EasySMU.cpp.
uint8_t EasySMU::ADC_Isense_I2C_address_ |
uint8_t EasySMU::ADC_Vsense_I2C_address_ |
uint8_t EasySMU::DAC_I2C_address_ |
uint8_t EasySMU::EasySMU_EEPROM_I2C_address_ |
union EasySMU::eeprom_data_union EasySMU::eeprom |
float EasySMU::float_current_source_setting_ |
float EasySMU::flt_measured_current_ |
float EasySMU::flt_measured_voltage_ |
float EasySMU::flt_temperature_of_Iadc_ |
float EasySMU::flt_temperature_of_Vadc_ |
uint16_t EasySMU::Idac_pulldown_code_ |
uint16_t EasySMU::Idac_pullup_code_ |
int8_t EasySMU::present_ |