Linduino  1.3.0
Linear Technology Arduino-Compatible Demonstration Board
EasySMU.h
Go to the documentation of this file.
1 /*!
2 Class Library Header File for EasySMU: I2C Address Translator Demonstration and a Simple Multi-Channel Source Measurement Unit
3 
4 [User Guide](http://www.linear.com/docs/58670 "EasySMU User Guide") \n
5 [Schematic](http://www.linear.com/docs/58671 "Schematic") \n
6 [Top-Level Linduino Firmware for EasySMU](file:EasySMU__Run_8ino.html "Top-Level Linduino Firmware for EasySMU") \n
7 [EasySMU Class Reference](file:classEasySMU.html "EasySMU Class Reference") \n
8 [EasySMU_IOpanel Class Reference](file:classEasySMU__IOpanel.html "EasySMU_IOpanel Class Reference") \n
9 [EasySMU Webpage](http://www.linear.com/solutions/7943 "EasySMU Webpage") \n
10 
11 @verbatim
12 EasySMU: I2C Address Translator Demonstration and a Simple Multi-Channel Source Measurement Unit
13 
14 LTC4316: Single I2C/SMBus Address Translator
15 LT1970A: Power Op Amp with Adjustable Precision Current Limit
16 LT5400: Quad Matched Resistor Network
17 LTC2655: Quad I2C 16-/12-Bit Rail-to-Rail DACs with 10ppm/°C Max Reference
18 LTC3265: Low Noise Dual Supply with Boost and Inverting Charge Pumps
19 LTC2051: Dual Zero-Drift Operational Amplifier
20 LT3010: 50mA, 3V to 80V Low Dropout Micropower Linear Regulator
21 LT1991: Precision, 100µA Gain Selectable Amplifier
22 LTC6655: 0.25ppm Noise, Low Drift Precision Reference
23 LTC2485: 24-Bit ΔΣ ADC with Easy Drive Input Current Cancellation and I2C Interface
24 
25 EasySMU is a single-channel ±12V/40mA programmable-voltage/programmable-current
26 source with accurate voltage/current measurement capability. The LTC4316 I2C
27 Address Translator enables up to eight independent EasySMUs to be controlled
28 by a single I2C master.
29 
30 In this demonstration, each EasySMU board contains four I2C slaves and the
31 associated components to implement a single-channel ±12V/40mA programmable-
32 voltage/programmable-current source. The LTC4316 translates the I2C addresses
33 of each EasySMU to a unique set of addresses, enabling up to eight EasySMU
34 boards to be stacked on a single Linduino (I2C master). In this form, it
35 resembles a multi-channel automated test system. Alternatively, an optional
36 touchscreen allows the user to interactively control up to four channels,
37 forming a compact multi-channel programmable-voltage/programmable-current
38 bench source for lab testing, powered from a single 12V AC wall adapter.
39 
40 The primary purpose of the EasySMU is to demonstrate the LTC4316 I2C Address
41 Translator. The programmable-voltage/programmable-current source and meter
42 also provide a convenient demonstration of the associated components: LT1970A,
43 LT5400-3, LTC2655-H, LTC3265, LTC2051, LT3010, LT1991, LTC6655, and LTC2485.
44 While the EasySMU is not designed to demonstrate the ultimate performance that
45 can be obtained from each of those components, the EasySMU does provide
46 impressive results from a reasonably simple circuit.
47 
48 @endverbatim
49 */
50 
51 
52 /*! @file
53 @ingroup EasySMU
54 Class Library Header File for EasySMU: I2C Address Translator Demonstration and a Simple Multi-Channel Source Measurement Unit
55 */
56 
57 #ifndef EasySMU_h
58 #define EasySMU_h
59 
60 #include "Arduino.h"
61 #include "LTC2655.h"
62 
63 #include "LTC2485.h"
64 #include "QuikEval_EEPROM.h"
65 
66 //!ID string written to EasySMU EEPROM. Value that will be returned by *IDN? serial command.
67 #define _EASYSMU_ID_STRING "Linear Technology, EasySMU-1.01 DC2591A"
68 
69 //Constants used to specify channel
70 //! @name Channel name used as index in EasySMU array
71 //! @{
72 #define _CH0 0
73 #define _CH1 1
74 #define _CH2 2
75 #define _CH3 3
76 #define _CH4 4
77 #define _CH5 5
78 #define _CH6 6
79 #define _CH7 7
80 //! @}
81 
82 //! @name DAC channel name (LTC2655 is a four channel DAC).
83 //! @{
84 //!Channel A of the DAC is configures the output voltage.
85 #define _EASYSMU_VOLTAGE_DAC LTC2655_DAC_A
86 //!Channel B of the DAC configures the maximum pullup current
87 #define _EASYSMU_CURRENT_PULLUP_DAC LTC2655_DAC_B
88 //!Channel C of the DAC configures the maximum pulldown current.
89 #define _EASYSMU_CURRENT_PULLDOWN_DAC LTC2655_DAC_C
90 //!Channel D of the DAC is used to enable or disable the LTC1970's output. It is essentially used as a binary output here.
91 #define _EASYSMU_ENABLE_OUTPUT_DAC LTC2655_DAC_D
92 //! @}
93 
94 //! @name ADC conversion times.
95 //! @{
96 //! LTC2485 ADC conversion time in milliseconds (1X mode)
97 #define _LTC2485_CONVERSION_TIME_1X 150
98 //! LTC2485 ADC conversion time in milliseconds (2X mode)
99 #define _LTC2485_CONVERSION_TIME_2X 75
100 //! Use 1X mode conversion time for EasySMU conversions
101 #define _LTC2485_CONVERSION_TIME _LTC2485_CONVERSION_TIME_1X
102 //! @}
103 
104 //! A backup version of the factory calibration is stored at this address. Factory calibration may be recovered from here to override a user calibration.
105 #define EEPROM_FACTORY_CAL_STATUS_ADDRESS EEPROM_CAL_STATUS_ADDRESS+sizeof(eeprom_data_union)
106 //! Channel ID information returned by *IDN? command
107 #define EEPROM_FACTORY_CAL_INFO_ADDRESS EEPROM_FACTORY_CAL_STATUS_ADDRESS+sizeof(eeprom_data_union)
108 
109 //! @name Used as a parameter to functions where source, sink, or both is specified.
110 //! @{
111 #define _SOURCE_ONLY 1
112 #define _SOURCE_AND_SINK 0
113 #define _SINK_ONLY -1
114 //! @}
115 
116 //! Defines length of the calibartion info string (serial number) which is stored in the EEPROM
117 #define CAL_INFO_STRLEN 32
118 
119 /*!The EasySMU class contains functions for interacting with the EasySMU source measurement unit.
120 At a higher level (Top-Level Linduino Firmware), this EasySMU class is stored in an eight element array. Each element of the array
121 contains data for one channel, allowing one Linduino to control up to eight EasySMU shields.
122 
123 [User Guide](http://www.linear.com/docs/58670 "EasySMU User Guide") \n
124 [Schematic](http://www.linear.com/docs/58671 "Schematic") \n
125 [Top-Level Linduino Firmware for EasySMU](file:EasySMU__Run_8ino.html "Top-Level Linduino Firmware for EasySMU") \n
126 [EasySMU Class Reference](file:classEasySMU.html "EasySMU Class Reference") \n
127 [EasySMU_IOpanel Class Reference](file:classEasySMU__IOpanel.html "EasySMU_IOpanel Class Reference") \n
128 [EasySMU Webpage](http://www.linear.com/solutions/7943 "EasySMU Webpage") \n
129 */
130 class EasySMU
131 
132 {
133  private:
134 
135  public:
136  int8_t present_; //!< Indicates if this channel is present. (Useful when the EasySMU class is stored in an array where not every possible channel is populated.)
137  uint8_t EasySMU_EEPROM_I2C_address_; //!< I2C address of the EEPROM that stores calibration data
138  uint8_t DAC_I2C_address_; //!< I2C address of LTC2655 used to control voltage and current settings
139  uint8_t ADC_Vsense_I2C_address_; //!< I2C address of LTC2485 used to measure output voltage
140  uint8_t ADC_Isense_I2C_address_; //!< I2C address of LTC2485 used to measure output current
141 
142  int32_t Vadc_code_, //!< raw code of voltage ADC
143  Iadc_code_; //!< raw code of current ADC
144 
145  float flt_measured_voltage_, //!< measured voltage (in volts)
146  flt_measured_current_; //!< measured current (in amps)
147 
148  float flt_temperature_of_Vadc_, //!< Temperature of voltage ADC
149  flt_temperature_of_Iadc_; //!< current output setting (float)
150 
151  float float_current_source_setting_; //!< Current source setting. (The output does not change immediately upon updating this value. It must be "committed" first.)
152 
153  uint16_t Vdac_code_, //!< raw code of voltage DAC
154  Idac_pullup_code_, //!< raw code of current pullup DAC
155  Idac_pulldown_code_; //!< raw code of current pulldown DAC
156 
157  void ResetCalibration(); //!< Reset the calibration to a typical value. Rarely used, as it is not factory calibration, but instead, a typical value.
158  int8_t SetCalibration(); //!< Perform calibration. Configures various voltage or current settings and prompts for value measured from accurate lab-grade multimeter.
159 
160  //! Configure a voltage and current setting and prompt for measurement from lab-grade multimeter. Only used during calibration procedures.
161  //! @return Presently, only returns 0
162  int8_t SetCalibrationSinglePoint(uint16_t voltageSetValue, //!< code to load into voltage DAC
163  uint16_t currentSetValue, //!< code to load into current DAC
164  const char prompt[], //!< prompt to user during calibration.
165  float *fltUserOutput, //!< value entered by user
166  int32_t *lngVadc_code, //!< code read from voltage ADC
167  int32_t *lngIadc_code //!< code read from current ADC
168  );
169 
170  //! Check if this EasySMU is present. (Useful when the EasySMU class is stored in an array where not every possible channel is populated.)
171  //! @return 1 if present. 0 if not present.
172  int16_t IsPresent();
173 
174  //! Read calibration from EEPROM. This normally runs during power-up to restore all offset, LSB size, etc. calibration values.
175  //! @return 0=success, 1=failure
176  int16_t ReadCalibration();
177 
178  //! Write calibration to EEPROM. This is normally run once at the factory after calibration is performed.
179  //! @return 0=success, 1=failure
180  int16_t WriteCalibration();
181 
182  //! FOR FACTORY USE ONLY! Write calibration to factory calibration section of EEPROM.
183  //! 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.
184  //! @return 0=success, 1=failure
185  int16_t WriteFactoryCalibration();
186 
187  //! Write factory calibration info to EEPROM. This is the string returned by the *IDN? serial command.
188  //! @return 0=success, 1=failure
189  int16_t WriteFactoryCalibrationInfo(char *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.
190  );
191 
192  //! Prints the factory calibration info from EEPROM to the serial port. This is the string returned by the *IDN? serial command.
193  //! @return 0=success, 1=failure
194  int16_t PrintFactoryCalibrationInfo();
195 
196  //! Restore factory calibration from the EEPROM. This is used in case the user has overwritten the calibration.
197  //! @return 0=success, 1=failure
198  uint8_t RestoreFactoryCalibration();
199 
200  //! 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.
201  //! (Other functions such as codeStepVoltageSourceSetting, etc. update the screen but do not actually change the output.)
202  //! @return 0=success, 1=failure
204 
205  //! Set and commit the voltage source setting immediately.
206  //! The DAC that sets the output voltage is loaded with a raw code and the output voltage changes immediately.
207  //! (Vdac_code_ holds a copy of the raw code.)
208  //! @return 0=success, 1=failure
209  int8_t codeSetCommitVoltageSource(int32_t lngVoltageSetParam //!< the code written to the voltage DAC (and Vdac_code_)
210  );
211  //! 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.
212  //! (Vdac_code_ is modified but not written to DAC yet.)
213  //! @return none
214  void codeStepVoltageSourceSetting(int16_t stepSize //!< increment the voltage DAC by this amount (raw code of step size)
215  );
216 
217  //! Commit the voltage source setting immediately to this float value.
218  //! The DAC that sets the output voltage is loaded with a code based on the scaled version of fVoltage and the output changes immediately.
219  //! (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.)
220  //! @return 0=success, 1=failure
221  int8_t fltSetCommitVoltageSource(float fVoltage //!< the voltage to driven at the output
222  );
223  //! Read the voltage source setting
224  //! @return voltage source setting in volts
226 
227  //! 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.
228  //! (Other functions such as codeStepCurrentSourceSetting, etc. update the screen but do not actually change the output.)
229  //! @return 0=success, 1=failure
231 
232  //! Change the current source setting immediately.
233  //! The DAC that sets the output current is loaded with a code based on the scaled version of fCurrent and the output changes immediately.
234  //! (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.)
235  //! @return 0=success, 1=failure
236  int8_t fltSetCommitCurrentSource(float fCurrent, //<! current in amps to be used as the current source/sink setting
237  int8_t up_down_both //!< determines whether output sources current, sinks current, or both. Set to _SOURCE_ONLY, _SOURCE_AND_SINK, or _SINK_ONLY
238  );
239 
240  //! 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.
241  //! @return none
242  void fltStepCurrentSourceSetting(float fltStepSize //!< adjust the current source setting by this value in amps
243  );
244 
245  //! Read the current source setting
246  //! @return current source setting in amps
248 
249  //! Measure the voltage and current (with ADCs). Use other member functions to read the value.
250  //! @return 0=success, 1=failure
251  int8_t MeasureVoltageCurrent();
252 
253  //! Measure the voltage (with ADC).
254  //! @return voltage in volts
255 
256  float MeasureVoltage();
257  //! Measure the current (with ADC).
258  //! @return current in amps
259  float MeasureCurrent();
260 
261  //! Measure the temperature of the voltage and current ADCs.
262  //! The results are stored in temperature_of_Iadc_code, temperature_of_Vadc_code, flt_temperature_of_Iadc_, and flt_TofVadc_
263  //! @return none
265 
266  //! Measure the temperature of the voltage and current ADCs.
267  //! This will also update flt_temperature_of_Iadc_ and flt_temperature_of_Vadc_
268  //! @return none
269  void MeasureTemperatureOfADCs(int32_t *temperature_of_Vadc_code, //!< returns the raw code of the voltage ADC temperature reading
270  int32_t *temperature_of_Iadc_code //!< returns the raw code of the current ADC temperature reading
271  );
272 
273  //! Enables the LT1970 output. Before this command is run, the output is high-impedance.
274  //! @return none
275  void EnableOutput();
276 
277  //! Disables the LT1970 output. After this command is run, the output is relatively high-impedance.
278  //! Note that in this state the output is pulled to 2.76V with a roughly 50kohm impedance.
279  //! @return none
280  void DisableOutput();
281 
282  //! EasySMU constructor. Remember each EasySMU instance has unique I2C addresses, so this configures each I2C address of this instance.
283  EasySMU(uint8_t EEPROM_I2C_address_param, //!< The EasySMU EEPROM I2C address
284  uint8_t DAC_I2C_address_param, //!< The LTC2655 four-channel DAC I2C address. This configures the voltage and current settings.
285  uint8_t ADC_Vsense_I2C_address_param, //!< The I2C address of the voltage ADC
286  uint8_t ADC_Isense_I2C_address_param //!< The I2C address of the current ADC
287  );
288 
289  //! Union that defines the calibration data stored in the EasySMU EEPROM
291 
292  {
293  //! 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.
295  {
296  int16_t cal_key; //!< If this is set to the proper value, it indicates that a calibration has been performed. (If not, this EasySMU has never been calibrated.)
297  //Consider changing voltage_source_offset to uint16_t. Make sure it is not cast to (int16_t) elsewhere.
298  int16_t voltage_source_offset; //!< The output voltage is 0V when this code is stored in the voltage channel of the DAC
299  float voltage_source_LSB; //!< the voltage of one LSB in volts (from the voltage channel of the DAC)
300  int16_t current_source_pullup_offset; //!< current DAC code that ideally would result in 0A at output, if the output current could be configured below 0.5mA
301  float current_source_pullup_LSB; //!< the current of one LSB in amps from the current pullup DAC channel
302  int16_t current_source_pulldown_offset; //!< current DAC code that ideally would result in 0A at output, if the output current could be configured below 0.5mA
303  float current_source_pulldown_LSB; //!< the current of one LSB in amps from the current pulldown DAC channel
304  int32_t voltage_measure_offset; //!< the voltage ADC code that corresponds to 0V at the output
305  float voltage_measure_LSB; //!< the voltage of one LSB in volts from the voltage ADC
306  float current_measure_LSB; //!< the current of one LSB in amps from the current ADC
307  float current_measure_output_resistance; //!< This value is used to modify the output current measurement result based on output voltage. This compensates for the current that flows through the feedback network, etc.
308  int32_t current_measure_offset; //!< the code from the current ADC that corresponds to 0A at the output
309  int32_t temperature_Vadc_code; //!< This is the temperature code read from the voltage ADC during calibration. (It is probably 25C, but an actual measurement/calibration is not performed.)
310  int32_t temperature_Iadc_code; //!< This is the temperature code read from the current ADC during calibration. (It is probably 25C, but an actual measurement/calibration is not performed.)
311 
312  } calibration;
313 
315 
316  } eeprom;
317 
318 };
319 
320 #endif
321 
322 /*!
323 Copyright 2018(c) Analog Devices, Inc.
324 
325 All rights reserved.
326 
327 Redistribution and use in source and binary forms, with or without
328 modification, are permitted provided that the following conditions are met:
329  - Redistributions of source code must retain the above copyright
330  notice, this list of conditions and the following disclaimer.
331  - Redistributions in binary form must reproduce the above copyright
332  notice, this list of conditions and the following disclaimer in
333  the documentation and/or other materials provided with the
334  distribution.
335  - Neither the name of Analog Devices, Inc. nor the names of its
336  contributors may be used to endorse or promote products derived
337  from this software without specific prior written permission.
338  - The use of this software may or may not infringe the patent rights
339  of one or more patent holders. This license does not release you
340  from the requirement that you obtain separate licenses from these
341  patent holders to use this software.
342  - Use of the software either in source or binary form, must be run
343  on or directly connected to an Analog Devices Inc. component.
344 
345 THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
346 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
347 MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
348 IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
349 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
350 LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
351 SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
352 CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
353 OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
354 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
355 */
float current_source_pullup_LSB
the current of one LSB in amps from the current pullup DAC channel
Definition: EasySMU.h:301
float MeasureCurrent()
Measure the current (with ADC).
Definition: EasySMU.cpp:288
float MeasureVoltage()
Measure the voltage (with ADC).
Definition: EasySMU.cpp:298
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.
Definition: EasySMU.h:138
int32_t current_measure_offset
the code from the current ADC that corresponds to 0A at the output
Definition: EasySMU.h:308
The EasySMU class contains functions for interacting with the EasySMU source measurement unit...
Definition: EasySMU.h:130
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.
Definition: EasySMU.h:294
float voltage_source_LSB
the voltage of one LSB in volts (from the voltage channel of the DAC)
Definition: EasySMU.h:299
void codeStepVoltageSourceSetting(int16_t stepSize)
Increase or decrease the voltage source setting.
Definition: EasySMU.cpp:106
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.
Definition: EasySMU.cpp:186
int16_t WriteCalibration()
Write calibration to EEPROM.
Definition: EasySMU.cpp:582
float flt_measured_current_
measured current (in amps)
Definition: EasySMU.h:145
int8_t MeasureVoltageCurrent()
Measure the voltage and current (with ADCs).
Definition: EasySMU.cpp:247
float current_measure_output_resistance
This value is used to modify the output current measurement result based on output voltage...
Definition: EasySMU.h:307
int16_t IsPresent()
Check if this EasySMU is present.
Definition: EasySMU.cpp:653
int8_t codeSetCommitVoltageSource(int32_t lngVoltageSetParam)
Set and commit the voltage source setting immediately.
Definition: EasySMU.cpp:88
int16_t current_source_pulldown_offset
current DAC code that ideally would result in 0A at output, if the output current could be configured...
Definition: EasySMU.h:302
int8_t fltSetCommitVoltageSource(float fVoltage)
Commit the voltage source setting immediately to this float value.
Definition: EasySMU.cpp:113
int16_t ReadCalibration()
Read calibration from EEPROM.
Definition: EasySMU.cpp:555
uint8_t ADC_Vsense_I2C_address_
I2C address of LTC2485 used to measure output voltage.
Definition: EasySMU.h:139
float fltReadCurrentSourceSetting()
Read the current source setting.
Definition: EasySMU.cpp:240
float float_current_source_setting_
Current source setting.
Definition: EasySMU.h:151
union EasySMU::eeprom_data_union eeprom
int32_t Iadc_code_
raw code of current ADC
Definition: EasySMU.h:142
int8_t SetCalibration()
Perform calibration.
Definition: EasySMU.cpp:361
QuikEval EEPROM Library.
void DisableOutput()
Disables the LT1970 output.
Definition: EasySMU.cpp:312
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...
Definition: EasySMU.cpp:70
float voltage_measure_LSB
the voltage of one LSB in volts from the voltage ADC
Definition: EasySMU.h:305
float flt_measured_voltage_
measured voltage (in volts)
Definition: EasySMU.h:145
float fltReadVoltageSourceSetting()
Read the voltage source setting.
Definition: EasySMU.cpp:120
float current_measure_LSB
the current of one LSB in amps from the current ADC
Definition: EasySMU.h:306
void ResetCalibration()
Reset the calibration to a typical value.
Definition: EasySMU.cpp:318
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...
Definition: EasySMU.cpp:339
int16_t cal_key
If this is set to the proper value, it indicates that a calibration has been performed.
Definition: EasySMU.h:296
int16_t WriteFactoryCalibration()
FOR FACTORY USE ONLY! Write calibration to factory calibration section of EEPROM. ...
Definition: EasySMU.cpp:590
float flt_temperature_of_Iadc_
current output setting (float)
Definition: EasySMU.h:148
void MeasureTemperatureOfADCs()
Measure the temperature of the voltage and current ADCs.
Definition: EasySMU.cpp:259
uint8_t RestoreFactoryCalibration()
Restore factory calibration from the EEPROM.
Definition: EasySMU.cpp:629
int8_t CommitVoltageSourceSetting()
Commit the voltage source setting.
Definition: EasySMU.cpp:79
void EnableOutput()
Enables the LT1970 output.
Definition: EasySMU.cpp:307
uint8_t EasySMU_EEPROM_I2C_address_
I2C address of the EEPROM that stores calibration data.
Definition: EasySMU.h:137
int16_t PrintFactoryCalibrationInfo()
Prints the factory calibration info from EEPROM to the serial port.
Definition: EasySMU.cpp:598
int32_t voltage_measure_offset
the voltage ADC code that corresponds to 0V at the output
Definition: EasySMU.h:304
prompt
Used to keep track to print voltage or print code.
Definition: DC934A.ino:113
int32_t temperature_Vadc_code
This is the temperature code read from the voltage ADC during calibration.
Definition: EasySMU.h:309
int8_t present_
Indicates if this channel is present.
Definition: EasySMU.h:136
Union that defines the calibration data stored in the EasySMU EEPROM.
Definition: EasySMU.h:290
uint16_t Idac_pulldown_code_
raw code of current pulldown DAC
Definition: EasySMU.h:153
float flt_temperature_of_Vadc_
Temperature of voltage ADC.
Definition: EasySMU.h:148
int32_t temperature_Iadc_code
This is the temperature code read from the current ADC during calibration.
Definition: EasySMU.h:310
int16_t voltage_source_offset
The output voltage is 0V when this code is stored in the voltage channel of the DAC.
Definition: EasySMU.h:298
int16_t current_source_pullup_offset
current DAC code that ideally would result in 0A at output, if the output current could be configured...
Definition: EasySMU.h:300
int8_t CommitCurrentSourceSetting()
Commit the current source setting.
Definition: EasySMU.cpp:126
uint16_t Idac_pullup_code_
raw code of current pullup DAC
Definition: EasySMU.h:153
struct EasySMU::eeprom_data_union::data_struct_type calibration
uint16_t Vdac_code_
raw code of voltage DAC
Definition: EasySMU.h:153
uint8_t ADC_Isense_I2C_address_
I2C address of LTC2485 used to measure output current.
Definition: EasySMU.h:140
int32_t Vadc_code_
raw code of voltage ADC
Definition: EasySMU.h:142
int8_t fltSetCommitCurrentSource(float fCurrent, int8_t up_down_both)
Change the current source setting immediately.
Definition: EasySMU.cpp:136
float current_source_pulldown_LSB
the current of one LSB in amps from the current pulldown DAC channel
Definition: EasySMU.h:303
char byte_array[sizeof(data_struct_type)]
Definition: EasySMU.h:314
int16_t WriteFactoryCalibrationInfo(char *buffer)
Write factory calibration info to EEPROM.
Definition: EasySMU.cpp:614