| Linduino 1.3.0 Linear Technology Arduino-Compatible Demonstration Board

Functions | Macros | Variables
EasySMU_Run.ino File Reference
Example Designs » EasySMU: I2C Address Translator Demonstration and a Simple Multi-Channel Source Measurement Unit

Top-Level Linduino Firmware for EasySMU: I2C Address Translator Demonstration and a Simple Multi-Channel Source Measurement Unit. More...

## Detailed Description

Top-Level Linduino Firmware for EasySMU: I2C Address Translator Demonstration and a Simple Multi-Channel Source Measurement Unit.

User Guide
Schematic
Top-Level Linduino Firmware for EasySMU
EasySMU Class Reference
EasySMU_IOpanel Class Reference
EasySMU Webpage

    EasySMU: I2C Address Translator Demonstration and a Simple Multi-Channel Source Measurement Unit

    LTC4316: Single I2C/SMBus Address Translator
    LT1970A: Power Op Amp with Adjustable Precision Current Limit
    LT5400:  Quad Matched Resistor Network
    LTC2655: Quad I2C 16-/12-Bit Rail-to-Rail DACs with 10ppm/°C Max Reference
    LTC3265: Low Noise Dual Supply with Boost and Inverting Charge Pumps
    LTC2051: Dual Zero-Drift Operational Amplifier
    LT3010:  50mA, 3V to 80V Low Dropout Micropower Linear Regulator
    LT1991:  Precision, 100µA Gain Selectable Amplifier
    LTC6655: 0.25ppm Noise, Low Drift Precision Reference
    LTC2485: 24-Bit ΔΣ ADC with Easy Drive Input Current Cancellation and I2C Interface

    EasySMU is a single-channel ±12V/40mA programmable-voltage/programmable-current
    source with accurate voltage/current measurement capability. The LTC4316 I2C
    Address Translator enables up to eight independent EasySMUs to be controlled
    by a single I2C master.

    In this demonstration, each EasySMU board contains four I2C slaves and the
    associated components to implement a single-channel ±12V/40mA programmable-
    voltage/programmable-current source. The LTC4316 translates the I2C addresses
    of each EasySMU to a unique set of addresses, enabling up to eight EasySMU
    boards to be stacked on a single Linduino (I2C master). In this form, it
    resembles a multi-channel automated test system. Alternatively, an optional
    touchscreen allows the user to interactively control up to four channels,
    forming a compact multi-channel programmable-voltage/programmable-current
    bench source for lab testing, powered from a single 12V AC wall adapter.

    The primary purpose of the EasySMU is to demonstrate the LTC4316 I2C Address
    Translator. The programmable-voltage/programmable-current source and meter
    also provide a convenient demonstration of the associated components: LT1970A,
    LT5400-3, LTC2655-H, LTC3265, LTC2051, LT3010, LT1991, LTC6655, and LTC2485.
    While the EasySMU is not designed to demonstrate the ultimate performance that
    can be obtained from each of those components, the EasySMU does provide
    impressive results from a reasonably simple circuit.

Copyright 2018(c) Analog Devices, Inc.

All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

- Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- Neither the name of Analog Devices, Inc. nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
- The use of this software may or may not infringe the patent rights of one or more patent holders. This license does not release you from the requirement that you obtain separate licenses from these patent holders to use this software.
- Use of the software either in source or binary form, must be run on or directly connected to an Analog Devices Inc. component.

THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Firmware Loaded on Linduino to Control EasySMU Shields

Definition in file EasySMU_Run.ino.

Go to the source code of this file.

## Functions
static void | DelayAndUserInput (uint32_t delay)
| Wait for 'delay' milliseconds while handling button presses on the touchscreen. More...
static int16_t | getToken (char strData[], const char chrCommands[][3], int16_t sizeSerialCommands)
| Check if first three characters match a three character command in chrCommands. More...
boolean | ReadLine (char *serialData)
| Read available characters from the serial port and append the result to the *serialData string. More...
static void | ParseSerialData (char chrSerialData[])
| Checks for the following valid commands from the serial interface and performs the corresponding actions. More...
static void | SetVoltage ()
| Check if the user is pressing the V+, V++, V-, or V– buttons. If so, adjust voltage. More...
static void | SetCurrent ()
| Check if the user is pressing the I+, I++, I-, or I– buttons. If so, adjust the current. More...
static void | setup ()
| Initialize the Linduino, EasySMU, screen, etc. More...
static void | loop ()
| Arduino/Linduino loop that runs continuously. More...

