Ok, not much help then...

It looks like you may want to use I2C_START,
and ACK is the default. The ADDR_8BITS_FLAG
was a bad idea that seems to have been corrected.
I expect that you would provide the actual
I2C bus address and the system will shift it
and add the read/write bit as needed.

But the best thing is to use the code as the
documentation...also google "I2C spec" and
get something to compare it to. I ended up
with a logic analyzer on the bus to get it
right, but that was mostly due to the
missing "wait-state" issue with my hardware.

Sorry, but I don't understand your multiple-
STARTS thing. AFAIK a START and STOP delineates
a packet and there is no higher level encapsulation.
But again, let the spec be your guide.

MS

Ronald Eliseo Reyes López wrote:
> Hi MS.
> 
> Thanks for answer...
> 
> The T2 impl is not like the T1 version, more explicitly... I want to use 
> the Msp430I2CC.nc configuration that provide  the I2CPacket.nc, this 
> interface use the header file I2C.h where there are defined this flags:
> 
> #ifndef _I2C_H
> #define _I2C_H
> 
> typedef struct { } TI2CExtdAddr;
> typedef struct { } TI2CBasicAddr;
> 
> typedef uint8_t i2c_flags_t;
> 
> enum {
>   I2C_START   = 0x01,
>   I2C_STOP    = 0x02,
>   I2C_ACK_END = 0x04,
> };
> 
> 
> #endif /* _I2C_H */
> 
> Now I have doubts about how to put address slave and how to use this 
> flags for write/read operations, and the slave address is 8 bits 
> (included the lsb w/r).
> Also I need impl "multiple repeated STARTs and multiple reads/writes 
> within the same START transaction".
> 
> I hope do you understand my problem, thaks...
>  
> 
> 2010/5/18 Michael Schippling <[email protected] <mailto:[email protected]>>
> 
>     If the T2 impl is like the T1 version there are four bits
>     you can send to I2C read/write, which are conveniently
>     not defined or described anywhere:
> 
>     /*
>     ** I2CPacket read/write command flags,
>     **  defined in I2CPacketM.nc but not in a header file...
>     */
>     #define STOP_FLAG       0x01 //send stop/end command at the
>                                 //  end of the packet
>     #define ACK_FLAG        0x02 //ack every byte except for the
>                                 // last received
>     #define ACK_END_FLAG    0x04 //acks after the last byte read
>     #define ADDR_8BITS_FLAG 0x80 //slave address is a full eight
>                                 // bits as sent. w/this bit user
>                                 // must set read flag explicitly
> 
>     Through exhaustive testing and spec reading I found that these
>     two needed to be set for my external device. I believe they
>     are both the default expected I2C behavior so why they are
>     non-default options is left as an exercise for the reader:
> 
>     // works...no END ACK...dunno?
>     #define I2CP_I2CFLAGS   (STOP_FLAG | ACK_FLAG)
> 
>     Also watch out for "wait-state" handshakes between bytes on
>     the I2C bus. The T1 code doesn't detect them and can over run.
>     If you read one byte correctly then part of another and
>     nothing more you may need to extend the timeout between
>     bytes in I2CM.nc
> 
>     MS
> 
> 
> 
> 
>     Ronald Eliseo Reyes López wrote:
> 
> 
>         ---------- Forwarded message ----------
>         From: *Philip Levis* <[email protected]
>         <mailto:[email protected]> <mailto:[email protected]
>         <mailto:[email protected]>>>
>         Date: 2010/5/17
>         Subject: Re: Help with I2CPacket.nc
>         To: Ronald Eliseo Reyes López <[email protected]
>         <mailto:[email protected]> <mailto:[email protected]
>         <mailto:[email protected]>>>
>         Cc: [email protected] <mailto:[email protected]>
>         <mailto:[email protected]
>         <mailto:[email protected]>>, [email protected]
>         <mailto:[email protected]> <mailto:[email protected]
>         <mailto:[email protected]>>
> 
> 
>         Please send questions to tinyos-help. Thanks!
> 
>         Phil
> 
>         On May 16, 2010, at 5:21 PM, Ronald Eliseo Reyes López wrote:
> 
>          > Hi.
>          >
>          > I'm a student and I need to control an pressure sensor,
>         exactly BMP085 from Bosch Sensortec, for my tesis degree.
>          > This sensor use I2C protocol to communicate with master,
>         which will be a Telosb mote.
>          >
>          > The problem is I don't understand how to use the i2c_flags
>         with the I2CPAcket's command read. The explanation is not enouhg
>         seem me, please anybody can help me?
>          >
>          > I have the new version of tinyos-2.x from cvs repository.
>          >
>          > thanks in advance, and i hope your answer.
>          >
>          > Ronald Reyes
> 
> 
> 
>         
> ------------------------------------------------------------------------
> 
>         _______________________________________________
>         Tinyos-help mailing list
>         [email protected]
>         <mailto:[email protected]>
>         
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
> 
> 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to