Pages: [1]   Go Down
Author Topic: How to use second I2C?  (Read 3901 times)
0 Members and 1 Guest are viewing this topic.
USA, OH
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I tried using accelerometer on pins 20 & 21 but it seems like there is something wrong with the board (no, I did not use +5V anywhere).
Somewhere it is mentioned DUE has two I2C interfaces, and there are pins SCL1 and SDA1 next to AREF pin.
How I can switch to using them?
Logged

Germany
Offline Offline
Full Member
***
Karma: 10
Posts: 221
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Did you use Wire.send... and so for the I2C for the I2C on top behind Aref you need to use Wire1.send...

And by the way on SCL1 SDA1 you need Pullups about 1.5kOhm on both. SCL0 SDA0 did have them build in.
« Last Edit: November 18, 2012, 05:23:49 am by Markus_L811 » Logged

USA, OH
Offline Offline
Jr. Member
**
Karma: 0
Posts: 56
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks a bunch, this works!

« Last Edit: November 18, 2012, 11:39:57 am by Stan09 » Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So in summary, is this correct?

If using Pin 20 and 21:
Internal pullups are provided.
Use Wire.setup() to control these.

If using SCL1 and SDA1:
You must provide 1.5k pullup resistors
The pullup source is taken from the 3.3V pin near the RESET pin.
Use Wire1.setup() to control these.

If this is all true, then I am unable to get pins 20 and 21 working. They just stay at logic high all the time. Have I missed something? I'm just running the master code here http://arduino.cc/en/Tutorial/MasterWriter

Will this work with just one device? I am just using one device and a logic analyzer to monitor the pins.

Thanks,
Doug
« Last Edit: April 07, 2013, 06:01:07 pm by dougcl » Logged

Cookeville, TN
Offline Offline
Newbie
*
Karma: 3
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So in summary, is this correct?

If using Pin 20 and 21:
Internal pullups are provided.
Use Wire.setup() to control these.

If using SCL1 and SDA1:
You must provide 1.5k pullup resistors
The pullup source is taken from the 3.3V pin near the RESET pin.
Use Wire1.setup() to control these.

If this is all true, then I am unable to get pins 20 and 21 working. They just stay at logic high all the time. Have I missed something? I'm just running the master code here http://arduino.cc/en/Tutorial/MasterWriter

Will this work with just one device? I am just using one device and a logic analyzer to monitor the pins.

Thanks,
Doug

I went ahead and used the 1.5k pullup resistors on both pairs of inputs. This worked for me. Let us know if that fixes it for you.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 13
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi.
How to use Wire1.setup() or other? The compiler does not recognize "Wire1".
Then about the pull-up resistors, I have to add them phisically or can I enable them with software commands?
Thanks a lot
Francesco
PS: I would like tu use arduino due with SDA1 and SCL1 to make a shield working.
Logged

Pages: [1]   Go Up
Jump to: