xujianningkp1426459997 0 Posted June 20, 2014 Share Posted June 20, 2014 Hi all, I'm trying to make a communication between TM4C129 Connected Launchpad and TM4C123 Launchpad (or Arduino UNO) via I2C ports. 1.5K pull-up resisters are added to both SCL and SDA. Connected both grounds. I have the salver_sender example code loaded to the Connect Launchpad and the master_reader example code to Arduino UNO. The Arduino UNO got some weird characters yyyyyy from the Connect Launchpad and the loop stuck on Wire.requestForm() every time. Arduino gets these yyyyyy only if I pushed the reset button on the Connected Launchpad or disconnect the SCL and SDA to make the loop run continuously (but no data is sending). I changed the setModule(); to different I2C ports but they all did the same. I tried the TM4C123 Launchpad (instead of the Connected Launchpad) with and Arduino with the same setup and codes, they works perfectly without any issue. Please help me out if you have any idea or info. I appreciate your time Result from TM4C129 Connected Launchpad and Arduino: send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request....... (loop stops here every time) Result from TM4C123 Launchpad and Arduino: send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello (loop runs continuously) Salver_Sender example code: #include <Wire.h> void setup() { Wire.begin(1); // join i2c bus with address #1 Wire.setModule(1); Wire.onRequest(requestEvent); // register event } void loop() { delay(100); } // function that executes whenever data is requested by master // this function is registered as an event, see setup() void requestEvent() { Wire.write("hello "); // respond with message of 6 bytes // as expected by master } Master_Reader example code: #include <Wire.h> void setup() { Wire.begin(); // join i2c bus (address optional for master) Serial.begin(9600); // start serial for output } void loop() { Serial.print("send request......."); Wire.requestFrom(1, 6); // request 6 bytes from slave device #1 Serial.println("request sent!"); while(Wire.available()) // slave may send less than requested { char c = Wire.read(); // receive a byte as character Serial.print(c); // print the character } Serial.println(); delay(500); } Quote Link to post Share on other sites
Rei Vilo 695 Posted June 20, 2014 Share Posted June 20, 2014 Please refer to my answer at the 43oh forum. Those cross forums are really annoying... Quote Link to post Share on other sites
bluehash 1,581 Posted June 22, 2014 Share Posted June 22, 2014 Please refer to my answer at the 43oh forum. Those cross forums are really annoying... Thanks for helping out @@Rei Vilo Unfortunately for this question, he posted it at 43oh instead of here first. so the posting is a mess. I missed out on pointing him to this forum. If you see any Tiva/Stellaris posts on the 43oh forum, please report it. Also, tell them to post it here if you can. Thanks again. Quote Link to post Share on other sites
L.R.A 78 Posted June 22, 2014 Share Posted June 22, 2014 *i'm dumb,forgot to quote before, please erase this* Quote Link to post Share on other sites
L.R.A 78 Posted June 22, 2014 Share Posted June 22, 2014 Hi all, I'm trying to make a communication between TM4C129 Connected Launchpad and TM4C123 Launchpad (or Arduino UNO) via I2C ports. 1.5K pull-up resisters are added to both SCL and SDA. Connected both grounds. I have the salver_sender example code loaded to the Connect Launchpad and the master_reader example code to Arduino UNO. The Arduino UNO got some weird characters yyyyyy from the Connect Launchpad and the loop stuck on Wire.requestForm() every time. Arduino gets these yyyyyy only if I pushed the reset button on the Connected Launchpad or disconnect the SCL and SDA to make the loop run continuously (but no data is sending). I changed the setModule(); to different I2C ports but they all did the same. I tried the TM4C123 Launchpad (instead of the Connected Launchpad) with and Arduino with the same setup and codes, they works perfectly without any issue. Please help me out if you have any idea or info. I appreciate your time Result from TM4C129 Connected Launchpad and Arduino: send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request.......request sent! ÿÿÿÿÿÿ send request....... (loop stops here every time) Result from TM4C123 Launchpad and Arduino: send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello send request.......request sent! hello (loop runs continuously) Salver_Sender example code: #include <Wire.h> void setup() { Wire.begin(1); // join i2c bus with address #1 Wire.setModule(1); Wire.onRequest(requestEvent); // register event } void loop() { delay(100); } // function that executes whenever data is requested by master // this function is registered as an event, see setup() void requestEvent() { Wire.write("hello "); // respond with message of 6 bytes // as expected by master } Master_Reader example code: #include <Wire.h> void setup() { Wire.begin(); // join i2c bus (address optional for master) Serial.begin(9600); // start serial for output } void loop() { Serial.print("send request......."); Wire.requestFrom(1, 6); // request 6 bytes from slave device #1 Serial.println("request sent!"); while(Wire.available()) // slave may send less than requested { char c = Wire.read(); // receive a byte as character Serial.print(c); // print the character } Serial.println(); delay(500); } First off all can you tell me wich pins you used in the tm4c1294? Quote Link to post Share on other sites
Rei Vilo 695 Posted June 22, 2014 Share Posted June 22, 2014 Link to the discussion at 43oh: http://forum.43oh.com/topic/5579-tm4c129-connected-launchpad-i2c-not-working/ 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.