10:11 am
March 23, 2015
For a MAX7318 (i2c 16-bit I/O Port Expander) with address lines A0, A1, A2 all grounded the 7-bit Slave address in the datasheet is specified as:
A6 A5 A4 A3 A2 A1 A0
0 1 0 0 0 0 0 or 0x40 (hex). It seems the Hex value is derived by adding a "0" to the LSB of the address (bit shift left)
However to get the i2c VI's to work I used the Slave address of 0x20 ie. I had to add a "0" to the MSB of the Slave address ie. A7 (bit shift right).
I now seem to have a similar problem with the AMC6821 i2C Fan Controller where the two address lines (A0/A1) are both grounded and so the datasheet has a slave address of:
A6 A5 A4 A3 A2 A1 A0
0 0 1 1 0 0 0 or 0x30 (hex) if adding a "0" to LSB, but should it be 0x18 (ie. 0001 1000) for the Slave address (ie. add "0" to MSB)?
Chris
10:51 pm
March 12, 2015
Address is handled exactly as documented in the Arduino Wire library here:
Note
There are both 7- and 8-bit versions of I2C addresses. 7 bits identify the device, and the eighth bit determines if it's being written to or read from. The Wire library uses 7 bit addresses throughout. If you have a datasheet or sample code that uses 8 bit address, you'll want to drop the low bit (i.e. shift the value one bit to the right), yielding an address between 0 and 127. However the addresses from 0 to 7 are not used because are reserved so the first address that can be used is 8.
12
1 Guest(s)