## Macros
#define | I2C_FT6206_ADDR0 0x38
| touchscreen I2C address More...
#define | _BUTTON_WAIT_TIME 500
| Give the user 500ms to adjust a value before setting the output. This allows the user to adjust a value before it shows up at the output. More...
#define | _BUTTON_TIME_1 4000
| Touchscreen step size increases after _BUTTON_TIME_1 milliseconds. This allows faster user adjustment when the button is held longer. More...
#define | _BUTTON_TIME_2 2000
| Touchscreen step size increases after _BUTTON_TIME_2 milliseconds. This allows faster user adjustment when the button is held longer. More...
#define | _VBUTTON_STEP_1 3
| Voltage step size after _BUTTON_TIME_1. More...
#define | _VBUTTON_STEP_2 1
| Voltage step size after _BUTTON_TIME_2. More...
#define | _IBUTTON_STEP_1 0.0000030
| Current step size after _BUTTON_TIME_1. More...
#define | _IBUTTON_STEP_2 0.0000010
| Current step size after _BUTTON_TIME_2. More...
#define | SERIAL_COMMANDS_ERROR -1
#define | SERIAL_COMMANDS_SIZE_0 2
#define | SERIAL_COMMANDS_SIZE_1 9
#define | SERIAL_COMMANDS_SIZE_LCD 2
#define | SERIAL_COMMANDS_SIZE_12 6
#define | SERIAL_COMMANDS_SIZE_121 2
#define | SERIAL_COMMANDS_SIZE_122 2

## Variables
EasySMU | SMU [8]
| Array of eight EasySMU instances that hold state for up to eight stacked EasySMU shields. More...
EasySMU_IOpanel | IOpanel
| IOpanel provides an interface between the EasySMU hardware and a touchscreen. More...
char | serial_data [100]
| Used to buffer data from serial interface. More...

## Function Documentation

## ◆ DelayAndUserInput()

static void DelayAndUserInput | ( | uint32_t | delay | ) |
| static

Wait for 'delay' milliseconds while handling button presses on the touchscreen.

Parameters

  delay | Number of milliseconds to wait in this loop

Definition at line 577 of file EasySMU_Run.ino.

## ◆ getToken()

static int16_t getToken | ( | char | strData[],
|  | const char | chrCommands[][3],
|  | int16_t | sizeSerialCommands
| ) |  |
| static

Check if first three characters match a three character command in chrCommands.

Returns
  Index of location in chrCommands of the match. -1 if no match is found.

Parameters

  strData | string to be checked to see if a match is found in chrCommands
  chrCommands | list of valid three character commands
  sizeSerialCommands | the number of commands in chrCommands

Definition at line 164 of file EasySMU_Run.ino.

## ◆ loop()

static void loop | ( | void |  | ) |
| static

Arduino/Linduino loop that runs continuously.

Definition at line 638 of file EasySMU_Run.ino.

## ◆ ParseSerialData()

static void ParseSerialData | ( | char | chrSerialData[] | ) |
| static

Checks for the following valid commands from the serial interface and performs the corresponding actions.

Where indicated, 'x' is substituted with 0-7, a number corresponding to the appropriate channel.

Command | Description
--- | ---
*RST | Reset to power-up state
*IDN or *IDN? | Return ID string that includes revision, channels that are present, serial number of each channel, etc.
LCD:ENA | Enable the LCD/TFT display (default)
LCD:DIS | Disable the LCD/TFT display. This might be useful to reduce noise at the output caused by SPI communication with the screen.
CHx:DIS | Disable the output to put it in a relatively high-impedance state.
CHx:ENA | Enable the channel. (Default state)
CHx:VOL value | Set the output voltage to 'value' in volts
CHx:CUR value | Set the output current to 'current' in amps. If current is preceeded by '+' or '-' it will force source or sink only operation.
CHx:CAL:SET | Calibration routine. (Factory use only. Disabled by default.)
CHx:CAL:RES | Restore factory calibration. (Only useful if the user has overwritten the calibration, which is not possible without editing the firmware.)
CHx:MEA:VOL | Returns the measured output voltage in volts.
CHx:MEA:CUR | Returns the measured output current in amps.

