Pages: [1]   Go Down
Author Topic: I2C SCANNER Sketch for Arduino DUE  (Read 2085 times)
0 Members and 1 Guest are viewing this topic.
Italy
Offline Offline
Newbie
*
Karma: 0
Posts: 26
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi all,

I was wondering if somebody ever modified this sketch ( http://playground.arduino.cc/Main/I2cScanner ) in order to work fine with an Arduino DUE.

When i run the sketch on my Arduino UNO, it perfectly recognizes the three I2C devices I've connected to the bus, but when I load it to the DUE no devices are recognized anymore.
I've tried everything, different pull-ups, switched between the two different I2C/TWI ports, inserted delays between functions, but nothing to do.
(I've also disconnected the 1.5k (actually 1k) pull-up on the DUE and placed external 4.7k pull up on both sda0-sck0 and sda1-sck1 to have similar delays everywhere.)

I've already questioned this forum (http://forum.arduino.cc/index.php?topic=180552.0) for some issues with those I2C. Before it was totally a logic level incompatibility, but now I'm having a perfect 3.3 to 5V bidirectional translation (checked with the scope).

Thank you,
Georgi
Logged

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

Have you checked the pins you are using?  SDA and SCL maddeningly shift around between boards.  (Worst is the Leonardo, which uses pins 2,3 - so no hardware interrupts if you use I2C!).
Logged

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

Hi,thanks for answering.
My problem now is that I'm able to communicate with some devices of which I know the address (so I got the connection a right) but I would find usefull an i2c scanner like the one working just for AVRs.
Georgi
Logged

White River Junction, Vermont USA
Offline Offline
Full Member
***
Karma: 5
Posts: 106
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi Georgi,

The bits that the I2C Scanner example uses are broken in the library (last I knew).  It relates to the fact that "endTransmission()" is no longer working (or ever was) for the DUE.

I made a work-around for a project that I was developing that duplicates the functionality. 

Look in this thread:
http://forum.arduino.cc/index.php?topic=182727.0

Look for the "// **** S **** --Scan I2C bus for known chips..." section in the linked code.

This is not a library that you can just import.  You'll need to adapt the code for your use.

I2C support in the DUE remains largely-broken, and you should be prepared to write your own bits as necessary...

Best of luck,

Chris
Logged

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

Thank you Chris for your constant interests in my issues  smiley

I`ve got a new one going on now> http://forum.arduino.cc/index.php?topic=187215.msg1387029#msg1387029 (in the big quote you can find a brief review of the issue)
We would happily hear your opinion!
Thanks again,
Georgi
Logged

Pages: [1]   Go Up
Jump to: