| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Data Structures | Public Member Functions | Data Fields
EasySMU Class Reference

The EasySMU class contains functions for interacting with the EasySMU source measurement unit. More...

## Detailed Description

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

Definition at line 130 of file EasySMU.h.

## 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

## Member Function Documentation

## ◆ codeSetCommitVoltageSource()

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.)

Returns
  0=success, 1=failure

Parameters

  lngVoltageSetParam | the code written to the voltage DAC (and Vdac_code_)

Definition at line 88 of file EasySMU.cpp.

## ◆ codeStepVoltageSourceSetting()

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.)

Returns
  none

Parameters

  stepSize | increment the voltage DAC by this amount (raw code of step size)

Definition at line 106 of file EasySMU.cpp.

## ◆ CommitCurrentSourceSetting()

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.)

Returns
  0=success, 1=failure

Definition at line 126 of file EasySMU.cpp.

## ◆ CommitVoltageSourceSetting()

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.)

Returns
  0=success, 1=failure

Definition at line 79 of file EasySMU.cpp.

## ◆ DisableOutput()

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.

Returns
  none

Definition at line 312 of file EasySMU.cpp.

## ◆ EnableOutput()

void EasySMU::EnableOutput | ( |  | ) |

Enables the LT1970 output.

Before this command is run, the output is high-impedance.

Returns
  none

Definition at line 307 of file EasySMU.cpp.

## ◆ fltReadCurrentSourceSetting()

float EasySMU::fltReadCurrentSourceSetting | ( |  | ) |

Read the current source setting.

Returns
  current source setting in amps

Definition at line 240 of file EasySMU.cpp.

## ◆ fltReadVoltageSourceSetting()

float EasySMU::fltReadVoltageSourceSetting | ( |  | ) |

Read the voltage source setting.

Returns
  voltage source setting in volts

Definition at line 120 of file EasySMU.cpp.

## ◆ fltSetCommitCurrentSource()

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.)

Returns
  0=success, 1=failure

Parameters

  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.

## ◆ fltSetCommitVoltageSource()

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.)

Returns
  0=success, 1=failure

Parameters

  fVoltage | the voltage to driven at the output

Definition at line 113 of file EasySMU.cpp.

## ◆ fltStepCurrentSourceSetting()

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.

Returns
  none

Parameters

  fltStepSize | adjust the current source setting by this value in amps

Definition at line 186 of file EasySMU.cpp.

## ◆ IsPresent()

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.)

Returns
  1 if present. 0 if not present.

Definition at line 653 of file EasySMU.cpp.

## ◆ MeasureCurrent()

float EasySMU::MeasureCurrent | ( |  | ) |

Measure the current (with ADC).

Returns
  current in amps

Definition at line 288 of file EasySMU.cpp.

## ◆ MeasureTemperatureOfADCs() [1/2]

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_

Returns
  none

Definition at line 259 of file EasySMU.cpp.

## ◆ MeasureTemperatureOfADCs() [2/2]

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_

Returns
  none

Parameters

  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.

## ◆ MeasureVoltage()

float EasySMU::MeasureVoltage | ( |  | ) |

Measure the voltage (with ADC).

Returns
  voltage in volts

Definition at line 298 of file EasySMU.cpp.

## ◆ MeasureVoltageCurrent()

int8_t EasySMU::MeasureVoltageCurrent | ( |  | ) |

Measure the voltage and current (with ADCs).

Use other member functions to read the value.

Returns
  0=success, 1=failure

Definition at line 247 of file EasySMU.cpp.

## ◆ PrintFactoryCalibrationInfo()

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.

Returns
  0=success, 1=failure

Definition at line 598 of file EasySMU.cpp.

## ◆ ReadCalibration()

int16_t EasySMU::ReadCalibration | ( |  | ) |

Read calibration from EEPROM.

This normally runs during power-up to restore all offset, LSB size, etc. calibration values.

Returns
  0=success, 1=failure

Definition at line 555 of file EasySMU.cpp.

## ◆ ResetCalibration()

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.

## ◆ RestoreFactoryCalibration()

uint8_t EasySMU::RestoreFactoryCalibration | ( |  | ) |

