I2C Communication Between USB-8452 and Arduino Uno

Updated Sep 11, 2023

Reported In

Hardware

  • USB-8452

Software

  • LabVIEW
  • SPI and I2C Driver API

Programming Language

  • C++

Other

  • Arduino Uno Board
  • Arduino IDE

Issue Details

I am trying to establish communication between a Master and a Slave by using USB-8452 as the Master and Arduino Uno as a Slave by using NI shipping example VI. But I am unable to establish communication and Error -301742 occurred. What are the correct ways to establish communication when using USB-8452 as Master and Arduino Uno as Slave?

Error -301742 occurred at NI-845x I2C Write Read.vi:1370001

Solution

This error can occur due to multiple reasons. Refer to Error -301742 Occurred During USB-845x I2C- or SMBus-Communication to start troubleshooting. If the error still occurs, one of the reasons is due to the Arduino EEPROM Address having been specified incorrectly in the LabVIEW code under I2C Slave Configuration. Below are the steps to initialize the Arduino Uno EEPROM address to establish communication with USB-8452 as the Master and Arduino Uno as the Slave.
  1. Download the latest Arduino Uno IDE here.
  2. Verify and upload the below code by using Arduino IDE into the Arduino Uno board.
#include<Wire.h>
void setup()
{
  Wire.begin(0x50); //put any value from 0x08 (0b0001000) to 0x7E (0b1111110) in place of slaveAddress.
}
void loop()
{
 Wire.beginTransmission(0x50);
}
  1. Then, specify the EEPROM address in the I2C slave configuration in the I2C Slave Configuration and the communication should be established.
  2. If the error still persists, try to swap the wire connecting between the USB-8452 and Arduino Uno or consider swapping to another Arduino Uno. 

Additional Information

As for further usage of Arduino code as slave hardware, consider referring to the Arduino technical support or Arduino community forum.