[Tinyos-devel] More questions about using I2C on MicaZ / MTS300 (TinyOS 2)
Marina Kurmanova
marina.kurmanova at gmail.com
Tue Jul 21 08:06:05 PDT 2009
Thank you, very much. It was exactly that: the 7 bits of the slave address
of DS1621 are 1001000, or 0x48, but I treated them as 10010000, or 0x90,
using the 8th bit!!!
Bye!
2009/7/21 Simon Kellner <kellner at ira.uka.de>
> * Marina Kurmanova [2009-07-21 14:59 +0200]:
> > Thank, you, Simon, the patch really solves the problem with the mts300
> > board.
>
> Glad to hear it.
>
>
> > Still, I cannot make I2C work with my DS1621 sensor. I wonder, how did
> you
> > get the new TOS_MIC_POT_ADDR = 0x2D address for mts300, and why did you
> > replace the old 0x5A address. Maybe it can help me with my DS1621 sensor,
> > because I receive the EINVAL value on error parameter.
>
> Ok. I2C devices can have 7-bit addresses, but the I2C controller
> transmits a full 8-bit byte including an address at the beginning of an
> I2C transaction. The format on the wire is:
>
> 76543210
> AAAAAAAW
>
> That is, the bits of the address is transmitted first, and the last bit
> sets the mode of operation (read/write). What I meant by 'real address'
> in the commit message was the content of bits 1 to 7 in the example.
> But the addresses in the TinyOS header file were multiplied by 2 so
> that the software just had to set bit 0 and then transmit it to the
> i2c controller.
>
> The current TinyOS implementation, however, shifts the address in
> the header file and then sets bit0. So there is no need to store the
> shifted address.
>
> Bottom line: Try dividing the address that is currently used by 2 and
> see if it works. If not, you'll have to dig through the datasheet to
> find the right address of the device.
>
>
> > I would be glad to commit the patch to the TinyOS tree but I don't know
> how
> > to do it.
>
> This was addressed to TinyOS developers on the mailing list that has
> commit access.
>
>
> bye
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-devel/attachments/20090721/f2ffe0a3/attachment.htm
More information about the Tinyos-devel
mailing list