Pages: [1]   Go Down
Author Topic: I2C on which device???  (Read 528 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hy everyone!

I am not shure if every arduino (mini to mega) is able to use I2C so I am asking you ....

Is it possible to use every arduino to make I2C working on it?
Is it only necessary to "define" the right port?
I read a lot about using analog port 4 and 5... are these exclusive?
Is it possible to use i2c on every other analog port?

hope to get some answers from you..

have a nice weekend... smiley
Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26274
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Unlike low-speed serial, it isn't really feasible to run I2C via software, so you're stuck with using the hardware which can only use the analogue pins 4 & 5.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34122
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
it isn't really feasible to run I2C via software

It is have have done it many times on Acorn machines and PIC processors without hardware support. A master I2C is a lot easer than a slave because the master is always in charge of generating the clock signals. It is a bit messy but can be done.
Also because it is a synchronous serial signal the actual clock frequency is not too important because you generate the clock as well.

I2C is supported on the mega but the pins are fixed as the software uses the hardware support. On the mega the I2C lines are not the same as the other boards this is Pin 21 for the clock and Pin 20 for the data. But on all other processors it is Analogue 4 & 5.

Quote
Is it possible to use i2c on every other analog port?
Only if you are prepared to write a software I2C driver, there is not much point in  doing this apart from the learning exercise as you can do lots of thing with external multiplexing if you need more devices or to counter address conflicts.
« Last Edit: November 27, 2009, 05:52:25 am by Grumpy_Mike » Logged

Global Moderator
UK
Offline Offline
Brattain Member
*****
Karma: 302
Posts: 26274
I don't think you connected the grounds, Dave.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
It is have have done it many times on Acorn machines and PIC processors without hardware support

You're quite correct, of course (though a 400kHz bus would be pushing it a tad), but if the OP had to ask the question, then no, it isn't feasible.
Logged

"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34122
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes it was 100KHz that I implemented.

Quote
but if the OP had to ask the question, then no, it isn't feasible

I quite agree with that, but it is so true of many posts we get here.

However there are people who lurk about the forum looking for projects to do, so maybe someone things this might be worth while. Personally I don't think it is worth it.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank's a lot for you answers!

I do not want to make my own Software for using i2C on an other port. There was only a small thinking about it smiley-wink if it is possible.

Am I right to say that on every board the i2C lines are analog 4 / 5 , only on mega 20/21. So I can use every board to make i2C connections...

thanks ...
« Last Edit: November 27, 2009, 06:14:03 am by mabe79 » Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 626
Posts: 34122
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
So I can use every board to mac i2C connections.

Yes if mac is actually make and not the name of a computer.
Logged

Pages: [1]   Go Up
Jump to: