[Tinyos-help] Connecting PCF8563 RTC to Iris
Andres Vahter
andres.vahter at gmail.com
Thu Jul 30 05:31:12 PDT 2009
On 29.07.2009, at 18:31, Janos Sallai wrote:
> Andres,
>
> I2CPacket.read and I2CPacket.write are split phase operations. You
> have to wait for the corresponding readDone or writeDone events before
> issuing the next read or write, otherwise the subsequent operations
> may fail.
>
> Janos
Hi,
I have read that I2CPacket.write(adr, len, data) returns always success.
There is patch for that: http://mail.millennium.berkeley.edu/pipermail/tinyos-devel/2009-July/003977.html
I tried it with copy-paste method (don't know how to apply it
correctly).
And I'm still getting SUCCESS when I'm tryng to write to non existing
I2C device - I should get EINVAL with that patch - am I right?.
---------------------------------------------------------
buffer[0] = 0x00;
buffer[1] = 0x00;
buffer[2] = 0xF;
buffer[3] = 0x00;
if (call I2CPacket.write(I2C_START, 0x41, 1, buffer) == SUCCESS) {
call Leds.led2On();
}
---------------------------------------------------------
It returns always success. I don't have device with address 0x41
connected.
What about external pulldown, why is it changed
from
if (hasExternalPulldown)
to
if (!hasExternalPulldown)
How is addressing managed? If I have a device with 8 bit address 0xA2
should I use that address in I2CPacket.write or should I use 7 bit
address 0xA2 >> 1?
And last question: if I have device with I2C address 0xA2 and I want
to change register 0x02 value in that device to 0x0F - how should I do
that, is following code right?
buffer[0] = 0x02; // reg addr
buffer[1] = 0x0F; // value
if (call I2CPacket.write(I2C_START, 0xA2, 2, buffer) == SUCCESS) {
}
Andres Vahter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090730/2d08e218/attachment.htm
More information about the Tinyos-help
mailing list