4 Replies Latest reply on Jun 3, 2019 11:49 PM by xigu_1705831

    CY7C68013A I2C repeated start condition.

      My hardware contains CY7C68013A with specific I2C device (the device is connected to SDA/SCL pins). To read status register from slave device I have to send (WR) register address and then send repeated start condition to switch bus into reading mode. Unfortunately I did not find any solution on the cypress forum and EZ-USB/CY7C68013A datasheets.


      Does CY7C68013A support repeated start condition? 
      Could you please give me a sample code how to manage that?

        • 1. Re: CY7C68013A I2C repeated start condition.

          Hi Jaroslaw


          We have provided the source for EZUSB_ReadI2C in the C:\Cypress\USB\CY3684_EZ-USB_FX2LP_DVK\1.1\Target\Lib\LP\i2c.c


          This function will do and set al the necessary status, you can modify the function to implement the repeated start feature. You can see the implementation, and write another similar function in your project with this modified feature. After doing so, you can call this new function whenever you want. 

          • 2. Re: CY7C68013A I2C repeated start condition.



            I am encounter exactly the same issue as Jaroslaw described above. My h/w has CY8C3445AXI-104 device with its SDA/SCL pins connected to a specific DC/DC device and I need to read and monitor the voltage rail and status from this device. I am using PSoC Creator 3.3 and can't find any sample code for a PMBus frame with repeated start:


            [7bit device addr][Write bit]:[Ack]:[8bit Reg addr]:[Ack]:[RepeatStart][7bit device addr][Read bit]:[Ack]:[8bit MSB data byte]:[Ack]:[8bit LSB data byte]:[STOP].


            Please help, Thank!



            • 3. Re: CY7C68013A I2C repeated start condition.

              Ok found sample code and post it here as reference for anyone who may need it.


              void int8 pmbus_rd (uint8 slv_addr, uint8 cmd, uint8 *rbuf, uint8 bytes)
                  uint8 msgbuf[64];
                  /* Write the cmd/reg to the device and wait till xfer is complete */
                  I2CHW_MasterWriteBuf(slv_addr, &cmd, 1, I2CHW_MODE_NO_STOP);
                  while(I2CHW_MasterStatus() == I2CHW_MSTAT_XFER_INP);
                  /* Read data from device. This begins with a repeat start */
                  /* then wait till the transfer is complete */
                  I2CHW_MasterReadBuf(slv_addr, rbuf, bytes, I2CHW_MODE_REPEAT_START );
                  while(I2CHW_MasterStatus() == I2CHW_MSTAT_XFER_INP);
                  /* Show read data bytes on uart console. Use fix number of bytes for debug only */
                  sprintf(&msgbuf[0], "pmbus_rd() rbuf[0:4] = %02X %02X %02X %02X %02X!\r\n",
                          (int)rbuf[0], (int)rbuf[1], (int)rbuf[2], (int)rbuf[3], (int)rbuf[4]);
                  UART_PutArray((const uint8 *)&msgbuf[0], strlen(msgbuf));        

              • 4. Re: CY7C68013A I2C repeated start condition.

                    i met same issue on fx3 3014. we also want i2c restart signal, can you help if it possible on fx3?