How to use T3.5 with RCT DS3231 using i2c_t3 library

Status
Not open for further replies.

kammateo

Member
Hi guys, I have a T3.5 and I want to use the second i2c (wire2 with the i2c_t3 library) to get the time from Adafruit DS3231. Using the example ds1307 from DS1307RTC library I get the time using the SCL0 and SDA0, but I will use this bus to connect a MPU9150 device.
Do you know how to use this second bus?
Thank you
 
if it doesnt support changing in the class, edit the CPP file and replace all instances of "Wire." with "Wire1." and "Wire.h" to "i2c_t3.h"
 
Here are example initialisation commands for three I2C buses on T3.5:
Code:
#include <i2c_t3.h>

void setup(){

Wire.begin (I2C_MASTER,0x00,I2C_PINS_18_19,I2C_PULLUP_EXT,400000); // device 1 on SDA0/SCL0 
Wire1.begin(I2C_MASTER,0x00,I2C_PINS_37_38,I2C_PULLUP_EXT,400000); // device 2 on SDA1/SCL1
Wire2.begin (I2C_MASTER,0x00,I2C_PINS_3_4,I2C_PULLUP_EXT,400000); // device 3 on SDA2/SCL2

But as tonton says, if the DS1307 library is not aware of Wire2 you'll have to edit it (in the Sketches/libraries folder) and just replace all "Wire." with "Wire2."

Connect your device into pins 3 & 4 with a 2.2K pull-up resistor on each leg (unless DS3231 has them built in).

For more info on i2c_t3 usage see the documentation for the i2c_t3 Library on GitHub
 
Last edited:
Status
Not open for further replies.
Back
Top