DeepakJ 0 Posted June 24, 2014 Share Posted June 24, 2014 Hai I'm a complete newbie to Energia and MSP430. I would like to get some help on a problem that I'm facing while interfacing MSP430 launchpad using I2C(it's not "a" problem, rather it is "THE" problem).As mentioned above I'm using a MSP430-g2553 launchpad ver1.5 and currently I'm working on a project that requires interfacing two MSP430s with a Raspberry Pi. The protocol that I've chose is I2C due to it's simple hardware requirement and it's support for many devices at the same time. But then till now interfacing two MSP430s has been a faliture. I tried interfacing two MSPs on two launchpads. I've used the programs given as the example under the Wire menu (both the master sender-slave reciever and the master reciever-slave sender) and also another one that I've used with arduinos. I've tried connecting the two MSPs on the launchpads directly without pullups, with pullups on SCL line, SDA line and also with pullups on both the lines but in vain. And yes I've connected the ground pins of both the launchpads together. Again yes, both the boards with the MSPs work fine with normal i/o programs, pwm programs and serial communication programs(with the computer).Also I tried to connect each MSP to a Raspberry Pi and to a bus pirate(both of them working perfectly with an arduino), with negetive results.Had I missed something that I should've done..? Or am I doing something that is absolute stupid...? There are a couple of jumpers on the launchpad like RX,TX,test etc etc. Should I do something with them(based on my readings what I've understood is that they are used in the case of serial communication and not I2C). If anyone has interfaced MSPs together, please if you can help, it would be great. Anything like hints, tips, suggestions, advice etc etc(negetive or positive), anything, would be highly appriciated. Thanks in advance Quote Link to post Share on other sites
w2sqr 0 Posted June 24, 2014 Share Posted June 24, 2014 Hi D, Welcome to the party! I've been trying to get I2C to work on the MSP430 devices for some time now with very limited success. The best I've come to getting I2C to actually work in a real device situation in the Examples/TMP006 project in Energia. This connects a Texas Instr. temperature measurement IC to the MSP and allows two way communications. The examples from TI are pretty much worthless for me since they assume 1. That your MSP will only transmit or receive, but never do both in the same program, and 2. That I2C communications is all that your MCU will ever be doing since their examples force your MCU to go into a brain dead low power mode and only wake up when an I2C operation happens. The Energia examples are way better than anything TI offers. Now if Energia would only offer a USB library so I could use the MSP430F5529 to transmit data. Will Quote Link to post Share on other sites
David Bender 28 Posted June 24, 2014 Share Posted June 24, 2014 Are you using internal pullups or external pullups (if so what values?) What is your I2C clock rate? 400KHz is the max speed; start at out something slower. And post code so somebody can help you. Quote Link to post Share on other sites
zlalanne 37 Posted June 28, 2014 Share Posted June 28, 2014 P1.6 is SCL for I2C communication but it is also used for the LED on the G2 launchpad. Try taking of the jumper for LED2 (disabling it) and running the code again. Quote Link to post Share on other sites
energia 485 Posted June 28, 2014 Share Posted June 28, 2014 @@DeepakJ, did you use the master sender and slave receiver unmodified? If you have modified them then it would help to post the 2 Sketches that you have used. I will runs some tests next week when I have access to the hardware. Quote Link to post Share on other sites
sketchy 0 Posted June 29, 2014 Share Posted June 29, 2014 Forgive if this is a naive question. I don't want to trample down a hw/sw path that does not work. Can someone please tell me if indeed it is possible with Launchpad MSP430g2553 w/ Energia (then XCodeEmbedded+ on top of that) to write a .ino sketch that does I2C in the same way it works on an Arduino Uno w/o Energia? i.e.: #include <Wire.h> void setup() { Wire.begin(); Wire.requestFrom(ADDRESS, 2); //assume ADDRESS is defined } if so, it seems there are difficulties in getting this interface to work. Is there a list of difficulties with suggestions on resolutions (say a FAQ) for this? thank you. Quote Link to post Share on other sites
Rei Vilo 695 Posted June 29, 2014 Share Posted June 29, 2014 The sketch seems correct. Just launch a search on this very forum for the pull-up resistors and other tips and tricks. Quote Link to post Share on other sites
amstan 18 Posted June 30, 2014 Share Posted June 30, 2014 When i dabbled into I2C it seemed that the hardware for it is really inflexible(it even contains bugs). So i just made/adapted my own bit banging library. I don't care that it's bit banging because it's probably fast enough. The bonus is that you can use it on any pins that you like. https://github.com/amstan/binaryclock/blob/master/firmware/i2c.h Quote Link to post Share on other sites
sketchy 0 Posted June 30, 2014 Share Posted June 30, 2014 Thanks. I will follow up with the suggestions. Very much appreciate your advice. 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.