LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

IC2 Communication.

I am using the NI845x to communicate via I2C. My chip has a master address of A2. I've been using the examples that come with labview that I will be attaching. I have to wirte the address A2 as 51 since Labview does not take the first bit which is the direction bit. Now I need to change the data of the different registers from the chip and I dont know how to???
I've tried using the same sequence as the example code and writing to the registers addresses but it gives me an error about the master address is not correct....so basically the only time I can write or get some info out of the chip is when I use address 51. Any help is really appreciate it since I am new to this I2C communication.

Thanks,
0 Kudos
Message 1 of 3
(3,455 Views)
What do you mean by Labview does not take the first bit which is the direction bit?  If the number is a U8, U16, or U32, it is an unsigned integer which means the first bit is part of the number.  It it is I8, I16, I32, then the first bit is a sign (+ or -).  A2 is a hex number, which is 162 in decimal.  How does this relate to 51?
 
With I2C, your device has to be programmed to respond to a certain address.  If you want to use different devices with different addresses, you should contact the device manufacturer to learn how to program the device address.  The 8451 will send out the address that you program into the code.  There must be a device with that address to respond.
- tbob

Inventor of the WORM Global
0 Kudos
Message 2 of 3
(3,445 Views)
I can't look at your code since it's in 8.5, and I only have 8.2, but based on the VI names it looks like you're talking to a 24LC512, which is a 512K EEPROM. The EEPROM can't have a master address since it's a slave device. You're probably getting confused between 7-bits an 8-bits with respect to addresses. I2C normally uses 7-bit or 10-bit addressing.  According to the spec for that chip, the first 4 bits are a control code, fixed at 1010. The next 3 bits are the specific chip address. You probably have line A0 tied high to give a chip select address of 001. This gives the 7-bit address of 1010001. Now, this can be either hex A2 (162 decimal) or hex 33 (51 decimal) depending on whether you prepend a zero or append a zero to get 8 bits. The proper interpretation is decimal 51 (prepending a zero) since the 8th bit in the first byte that is sent is the read/write flag.

You may want the get the I2C spec from NXP: http://www.nxp.com/acrobat_download/literature/9398/39340011.pdf

0 Kudos
Message 3 of 3
(3,435 Views)