1 Reply Latest reply on Dec 20, 2016 3:56 AM by vsrs

    I2C - Manually control sda pin

    antoine_1488471

      Hi all,

         

      I have a master and a slave on an i2c bus. I need to give an address to this slave by bit-banging the sda pin. On the slave, I want to detect an interrupt on the sda pin and read the address. Then the master will communicate with the slave using the i2c. My questions are the followings:

         

      1) How can I detect an interrupt on the sda pin and then start the SCB component?

         

      2) How can I link my CY_ISR() function to this interrupt?

         

      It's easy with a pin that you put on the schematic, but I don't have access to the sda pin on the schematic. My slave device is a cy8c404lqi-422 and I'm using PSoC Creator 4.0.

         

       

         

      Thanks in advance.

         

      -Antoine

        • 1. Re: I2C - Manually control sda pin
          vsrs

          Hi Antoine

             

          Are you trying to have low power design in your application ? If so ,SCB component already supports wake-up from sleep and deep-sleep on Address match, you can refer SCB datasheet for more info on this.

             

          Also you can try connecting SDA to another GPIO(hardware connection) and start SCB component when GPIO ISR is triggered and disable this interrupt after servicing it for the first time and enable after I2C transmission is complete .

             

          You can try importing SCB component into the project and adding ISR on SDA pin ,I have not tested this before.

             

          Best Regards,
          VSRS