switch for I2C and SPI

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
hiyac_351831
Level 3
Level 3
25 replies posted 10 replies posted 10 questions asked

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,

0 Likes
1 Solution
Anonymous
Not applicable

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.

View solution in original post

0 Likes
2 Replies
KyTr_1955226
Level 6
Level 6
250 sign-ins 10 likes given 50 solutions authored

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.

0 Likes
Anonymous
Not applicable

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.

0 Likes