1 Reply Latest reply on Oct 13, 2020 11:44 PM by YoIs_1298666

    I2C master repeated start for PSoC4000S




      I would like to execute a repeated start of I2C master with PSoC4000S.

      According to SCB component datasheet, it seems that it can be executed by setting the mode of the argument.

      uint32 SCB_I2CMasterWriteBuf(uint32 slaveAddress, uint8 * wrData, uint32 cnt, uint32 mode)


      In order to make a repeated start from the second I2C communication, I tried the following three mode settings

      in the first I2C communication.

      As a result, running this API will lock the SCL to "low".

      The return value of this API is I2C_I2C_MSTR_NO_ERROR.


      The return value of the I2C_I2CMasterStatus API is I2C_I2C_MSTAT_XFER_INP.


      How can I execute a repeated start?


      Best regards,


        • 1. Re: I2C master repeated start for PSoC4000S

          I observed the I2C communication waveform with an oscilloscope.

          As a result, I was able to do a Repeated Start.


          I have two questions.

          1. The status of the result of the first I2C communication is as follows.

               I2C_I2CMasterWriteBuf return value: I2C_I2C_MSTR_NO_ERROR

               I2C_I2CMasterStatus return value: I2C_I2C_MSTAT_WR_CMPLT | I2C_I2C_MSTAT_XFER_HALT | I2CHW_I2C_MSTAT_XFER_INP

                                                                       I2C_I2CMasterClearStatus execution

                                                                       I2C_I2CMasterStatus execution

                                                                       As a result I2C_I2CMasterStatus return value : Keeping I2C_I2C_MSTAT_XFER_INP

                                                                       **I2CHW_I2C_MSTAT_XFER_HALT is preferred                                                         

               Which status would be best to look at and execute I2C_I2CMasterWriteBuf for the second I2C communication?

          2. The SCL is low even if there is no address match for the I2C slave, but what is the best way to handle the subsequent return?


          Best regards,