Jump to content
43oh

TM4C129 Connected Launchpad I2C not working


Recommended Posts

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);
}
Link to post
Share on other sites

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.

Link to post
Share on other sites

 

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?

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.

×
×
  • Create New...