2 Replies Latest reply on Dec 13, 2018 4:43 PM by yohichi.kusagaya_3014931

    External I2C master connection method

    yohichi.kusagaya_3014931

      Hello,

       

      Below circuit was made for switching internal / external master I2C for PSoC3. Internal I2C (I2C_1) is working correctly, but external I2C( MiniProg3 w/ Bridge control panel connects to SCL_EXT pin and SDA_EXT pin) does not work now. I could see the clock wave from on TP1 for both Internal and external, but SCL pin outputs internal clock only. I am not sure what wrong points. Could you give me same advice? I attached source code for CY8CKIT-001_PSoC_Development_Kit.  

       

        • 1. Re: External I2C master connection method
          nsha

          Hello,

           

          It looks like the SCL will always be driven low. The reason being all the SCL and SDA lines of I2C are expected to be at 'open drain drives low' drive mode. So, once the I2C line is pulled low, it stays low forever and acts as a permanent latch.

           

          I'm afraid the switching functionality could not be achieved by a simple schematic. However, a custom verilog component could be developed to act as an I2C mux. It basically snoops the I2C packets from the master and decides how to connect the buses. I have attached the project. Please use it as reference.

           

          Known limitation:

          Currently, the component assumes that the slave will not stretch the clock when individual data or address bits are sent by the master.

          Similarly, it is assumed that the master will not stretch the clock when receiving individual bits from the slave.

          In simple words, the component assumes that clock stretching will occur only during ACK/NACK phase and between bytes in a multi-byte transfer.

           

          I hope this helps.

          Thanks,
          Shanmathi

          • 2. Re: External I2C master connection method
            yohichi.kusagaya_3014931

            Hello,

             

            Thank you for sending the project. I will confirm weather it meet our requirement.