Hi,

TinyOS uses 50kHz I2C, but you can use 100kHz i2c on most devices and
400kHz on some. Unfortunatly, there's no nice way to change the bitrate,
you must change it in /tos/chips/atm128/HplAtm128I2CBusP.nc (TWBR register)

Andris


On Sun, Mar 24, 2013 at 2:36 AM, He Dajiang (I2R) <[email protected]>wrote:

> Hi,
>
> There are two points:
>
> 1, performance
>
> I had a very simple I2C reading application, in which my micaz jusst read
> one register value from a sensor through I2C connection. I found that the
> elapsed time between I2C read/write and read/writeDone is 3 millisecond.
> That means it takes at least 6 ms to read register values from I2C
> interface since first you need to issue write command to write register
> value to I2C bus, then issue read command. That 3 ms delay is too long,
> which slows down the whole application significantly. I wonder where the
> bottleneck is.
> In a real situation, I have a motion sensor, which consistes of two I2C
> devices. In order to read all the motion data (accel + gyro + magnet), I
> must do the following:
> (1) read accel + gyro/12 bytes from one I2C device: requiring I2C write +
> read. 6ms
> (2) enable I2C bypass: requiring I2C write one byte. 3ms
> (3) read magnet/6 bytes from another I2C device: requiring I2C write +
> read. 6ms
> (4) disable I2C bypass: requiring I2C write one byte. 3ms
>
> That adds up to a big delay, and the coding trouble, which I will point
> out.
>
> 2, trouble in coding
> Use the above case as an example, let us assume you don't use sub-module
> to perform the above 4 steps. In one application, the writeDone are
> triggered four times, readDone two: in which you must have state varirable
> to track which step it is now and which step to perform next. Moreover, if
> you want to cater the I2C read/write FAIL case, your code becomes more
> messy. This is a point I miss the procedure function call.
>
> Best Regards
>
> Institute for Infocomm Research disclaimer:  "This email is confidential
> and may be privileged. If you are not the intended recipient, please delete
> it and notify us immediately. Please do not copy or use it for any purpose,
> or disclose its contents to any other person. Thank you."
>
> _______________________________________________
> Tinyos-help mailing list
> [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