I2C Wire1/2

Microcontroller used: Teensy 3.5

Components: I2C LCD 20x4 DS1307 I2C RTC Module

Situation: I will be using 2 I2C components and although my microcontroller have 3 pairs of SCL and SDA, I am not able to use the other 2 aside from the basic SCL0 and SDA0. I read online and it shows that I will need i2c_t3.h or something of that sort as well as some pullup resistors.

Problem: I tried running different type of scanners to scan the I2C devices but to no avail. The I2C scanners I used were:

I tried to change the libraries from Wire.h to the i2c_t3.h. Having read some of the other forums, I still have no idea what to do. Appreciate help in scanning the device to ensure connection as well as some basic "Hello World" code so that I know how to add in the necessary codes to address the I2C components.

Also, just a quick question. I know pullup resistors are important, what are the significants of having and not having them?

P.S. I also tried the Scanner in example of library Wire.h and the basic and advanced scanners from the i2c_t3.h library the website doesn't allow more than 9000 characters so I didn't post.

You might get better Teensy-related answers over at the PJRC forums. But I like Teensies and I'll try to answer your questions...

  1. Just use the basic Wire library for now.

  2. Only use the primary I2C pins. Don't attempt to use any other pins yet.

  3. Pullup resistors are ABSOLUTELY required. Pretty much any value between 1K and 10K will work. 4.7K is the most-common recommendation.

Look closely at the modules you have. They may already have the pullup resistors on the boards. Check the published schematics, if available.

  1. Don't forget to connect the grounds.

  2. Yo do know that both of those devices will work quite well on just one set of I2C pins connected to both of them?

Hey MorganS, thanks for the quick reply. I will attempt to do so. I guess I take another time to learn about it in case I need it in the future.

Also, in order to connect and code it individually, I remember that I would have to address it. Any idea how to address for lets say the LCD and the RTC?

Use the I2C scanner to check the addresses match the datasheet.

Use the libraries to actually talk to the devices.