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.

PCM1862: reading registers via I2C

Part Number: PCM1862

Hi,

I am re-visiting the firmware of a quite old design that uses a PCM1862 device for Mic/Line input and I have noticed in the software, when I read a register from the PCM1862 using:

IIC_START : IIC_DEVICE_ADDRESS (WRITE) : IIC_REGISTER_ADDRESS : IIC_RESTART : IIC_DEVICE_ADDRESS (READ) : READ(ACK) : READ(ACK) :: etc. : READ(NACK) : IIC_STOP

The register address  always has the MSBit set (0x80). I cannot remember why I did this, and I can't find anything in the current datasheet that says why this must be done.

Can anyone please help, explain what this is for?

It's not a read/write bit because that is in with the IIC_DEVICE_ADDRESS and also it is the same in my PCM1862 Write Register routine as well.

Thanks for anyone who can offer an explanation.

Regards

PhilipJ

  • Hi Philip,

    The devices have a 7-bit I2C slave address. The first 6 bits of this address are fixed as (MSB) 100101 (LSB) and the last bit of the address depends on the state of the AD pin. The read/write bit comes after this address. This is the device address though, not the register address. If you were writing all register addresses with the MSB high you would not be accessing the correct registers. What you sequence above doesn't show is the ACK that happens between the R/W bit and the register address, so perhaps it is the ACK bit you are referring to?

    Best,

    Zak

  • Hi Zak,

    thanks for answering my question, sorry for the incomplete sequence not showning the ACK you mention, it isn't the ACK they are all taken care of as required to follow the I2C spec.

    You say that with the MSbit set, I would not be reading/writing the registers correctly but strangley it does, is it possible that because the highest numbered register (in page 0) is 120 that the chip just ignores the MSbit? I ask because after posting I thought, "what the hell, let's just remove the MSbit = 1 and see what happens" and it works just the same!!

    Anyway, the chip is working ok, the fault I was looking to fix may have been that I was writing a value of 4 or 8 to registers 6 to 9 to select the input, I missed the bit that says "bit 6 should always be written as a '1'". Now my program is writing 0x44 or 0x48 and everything seems to be OK

    thanks again for your time

    PhilipJ