Jump to content
43oh

I2C on TM4c1294 doesn't work


Recommended Posts

Hello everyone,

I'm trying to use I2C0 on tm4c1294 to communicate with rtc ds1307/ am2315 but it doesn't work. I was tried read many threads about i2c issue on tiva c with no luck. Here are one of them:

Have anyone successful using I2C on tiva C (tm4c1294ncpdt)? Guide me, pls.

Link to post
Share on other sites
8 hours ago, Rei Vilo said:

Help yourself:

  • perform a search on DS1307 on this very forum,
  • read the datasheet.

Hint: voltage.

Dear Rei,

Thank you for your reply. I don't think it is voltage problem. i already had a logic converter(GTL2003) which convert 3.3V to 5V. I tested I2C bus which arduino uno/mega. It works well.

Link to post
Share on other sites

Just tried to read some data from a DS1307 using my TivaC and the (slightly changed - use the i2c1 module) master_reader example from the wire library.

The DS answers (ACK) to the addressing (0x68) and gives back some data. No idea if the data is correct, but the logic analyzer can decode it. 

Hardware connections:

DS     Launchpad
Vdd -> +5V 
Gnd -> Gnd
SDA -> SDA1 (PN_4, Launchpad pin 50), 10KOhm -> +3V3
SCL -> SCL1 (PN_5, Launchpad pin 49), 10KOhm -> +3V3

The working code:

#include <Wire.h>

void setup()
{
  Serial.begin(115200);  // start serial for output
  delay(200);
  Serial.println("Serial interface OK");
  Wire.setModule(1);
  Wire.begin();        // join i2c bus (address optional for master)
}

void loop()
{  
  Serial.println("ask some data");
  delay(500);
  Wire.requestFrom(0x68, 5,false);    // request 6 bytes from slave device #2

  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);
}

 

Edited by LiviuM
added the Launchpad's pins used.
Link to post
Share on other sites
  • 2 months later...
  • 1 month later...

Dear All,

I'm havig here I2C mulfuctioning as well, on EK-TM4C129 4XL Launchpad. The I2C bus is wired with 1 KoHM resistors. I tested it on Arduino Mega, Uno same string of devices, works. On Launchpad does not. When I start a I2C scanner it shows me that there are dozens of devices on Bus, but in real just 4 devices. I tried above mentioned troublshooting and nothing really changed.

any help highly appreciated

 

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...