Documentation Center

  • Trial Software
  • Product Updates

Configuring I2C Communication

You need to have either a Total Phase Aardvark host adaptor or a NI-845x adaptor board installed to use the i2c interface. The following sections describe configuration for each option.

Configuring Aardvark

You must install the "Aardvark Software API and Share Library" appropriate for your operating system. See I2C Interface Usage Requirements and Guidelines for more information.

The aardvark.dll file that comes with the Total Phase Aardvark adaptor board must be available in one of the following locations for use on Windows® platforms.

  • The location where MATLAB was started from (Bin folder).

  • The MATLAB current folder (PWD).

  • The Windows folder C:\winnt or C:\windows.

  • The folders listed in the PATH environment variable.

Ensure that the Aardvark adaptor is installed properly.

Look at the adaptor properties.

You can create an I2C object using the i2c function. The example in the next section uses an I2C object called eeprom that communicates to an EEPROM chip.

eeprom = i2c('aardvark',0,hex2dec('50'));

You can then display the object properties.

You can see that the communication settings properties reflect what was used to create the object – BoardIndex of 0 and RemoteAddress of 50h. For information about other properties, see Using Properties on an I2C Object.

Configuring NI-845x

To use the I2C interface with the NI-845x adaptor, you must 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 Installing the NI-845x I2C Driver Support Package to install it via the Support Package Installer.

Ensure that the NI-845x adaptor is installed properly.

Look at the NI-845x adaptor properties.

You can create an I2C object using the i2c function.

i2cobj = i2c('NI845x', 0, '10h');

You can then display the object properties.

You can see that the communication settings properties reflect what was used to create the object – BoardIndex of 0 and RemoteAddress of 10h. For information about other properties, see Using Properties on an I2C Object.

Was this topic helpful?