Jump to content
Sign in to follow this  
MSPLife

SPI and I2C on same pin

Recommended Posts

Dear everyone,

I am going to use P1.6 and P1.7 on MSP430G2553 for both function I2C and SPI on same pins, so in the code I will continuously re-config pinmux to match with my purpose. My question is, is my idea possible to implement?

Thanks in advance!

Share this post


Link to post
Share on other sites

No you can't, since your SPI device can send data through P1.6 to your MSP430, you can't make certain that no accidental START token is present on the pins during SPI mode.

Also, I2C pins are common-collector; they use a pull up resistor and only pull the line down. While SPI is push-pull; it driver the line either high or low. Driving the line high while your I2C device (accidentally, after interpreting a START token) pulls it low might cause damage to the driver on either side of the line.

A way to maybe make it possible is by having some external hardware to disable SCL while in SPI mode. Since in SPI mode you'd have your CS# line low, you could use a single transistor to have P1.6 disconnect from your SCL net during SPI mode.

                  +3v3
                    |
                    |
                   +-+
                   |2|
                   |k|
                   |2|
                   +-+
                    |
                  +-+----------> to device SCL pin
                  |
                |/ C
MSP430 CS# pin--|     NPN-transistor
                |\ E
                  |
                  |
MSP430 P1.6 ------+------------< to device MISO pin

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...