I2C, or Inter-Integrated Circuit, is a chip-to-chip interface supporting two-wire
communication. You can connect to I2C peripheral devices and read from
and write to them. Create the interface object using the
device function with an
To use the I2C interface, you must have either a Total Phase® Aardvark I2C/SPI™ Host Adapter or an NI™ USB-8451 or USB-8452 I2C/SPI Interface Device installed.
Discover and Connect
|List available Total Phase Aardvark controllers|
|Total Phase Aardvark Adapter connection|
|List available NI USB-845x controllers|
|NI USB-845x connection|
|Scan for I2C peripheral devices connected to controller board|
|I2C peripheral device connection|
Configure and Communicate with DIO Pins
|Set digital pin mode on controller|
|Read logic level value of digital pin on controller|
|Write logic level value to digital pin on controller|
Communicate with I2C Peripheral Devices
|Read data from I2C peripheral device|
|Write data to I2C peripheral device|
|Read data from I2C peripheral device register|
|Write data to I2C peripheral device register|
- I2C Interface Overview
Connect to I2C controller boards and peripheral devices and communicate with them from MATLAB®.
- Configure I2C Controller Board Communication
Discover and connect to Total Phase Aardvark™ or NI USB-845x controller boards using the
- Transmit Data to Peripheral Device Over I2C Interface
Communicate with an I2C peripheral device connected to a Total Phase Aardvark or an NI USB-845x controller board.
- Install Instrument Control Toolbox Support Package for Total Phase Aardvark I2C/SPI Interface
Install the support package for a Total Phase Aardvark controller to communicate with I2C and SPI interfaces in MATLAB.
- Install Instrument Control Toolbox Support Package for National Instruments NI-845x I2C/SPI Interface
Install the support package for an NI USB-845x controller to communicate with I2C and SPI interfaces in MATLAB.
- Transition Your Code to aardvark or ni845x Interface
Create I2C connections using the
devicefunction with an
ni845xobject instead of
Troubleshoot the I2C interface.