Parameters

  chrSerialData | data received from the serial interface

Definition at line 235 of file EasySMU_Run.ino.

## ◆ ReadLine()

boolean ReadLine | ( | char * | serialData | ) |

Read available characters from the serial port and append the result to the *serialData string.

Returns
  Returns true when '\n' or '\r' is read. Otherwise, it returns false.

Parameters

  serialData | string used to store all collected data collected since the last '\n' or '\r'

Definition at line 187 of file EasySMU_Run.ino.

## ◆ SetCurrent()

static void SetCurrent | ( |  | ) |
| static

Check if the user is pressing the I+, I++, I-, or I– buttons. If so, adjust the current.

Definition at line 531 of file EasySMU_Run.ino.

## ◆ setup()

static void setup | ( | void |  | ) |
| static

Initialize the Linduino, EasySMU, screen, etc.

Definition at line 593 of file EasySMU_Run.ino.

## ◆ SetVoltage()

static void SetVoltage | ( |  | ) |
| static

Check if the user is pressing the V+, V++, V-, or V– buttons. If so, adjust voltage.

Definition at line 486 of file EasySMU_Run.ino.

## Macro Definition Documentation

## ◆ _BUTTON_TIME_1

#define _BUTTON_TIME_1 4000

Touchscreen step size increases after _BUTTON_TIME_1 milliseconds. This allows faster user adjustment when the button is held longer.

Definition at line 129 of file EasySMU_Run.ino.

## ◆ _BUTTON_TIME_2

#define _BUTTON_TIME_2 2000

Touchscreen step size increases after _BUTTON_TIME_2 milliseconds. This allows faster user adjustment when the button is held longer.

Definition at line 131 of file EasySMU_Run.ino.

## ◆ _BUTTON_WAIT_TIME

#define _BUTTON_WAIT_TIME 500

Give the user 500ms to adjust a value before setting the output. This allows the user to adjust a value before it shows up at the output.

Definition at line 126 of file EasySMU_Run.ino.

## ◆ _IBUTTON_STEP_1

#define _IBUTTON_STEP_1 0.0000030

Current step size after _BUTTON_TIME_1.

Definition at line 137 of file EasySMU_Run.ino.

## ◆ _IBUTTON_STEP_2

#define _IBUTTON_STEP_2 0.0000010

Current step size after _BUTTON_TIME_2.

Definition at line 139 of file EasySMU_Run.ino.

## ◆ _VBUTTON_STEP_1

#define _VBUTTON_STEP_1 3

Voltage step size after _BUTTON_TIME_1.

Definition at line 133 of file EasySMU_Run.ino.

## ◆ _VBUTTON_STEP_2

#define _VBUTTON_STEP_2 1

Voltage step size after _BUTTON_TIME_2.

Definition at line 135 of file EasySMU_Run.ino.

## ◆ I2C_FT6206_ADDR0

#define I2C_FT6206_ADDR0 0x38

touchscreen I2C address

Definition at line 59 of file MasterAddressConstants.h.

## ◆ SERIAL_COMMANDS_ERROR

#define SERIAL_COMMANDS_ERROR -1

Definition at line 215 of file EasySMU_Run.ino.

## ◆ SERIAL_COMMANDS_SIZE_0

#define SERIAL_COMMANDS_SIZE_0 2

## ◆ SERIAL_COMMANDS_SIZE_1

#define SERIAL_COMMANDS_SIZE_1 9

## ◆ SERIAL_COMMANDS_SIZE_12

#define SERIAL_COMMANDS_SIZE_12 6

## ◆ SERIAL_COMMANDS_SIZE_121

#define SERIAL_COMMANDS_SIZE_121 2

## ◆ SERIAL_COMMANDS_SIZE_122

#define SERIAL_COMMANDS_SIZE_122 2

## ◆ SERIAL_COMMANDS_SIZE_LCD

#define SERIAL_COMMANDS_SIZE_LCD 2

## Variable Documentation

