MSPLife 2 Posted August 25, 2016 Share Posted August 25, 2016 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! Quote Link to post Share on other sites
Rei Vilo 692 Posted August 25, 2016 Share Posted August 25, 2016 If you're using a MSP430G2553 on Energia, I Quote Link to post Share on other sites
MSPLife 2 Posted August 25, 2016 Author Share Posted August 25, 2016 Yes, pin 14, 15 have both I2C and SPI, I want to communication two devices on those pins. Quote Link to post Share on other sites
roadrunner84 466 Posted September 1, 2016 Share Posted September 1, 2016 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 dubnet, Fmilburn and sq7bti 3 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.