I was wondering if somebody ever modified this sketch ( Arduino Playground - 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 (Arduino DUE with I2C DAC,ADC and RTC - Arduino Due - Arduino Forum) 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).
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!).
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
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.