## ◆ IOpanel

EasySMU_IOpanel IOpanel

IOpanel provides an interface between the EasySMU hardware and a touchscreen.

Definition at line 156 of file EasySMU_Run.ino.

## ◆ serial_data

char serial_data[100]

Used to buffer data from serial interface.

Definition at line 160 of file EasySMU_Run.ino.

## ◆ SMU

EasySMU SMU[8]

Initial value:
=
{
EasySMU(I2C_Board0_EEPROM_ADDR0, I2C_Board0_LTC2655_LLL_ADDR0, I2C_Board0_LTC2485_Vout_LF_ADDR0, I2C_Board0_LTC2485_Iout_LH_ADDR0),
EasySMU(I2C_Board1_EEPROM_ADDR0, I2C_Board1_LTC2655_LLL_ADDR0, I2C_Board1_LTC2485_Vout_LF_ADDR0, I2C_Board1_LTC2485_Iout_LH_ADDR0),
EasySMU(I2C_Board2_EEPROM_ADDR0, I2C_Board2_LTC2655_LLL_ADDR0, I2C_Board2_LTC2485_Vout_LF_ADDR0, I2C_Board2_LTC2485_Iout_LH_ADDR0),
EasySMU(I2C_Board3_EEPROM_ADDR0, I2C_Board3_LTC2655_LLL_ADDR0, I2C_Board3_LTC2485_Vout_LF_ADDR0, I2C_Board3_LTC2485_Iout_LH_ADDR0),
EasySMU(I2C_Board4_EEPROM_ADDR0, I2C_Board4_LTC2655_LLL_ADDR0, I2C_Board4_LTC2485_Vout_LF_ADDR0, I2C_Board4_LTC2485_Iout_LH_ADDR0),
EasySMU(I2C_Board5_EEPROM_ADDR0, I2C_Board5_LTC2655_LLL_ADDR0, I2C_Board5_LTC2485_Vout_LF_ADDR0, I2C_Board5_LTC2485_Iout_LH_ADDR0),
EasySMU(I2C_Board6_EEPROM_ADDR0, I2C_Board6_LTC2655_LLL_ADDR0, I2C_Board6_LTC2485_Vout_LF_ADDR0, I2C_Board6_LTC2485_Iout_LH_ADDR0),
EasySMU(I2C_Board7_EEPROM_ADDR0, I2C_Board7_LTC2655_LLL_ADDR0, I2C_Board7_LTC2485_Vout_LF_ADDR0, I2C_Board7_LTC2485_Iout_LH_ADDR0)
}
I2C_Board3_LTC2485_Iout_LH_ADDR0
#define I2C_Board3_LTC2485_Iout_LH_ADDR0
Definition: MasterAddressConstants.h:24
I2C_Board7_LTC2485_Vout_LF_ADDR0
#define I2C_Board7_LTC2485_Vout_LF_ADDR0
Definition: MasterAddressConstants.h:54
EasySMU
The EasySMU class contains functions for interacting with the EasySMU source measurement unit...
Definition: EasySMU.h:130
I2C_Board5_LTC2485_Iout_LH_ADDR0
#define I2C_Board5_LTC2485_Iout_LH_ADDR0
Definition: MasterAddressConstants.h:38
I2C_Board4_LTC2655_LLL_ADDR0
#define I2C_Board4_LTC2655_LLL_ADDR0
Definition: MasterAddressConstants.h:35
I2C_Board0_EEPROM_ADDR0
#define I2C_Board0_EEPROM_ADDR0
Definition: MasterAddressConstants.h:2
I2C_Board7_LTC2655_LLL_ADDR0
#define I2C_Board7_LTC2655_LLL_ADDR0
Definition: MasterAddressConstants.h:56
I2C_Board1_LTC2655_LLL_ADDR0
#define I2C_Board1_LTC2655_LLL_ADDR0
Definition: MasterAddressConstants.h:14
I2C_Board3_EEPROM_ADDR0
#define I2C_Board3_EEPROM_ADDR0
Definition: MasterAddressConstants.h:23
I2C_Board3_LTC2485_Vout_LF_ADDR0
#define I2C_Board3_LTC2485_Vout_LF_ADDR0
Definition: MasterAddressConstants.h:26
I2C_Board5_LTC2655_LLL_ADDR0
#define I2C_Board5_LTC2655_LLL_ADDR0
Definition: MasterAddressConstants.h:42
I2C_Board1_LTC2485_Iout_LH_ADDR0
#define I2C_Board1_LTC2485_Iout_LH_ADDR0
Definition: MasterAddressConstants.h:10
I2C_Board7_EEPROM_ADDR0
#define I2C_Board7_EEPROM_ADDR0
Definition: MasterAddressConstants.h:51
I2C_Board6_LTC2655_LLL_ADDR0
#define I2C_Board6_LTC2655_LLL_ADDR0
Definition: MasterAddressConstants.h:49
I2C_Board6_LTC2485_Vout_LF_ADDR0
#define I2C_Board6_LTC2485_Vout_LF_ADDR0
Definition: MasterAddressConstants.h:47
I2C_Board2_LTC2485_Vout_LF_ADDR0
#define I2C_Board2_LTC2485_Vout_LF_ADDR0
Definition: MasterAddressConstants.h:19
I2C_Board3_LTC2655_LLL_ADDR0
#define I2C_Board3_LTC2655_LLL_ADDR0
Definition: MasterAddressConstants.h:28
I2C_Board6_EEPROM_ADDR0
#define I2C_Board6_EEPROM_ADDR0
Definition: MasterAddressConstants.h:44
I2C_Board5_LTC2485_Vout_LF_ADDR0
#define I2C_Board5_LTC2485_Vout_LF_ADDR0
Definition: MasterAddressConstants.h:40
I2C_Board4_EEPROM_ADDR0
#define I2C_Board4_EEPROM_ADDR0
Definition: MasterAddressConstants.h:30
I2C_Board4_LTC2485_Vout_LF_ADDR0
#define I2C_Board4_LTC2485_Vout_LF_ADDR0
Definition: MasterAddressConstants.h:33
I2C_Board6_LTC2485_Iout_LH_ADDR0
#define I2C_Board6_LTC2485_Iout_LH_ADDR0
Definition: MasterAddressConstants.h:45
I2C_Board1_EEPROM_ADDR0
#define I2C_Board1_EEPROM_ADDR0
Definition: MasterAddressConstants.h:9
I2C_Board2_LTC2655_LLL_ADDR0
#define I2C_Board2_LTC2655_LLL_ADDR0
Definition: MasterAddressConstants.h:21
I2C_Board5_EEPROM_ADDR0
#define I2C_Board5_EEPROM_ADDR0
Definition: MasterAddressConstants.h:37
I2C_Board1_LTC2485_Vout_LF_ADDR0
#define I2C_Board1_LTC2485_Vout_LF_ADDR0
Definition: MasterAddressConstants.h:12
I2C_Board4_LTC2485_Iout_LH_ADDR0
#define I2C_Board4_LTC2485_Iout_LH_ADDR0
Definition: MasterAddressConstants.h:31
I2C_Board2_LTC2485_Iout_LH_ADDR0
#define I2C_Board2_LTC2485_Iout_LH_ADDR0
Definition: MasterAddressConstants.h:17
I2C_Board2_EEPROM_ADDR0
#define I2C_Board2_EEPROM_ADDR0
Definition: MasterAddressConstants.h:16
I2C_Board7_LTC2485_Iout_LH_ADDR0
#define I2C_Board7_LTC2485_Iout_LH_ADDR0
Definition: MasterAddressConstants.h:52
I2C_Board0_LTC2485_Vout_LF_ADDR0
#define I2C_Board0_LTC2485_Vout_LF_ADDR0
Definition: MasterAddressConstants.h:5
I2C_Board0_LTC2655_LLL_ADDR0
#define I2C_Board0_LTC2655_LLL_ADDR0
Definition: MasterAddressConstants.h:7
I2C_Board0_LTC2485_Iout_LH_ADDR0
#define I2C_Board0_LTC2485_Iout_LH_ADDR0
Definition: MasterAddressConstants.h:3

Array of eight EasySMU instances that hold state for up to eight stacked EasySMU shields.

The I2C addresses of each board are configured while calling these constructors.

Definition at line 143 of file EasySMU_Run.ino.