[Tinyos-help] Questions about using I2C on MicaZ / MTS300 (TinyOS 2)

Thomas Wagner tw796021 at inf.tu-dresden.de
Wed Jan 3 04:35:52 PST 2007


Ok, I tried what you suggested and I found out, that there seemed to be 
the Problem that this I2C.commandComplete() event was not signaled, so 
everything after setStart failed. After playing around a little, I 
changed the I2C.init function in HplAtm128I2CBusP.nc to:

if (TRUE) {//hasExternalPulldown) {
  //call I2CClk.makeOutput();
  //call I2CData.makeOutput();
  call I2CClk.set();
  call I2CData.set();
}

because I recognized, that hasExternalPulldown is set to false in 
Atm128I2CMasterPacketP.nc by default. And well, this causes the process 
to succeed and the measurnments really are different for other gain 
values :). But I have 2 more questions left:

1.) The I2Cwrite seems to succeed even if the I2C device is not 
connected (the Sensorboard is unplugged), is this possible?
2.) (Just to be sure) Is it enough to include some CFLAG like 
"-I$(TOSROOT)/apps/motes/I2CMod \" to advice the compiler to use my 
modified HplAtm128I2CBusP instead of the original one (so I don't have 
to overwrite this)?

Thank you very much,

Thomas


Philip Levis schrieb:
> Your usage of the I2CPacket interface looks right. Where are you 
> configuring the IO pins and activating the I2C device? The code there 
> has the operations commented out. If it's not on, then you might see 
> it hang. I've found I2C devices to be really finicky; often, the 
> fastest way to debug them us to go into Atm128I2CMasterPacketP.nc and 
> figure out which state the operation is failing in.
>
> I've attached a file for the I2C driver for an ADS7823 ADC device. 
> Hopefully it will help.
>
>
> Phil


More information about the Tinyos-help mailing list