Go Down

Topic: I2C Issue on DUE (With logic analysis) (Read 664 times) previous topic - next topic

DarylDee

Jun 22, 2013, 08:08 pm Last Edit: Jun 22, 2013, 08:13 pm by DarylDee Reason: 1
Hi Guys,

ok, I'm tired, I spent all day trying to get rid of this strange issue.
Let's take a look...
1) This is the code:

Code: [Select]

#include <Wire.h>
int val = 0;

void setup()
{
 Wire.begin(); // join i2c bus

}

void loop()
{
 
 Wire.beginTransmission(0x00); // transmit to device #
 Wire.write(0xc1); //default init command 0xc1
 Wire.write(0xd1); //sub call address select 0xd1
 Wire.write(0x00); //registro initialization call 0x00
 Wire.write(0x01); //registro setup 0x01
 Wire.write(0x14); //primo gruppo led0 init 0x14
 Wire.write(0x55); //(01010101 -> 01 led full on 0x55
 Wire.endTransmission();     // stop transmitting
 
 val++;        // increment value
 if(val == 64) // if reached 64th position (max)
 {
   val = 0;    // start over from lowest value
 }
 delay(500);
}


2) this is are results from the logic analyzer:




The link of the pictures, in case will not work due to access of flickr:
http://farm6.staticflickr.com/5508/9110418244_532144983e_b.jpg
http://farm4.staticflickr.com/3680/9108260063_7071e9a93f_b.jpg

3) Additional info:
Operating systems used to test the sw ubuntu 64bit & win7 64bit.
Latest version of beta 1.5.2 for DUE.


It seems that instead to sending the content of the Wire.write funcion it sends again and again the Wire.beginTransmission value.
If I change the beginTransmission value I simply get the new value repeated again and again for the total number of the Wire.write typed in the code.


I don't have enough knowledge to modify the library or... am I doing something wrong?
Thanks a million for your help!
Dario.

Paul Stoffregen

Maybe using a non-zero address would help?


 Wire.beginTransmission(0x00); // transmit to device #

DarylDee

Totally Paul : )
I was confused, with other arduinos you get only the first message repeated then the wire.write condition hangs if no ack is sent from slave device, but not with sam3x.

Thanks!

Go Up