potw 0 Posted June 12, 2017 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. Quote Share this post Link to post Share on other sites
Rei Vilo 686 Posted June 12, 2017 Help yourself: perform a search on DS1307 on this very forum, read the datasheet. Hint: voltage. Quote Share this post Link to post Share on other sites
potw 0 Posted June 13, 2017 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. Quote Share this post Link to post Share on other sites
Rei Vilo 686 Posted June 13, 2017 Good to know. The TM4C129 LaunchPad has multiple I²C ports. Have you tried the other ones? To use a specific I²C port, you may need to specify e.g. for port 0 Wire.begin(); Wire.setModule(0); Quote Share this post Link to post Share on other sites
potw 0 Posted June 14, 2017 Thank Rei for your infomations. Unfortunately, it still doesn't work. With am2315 i received all 0-byte and with ds1307 i received random bytes. I'm using Adafruit_AM2315 and rtclib libs. Quote Share this post Link to post Share on other sites
Rei Vilo 686 Posted June 14, 2017 How you tried with another I²C device? Quote Share this post Link to post Share on other sites
potw 0 Posted June 15, 2017 Yep, I tried. I have 2 modules for each of them. All have same issue when works with tm4c. But they work well with arduino Uno/mega2560. Quote Share this post Link to post Share on other sites
Rei Vilo 686 Posted June 15, 2017 Pull-up resistors? Quote Share this post Link to post Share on other sites
LiviuM 43 Posted June 15, 2017 (edited) 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 June 15, 2017 by LiviuM added the Launchpad's pins used. Quote Share this post Link to post Share on other sites
LiviuM 43 Posted June 15, 2017 LE I'm almost "thrilled" by the amount of details people asking for help is giving. We all have crystal bowls at home. 1 Rei Vilo reacted to this Quote Share this post Link to post Share on other sites
potw 0 Posted June 15, 2017 Daer Rei, Yes, i have 4.7k pull-up resistors. Quote Share this post Link to post Share on other sites
Rei Vilo 686 Posted June 15, 2017 If you have a logic analyser, check the speed of the I²C port. The IC may not be compatible with 400 kHz. Quote Share this post Link to post Share on other sites
potw 0 Posted June 16, 2017 11 hours ago, Rei Vilo said: If you have a logic analyser, check the speed of the I²C port. The IC may not be compatible with 400 kHz. Dear Rei, I have checked it before. I set I2C port to 100kHz standard. Quote Share this post Link to post Share on other sites
gpufler 0 Posted August 28, 2017 Hi, I have the same issue with other devices, it work on Arduino but not on Tiva C, I solve it with 1k pull-up, 4.7k is too much Quote Share this post Link to post Share on other sites
CyberPunk 0 Posted October 17, 2017 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 Quote Share this post Link to post Share on other sites