3 Replies Latest reply on May 7, 2018 7:34 AM by e.pratt_1639216

    CY8C4245AXI-473 software I2C

    user_1269049

      Hi,

      I am using 2 UARTS, so that I have no I2C left over. I willl  emulate I2C with control registers and status registers.

      Do I need to use 2 externally onnected input and output pins pin or can I use a bidirectial pin for this purpose?

      Thanks for input!

        • 1. Re: CY8C4245AXI-473 software I2C
          e.pratt_1639216

          I2C standard specifies two separate lines for Input/Output. You will want to have two separate external pins to get it to work. There are chips that communicate over 1 pin, but it is not I2C standard.

          If you really need to reduce the pin usage to one wire, something like this: https://datasheets.maximintegrated.com/en/ds/DS28E17.pdf

          would be your best bet.

          • 2. Re: CY8C4245AXI-473 software I2C
            user_1269049

            Hi e.pratt,

             

            thanks for your answer. My question was not clear enough.

            It is clear to me that I will need a SCL and a SDA per I2C.

            The question was about how to use the same pin as input and output.

             

            What was not clear to me is how I can use ONE pin simultaneously as input and output.

            Up to now I have always uses control registers and status registers connected to pins.

            I think it is not possible to connect one pin to a control register AND to a status register.

             

            Now I found out that I can use a bidirectional pin and use the API of the pin directly

            without status or control register - certainly 2 bidirectional pins for each I2C.

            • 3. Re: CY8C4245AXI-473 software I2C
              e.pratt_1639216

              You can runtime-modify the drive mode of the pins to support Input/Output. Thus, you can switch and use a single pin as both input/output by changing the mode and settings during runtime based on your current directional support.

              The datasheet/documentation within PSoC Creator IDE for the Pin Component should have all the information you need to set the input/output modes of the pin at runtime.

              Just configure the drive mode using software when you want to switch the mode. (High-z for input, strong drive or pull up/down for output).