3 Replies Latest reply on Nov 9, 2018 12:56 AM by alamandaa_16

    I2C Memory Address and Stop and start bit selection in FX-3 Cypress.

    ThM_3776866

      Hi all,

      I am working on Cypess FX-3 I2C interface .My slave device is EEPROM his memory address length is varying depends on function. how to select the control mask value if different memory address length read and write operation.

      Read operation:

      given example code

      if 1 byte --- ctrlMask=0x02

      if 2 byte ---- ctrlMask = 0x04

      Q1. Therefore what is the value of ctrlMask in 3-byte, 4-byte and 5-byte address?.

      Q2. what is value of ctrlMask in case of repeated Write operation.?

       

      Thank you.

       

      Best regards,

      Thrimurthi M

       

       

      SrinathS_16abhinavg_21PradiptaB_11

        • 1. Re: I2C Memory Address and Stop and start bit selection in FX-3 Cypress.
          alamandaa_16

          Hi Thrimurthi,

           

          Please go through the following link which speaks about I2C Memory addressing

          "www.cypress.com/file/50506/download"

           

          Regards,

          Anil Srinivas.

          • 2. Re: I2C Memory Address and Stop and start bit selection in FX-3 Cypress.
            ThM_3776866

            Thanks for your replay..

             

            Given "FX3_I2C_DETAILS" doc they mention only 2 byte memory address. they are not specifying 3,4,5 byte of memory address.

            0nly Read operation the control mask is changing, but in Write operation control mask is always "0x0000" what is region?

             

             

            Thank you

            Best regards.

            Thrimurthi M

            • 3. Re: I2C Memory Address and Stop and start bit selection in FX-3 Cypress.
              alamandaa_16

              Hi Thrimurthi,

              Q1. Therefore what is the value of ctrlMask in 3-byte, 4-byte and 5-byte address?

              an I2C EEPROM read requires the byte address for the read to be written first.

              A.3- byte addressing mode with random read operation:

              preamble.buffer[0] = SlaveAddr; /* Slave address: Write operation */

              preamble.buffer[1] = (uint8_t)(( ByteAddr & 0Xff0000) >> 16);

              preamble.buffer[2] = (uint8_t)( ByteAddr & 0x00ff00)

              preamble.buffer[3] = (uint8_t)( ByteAddr & 0x0000ff)

              preamble.buffer[4] = SlaveAddr | 0x1; /* Slave address: Read operation */

              preamble.length = 5;

              preamble.ctrlMask = 0x0008;

              CyU3PI2cReceiveBytes (&preamble, testbuf, 1,0)

              ctrlMask field will be 0x0008 as a start bit is required after the 4th byte (fourth bit is set)

              B.3-byte addressing mode with random read operation:

              The buffer field shall hold the 4 bytes, the length field shall be 4, and the ctrlMask field is zero as no additional start/stop conditions are needed.

              -- 4-byte addressing mode with random read operation ctrlMask field will be 0x0010 as a start bit is required after the 5th byte (5th bit is set).

              --5--byte addressing mode with random read operation ctrlMask field will be 0x0020 as a start bit is required after the 6th byte (6th bit is set).

              --Only write operation ctrlMask field will be 0x0000.

               

              Regards,

              Anil Srinivas.