Are you waiting for the startDone event before calling write()? the code as you have written it does not wait for the previous operation to complete before calling the next operation.
-Joe On Tue, 22 Feb 2005 12:16:01 +0000, Rafael Aranha <[EMAIL PROTECTED]> wrote: > Hi, > > I'm unable to put the I2C to work in mica2. > I've tried both the I2CM and the I2CPacketM. > > I'm trying to write to an ultrasound module (srf08) this code: > call I2C.sendStart(); //start flag > call I2C.write(0xE0); //I2C device add > call I2C.write(0x00); //I2C device add register > call I2C.write(0x51); // instruction > call I2C.sendEnd(); // end flag > > The sendStartdone event is triggered but not the writedone event or the > readdone. > > Is there a need to do something that I'm not looking at. > > I've also compiled and installed the I2CPacketTest and tried to debug it > with the Leds. But the same thing happens. The writedone event is not > triggered and the write call returns FAIL. > > I've also tried to use the module with a simpler device - the TC74 > temperature sensor. But the same thing happens - Nothing! > > I would be most thankful if you could help me since I've been around > this for a long time, > Rafael Aranha > _______________________________________________ > Tinyos-users mailing list > [email protected] > http://mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-users > _______________________________________________ Tinyos-users mailing list [email protected] http://mail.Millennium.Berkeley.EDU/mailman/listinfo/tinyos-users
