Friday, March 30, 2007

I2C Blocking/Concurrency Problem

I've just started testing how well the i2c functions for the Connii works when we query data on the i2c bus very quickly and right now it seems to have problems with it.

If I'm querying the battery information from the servo controller consecutively (with a 1 ms delay between each queries), I find that it works for about 2-4 queries. Then I would get an exception ("There is no slave responsible for this I2C address"), originating from the native function of the teleos.I2cApi.Java.I2cApi (which basically means that its a C/C++ function wrapped with Java).

I'll try to use a thread and time it to find out what's the max delay time.

Update (3/31):

Weird thing is that this doesn't happen when I query ADC data from the Tiny, so it makes me think it might not be Connii's problem. But when we tested the servo controller and did continuous reads through a mcu, it was fine.

Update (4/1):

We've found the root of the problem as being that the I2C api does not allow the sending of consecutive bytes (start->address->data->data->data....) when passing a byte array versus passing a Vector of bytes.

No comments: