Go Down

Topic: I2C on DUE - only address is output on serial, no data! (Read 318 times) previous topic - next topic

Fuffa

Hi Guys,
after hours of struggling, i decided to ask the community...
my goal is very simple: i want to use the I2C (pin 20 & 21) on my DUE to output 8 bits.

I uploaded the SerialWrite  sketch and i connected my DSO Nano scope to the SDA and SCL.
What i can see (sorry, the NanoDSO cant take snapshots....:P ) is that the Due is sending out only the address part of my digital pattern.
i put 3 lines of code here:

  Wire.beginTransmission(4); // transmit to device #4
  Wire.write(0xF);              //  THIS LINE SEEMS USELESS BUT IT'S WHAT I NEED WORKING
  Wire.endTransmission();    // stop transmitting

I'd expect to see a sequence of "ones" (0XF = 1111) after the address but the only thing that change the waveform is when i change the address, nO matter what value i put into the Wire.write.
The clock is set at 400KHz (i need the fastest).
Does anybody have any hint?
Thank you in advance!
A.

MorganS

It requires the slave device to ACK (acknowledge) or it won't send the data.
"The problem is in the code you didn't post."

Fuffa

Thank you Morgan! So simple!
pity I can't simulate the transmission with the Due and the scope and I need the whole system...
I hoped to be able to program all in the comfort of the office but i'll have to go to the lab... :smiley-lol:

Go Up