12-13-2011 07:12 PM
Generated a simple program to talk to i2c on NSE5310 using usb-8451. I get the following error.
Error -301742 occurred at NI-845x I2C Write Read.vi:1
Possible reason(s):
NI-845x: The slave did not acknowledge an address+direction byte transmitted by the I2C master. Reasons include the incorrect address set in the I2C configuration or the incorrect use of the 7-bit address. When entering an address to access a 7-bit device, do not include the direction bit. The NI-845x Basic I2C API internally sets the direction bit to the correct value, depending on the function (write or read). If your datasheet specfies the 7-bit device address as a byte, discard the direction bit (bit 0) and right-shift the byte value by one to create the 7-bit address.
I do have pullup resistors of 1.5k on both SDA and SCL. I've attached the data sheet for the device and a sample program.
THANKS FOR YOUR TIME. Happy Holidays.............................
12-14-2011 08:21 AM
You are providing the wrong address. As the error message says, you must provide the 7-bit address, excluding the read/write bit. . You are providing the full value of the first byte, including the read/write bit. In other words, you are doing the exact opposite of what the error message tells you to do. If you've set the user-bits to 0 then the correct address is 0x40.
Side-note: When you set a front panel numeric control to hex display you should also display the radix so that others know that it refers to "81" hex, and not "81" decimal, which are two different values.
12-17-2011 07:12 AM
Thanks for your reply.
12-17-2011 12:11 PM
Well, did that fix the problem?
12-17-2011 03:48 PM