Restore factory calibration from the EEPROM.

This is used in case the user has overwritten the calibration.

Returns
  0=success, 1=failure

Definition at line 629 of file EasySMU.cpp.

## ◆ SetCalibration()

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.

## ◆ SetCalibrationSinglePoint()

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.

Returns
  Presently, only returns 0

Parameters

  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.

## ◆ WriteCalibration()

int16_t EasySMU::WriteCalibration | ( |  | ) |

Write calibration to EEPROM.

This is normally run once at the factory after calibration is performed.

Returns
  0=success, 1=failure

Definition at line 582 of file EasySMU.cpp.

## ◆ WriteFactoryCalibration()

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.

Returns
  0=success, 1=failure

Definition at line 590 of file EasySMU.cpp.

## ◆ WriteFactoryCalibrationInfo()

int16_t EasySMU::WriteFactoryCalibrationInfo | ( | char * | buffer | ) |

Write factory calibration info to EEPROM.

This is the string returned by the *IDN? serial command.

Returns
  0=success, 1=failure

Parameters

  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.

## Constructor & Destructor Documentation

## ◆ EasySMU()

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.

Parameters

  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.

## Field Documentation

## ◆ ADC_Isense_I2C_address_

uint8_t EasySMU::ADC_Isense_I2C_address_

I2C address of LTC2485 used to measure output current.

Definition at line 140 of file EasySMU.h.

## ◆ ADC_Vsense_I2C_address_

uint8_t EasySMU::ADC_Vsense_I2C_address_

I2C address of LTC2485 used to measure output voltage.

Definition at line 139 of file EasySMU.h.

## ◆ DAC_I2C_address_

uint8_t EasySMU::DAC_I2C_address_

I2C address of LTC2655 used to control voltage and current settings.

Definition at line 138 of file EasySMU.h.

## ◆ EasySMU_EEPROM_I2C_address_

uint8_t EasySMU::EasySMU_EEPROM_I2C_address_

I2C address of the EEPROM that stores calibration data.

Definition at line 137 of file EasySMU.h.

## ◆ eeprom

union EasySMU::eeprom_data_union EasySMU::eeprom

## ◆ float_current_source_setting_

float EasySMU::float_current_source_setting_

Current source setting.

(The output does not change immediately upon updating this value. It must be "committed" first.)

Definition at line 151 of file EasySMU.h.

## ◆ flt_measured_current_

float EasySMU::flt_measured_current_

measured current (in amps)

Definition at line 145 of file EasySMU.h.

## ◆ flt_measured_voltage_

float EasySMU::flt_measured_voltage_

measured voltage (in volts)

Definition at line 145 of file EasySMU.h.

## ◆ flt_temperature_of_Iadc_

float EasySMU::flt_temperature_of_Iadc_

current output setting (float)

Definition at line 148 of file EasySMU.h.

## ◆ flt_temperature_of_Vadc_

float EasySMU::flt_temperature_of_Vadc_

Temperature of voltage ADC.

Definition at line 148 of file EasySMU.h.

## ◆ Iadc_code_

int32_t EasySMU::Iadc_code_

raw code of current ADC

Definition at line 142 of file EasySMU.h.

## ◆ Idac_pulldown_code_

uint16_t EasySMU::Idac_pulldown_code_

raw code of current pulldown DAC

Definition at line 153 of file EasySMU.h.

## ◆ Idac_pullup_code_

uint16_t EasySMU::Idac_pullup_code_

raw code of current pullup DAC

Definition at line 153 of file EasySMU.h.

## ◆ present_

int8_t EasySMU::present_

Indicates if this channel is present.

(Useful when the EasySMU class is stored in an array where not every possible channel is populated.)

Definition at line 136 of file EasySMU.h.

## ◆ Vadc_code_

int32_t EasySMU::Vadc_code_

raw code of voltage ADC

Definition at line 142 of file EasySMU.h.

## ◆ Vdac_code_

uint16_t EasySMU::Vdac_code_

raw code of voltage DAC

Definition at line 153 of file EasySMU.h.

The documentation for this class was generated from the following files:

- EasySMU.h
- EasySMU.cpp