This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

I2C Shifted slave address?



I have been observing a slave address different then I expect.

I am connected to an Analog Devices ADAU1701, and the literature says it's slave address is 0x68 (with 2 external pins used to modify it's slave address but I have them grounded.)

It then says the LSB of the address is the R/W bit, and I understand all that.

If I place 0x68 in the SAR, tracing the data bits on my 'scope, I see 0xD0 when I want to write, (0xD1 for read.) Rather, I use the statement

I2caRegs.I2CSAR = Slave_address >> 1;   // where Slave_address = 0x0068

I thus infer the I2C firmware is appending the r/w bit to the end of the SAR (making 9 bits) then shifting the 9 bits to the left one bit loosing the MSb.

Is this expected behavior? If so, where is it documented?

Thanks, Mark.

Edit Sorry, I am using CCS 3.3, on a Piccolo 28027 ControlCard with it's Docking Station.

  • Hi Mark,

    The address needs to be 7-bits(or 10-bits if you explicitly enable 10-bit addressing) by default. So if 0x68 is the address of the slave you should see the following on the bus :

    |START |  1 | 1 | 0 | 1 | 0 | 0 | 0 | R/W'|ACK|

                 |------------0xDX-----------------|

    The address is generated as follows (I2CSAR << 1 & R/W'), so you should see 0xD0 for writes and 0xD1 for reads.

    For reference, look at the NXP I2C protocol v2.1 or look for the section "Serial data formats" in the I2C chapter of the reference manual  for whichever C2000 device you are working with.

  • Thanks, Vishal:

    I did research the literature on the datasheet for the Piccolo 28027, and the supplemental data sheet SPRUFZ9D "TMS320x2802x, 2803x Piccolo Inter-Integrated Circuit (I2C) Module," and also the NXP spec and found no reference to shifting the chip address.

    What you describe is what I observe, but not what I would expect if I were programming the firmware.

    If it were me, I would simply replace the LSb with the R/W' bit, not shift the entire thing, so I could load the register with what I read on the other device literature and not have to think about it.

    But, alas, I wasn't part of the design community. Too bad too, I am sure I would have done it right  :)

    Thanks for your help, I will mark this thread as answered.

    Mark.

    PS. Just to nit pick a little, in your example (I2CSAR << 1 & R/W') shouldn't it be an OR ( | ), not an AND { & ) ?

  • Cool Javelin said:
    PS. Just to nit pick a little, in your example (I2CSAR << 1 & R/W') shouldn't it be an OR ( | ), not an AND { & ) ?

    Absolutely right..it should be a |