Troubleshooting I2C Interface
I2C, or Inter-Integrated Circuit, is a chip-to-chip interface supporting two-wire communication. Instrument Control Toolbox™ I2C support lets you open connections with individual chips and to read and write over the connections to individual chips.
The Instrument Control Toolbox I2C interface lets you do chip-to-chip communication using a Total Phase® Aardvark I2C/SPI™ Host Adapter or NI™ USB-845x I2C/SPI Interface Device. Some applications of this interface include communication with SPD EEPROM and NVRAM chips, communication with SMBus devices, controlling accelerometers, accessing low-speed DACs and ADCs, changing settings on color monitors using the display data channel, changing sound volume in intelligent speakers, reading hardware monitors and diagnostic sensors, visualizing data sent from an I2C sensor, and turning on or off the power supply of system components.
Supported Platforms
The aardvark
or ni845x
interfaces for
connecting to I2C controllers in Instrument Control Toolbox are only supported on 64-bit Windows® platforms.
For updates to the list of currently supported platforms for MATLAB®, see System Requirements.
Controller Requirements
You must have the Total Phase
Aardvark™ or NI-845x drivers installed to use
the aardvark
or ni845x
interface. The
following sections describe requirements for each option.
Total Phase Aardvark Requirements
To use the aardvark
interface with the Aardvark controller, make sure you install the
following software.
Install the Total Phase USB Drivers for Windows. Verify that the Aardvark adapter appears in the Windows Device Manager under the USB section.
Uninstall any existing Aardvark Software API on your computer. Download and install the Instrument Control Toolbox Support Package for Total Phase Aardvark I2C/SPI Interface. For more information, see Install Instrument Control Toolbox Support Package for Total Phase Aardvark I2C/SPI Interface.
Make sure that the Aardvark controller is physically connected to your computer using the USB connector.
Optionally, you can also check that the Aardvark controller is working properly in the Total Phase Control Center Serial Software.
NI USB-845x Requirements
To use the ni845x
interface with the NI USB-845x controller, download the hardware support package to
obtain the latest driver, if you do not already have the driver installed. If
you already have the latest driver installed, you do not need to download this
support package.
If you do not have the NI-845x driver installed, see Install Instrument Control Toolbox Support Package for National Instruments NI-845x I2C/SPI Interface to install it.
Configuration and Connection
Make sure that you have the correct instrument driver installed for your device. Refer to your device’s documentation and the vendor’s web site.
Make sure your device is supported in Instrument Control Toolbox. See Is My Hardware Supported?.
You must have the Total Phase Aardvark drivers installed to use the
aardvark
interface or the NI USB-845x drivers installed to use theni845x
interface. Install the appropriate support package if you have not already. See Controller Requirements.Make sure that your I2C controller board is physically plugged in to the computer running MATLAB. You can verify that you have one of the controllers installed by using the
aardvarklist
function or theni845xlist
function.If you see an error message, you need to install one of the support packages or install the driver directly from the vendor.
You will need the serial number displayed to create the
aardvark
orni845x
object. If your controller and its serial number is not displayed, check the previous steps.Make sure you can create the
aardvark
orni845x
object. You must provide the controller's serial number as an argument to create the object. You can identify the controller's serial number by looking for the serial number printed on the board.If you do not get an error, the connection was made successfully. If you do get an error, follow the steps in the error message or check the previous steps listed here.
When you have connected, you can communicate with your peripheral devices connected to the controller. See Transmit Data to Peripheral Device Over I2C Interface for an example of reading and writing to a chip.