2 Replies Latest reply on Sep 18, 2018 12:01 AM by yosi

    switch for I2C and SPI

    user_476994544

      Hello,

       

      I have a question about PSoC5LP I2C and SPI.
      Device: PSoC5LP
      Goal:   switch the I2C and SPI in the same project

      <Pin Type>   <I2C>         <SPI>
      Pin_1:    Not Connected   MISO
      Pin_2:            SDA           MOSI
      Pin_3:            SCL           SCLK

       

       

       

       

      I created a topdesign of the below image, but error occured.

      TopDesign.png

       

      The difference of I2C and SPI bothers me.
      I2C pin(SCL, SDA) is bidirectional.
      SPI pin(MISO, MOSI)is undirectional.
      I believe that this is the cause of error.

       

      Question:
      Would you say this is feasible?
      I would be most grateful if you could send me an sample project in due course.

       

      Best Regards,

        • 1. Re: switch for I2C and SPI
          KTrenholm_1955226

          Rather than just a screenshot, please post your whole project if possible.  We can only see 4 and a half of the 19 errors.

          In PSoC Creator:

          Project > Archive Workspace/Project > Minimal

          Make sure "Compress Archive (zip)" is checked.  This will create a nice little zip file you can attach to a post.

           

          As far as your specific issue:

          Check out the setting "External OE Buffer" in the "Advanced" tab of the I2C component.  This will split the I2C lines into 4 signals ,2 input and 2 output, rather than 2 bidirectional signals.  Signals that go into a mux inside PSoC must be the same direction.  You are also getting errors due to not having a select signal on either of those muxes.  You can control them via firmware with a control register component.

          • 2. Re: switch for I2C and SPI
            yosi

            With the control register, application can switch between the modes. But this is not easy to test.

            SwitchI2CandSPI.png

             

            If you use PSoC 4 families SCB, I think this would have been directly possible with the Unconfigured SCB mode.