I'm trying to use the I2C bus on the Epic/MSP430 and use the CC2420 radio.
The radio seems to conflict with the I2C transactions. I'm sampling a light
sensor and the sensor requires about 4 I2C commands. After I send the
second I2C.write() command, I2C.writeDone() never gets called. I'm
requesting the Msp430I2CC.Resource before issuing any I2C commands and I
don't release it until I am completely done interfacing with my I2C sensor.
I can't figure out why the radio is interrupting the process.

Here is roughly my I2C code:
configuration HalRohmBH17C {
...
}
implementation {
        components new Msp430I2CC();
        RohmBH17LogicP.I2CResource      -> Msp430I2CC.Resource;
}

generic module RohmBH17LogicP () {
...
}
implementation {
        command error_t RohmBH17.measureLight () {
                call I2CResource.request();
                return SUCCESS;
        }
        event void I2CResource.granted () { 
                post perform_action();
        }
        task void perform_action () {
                ...
                if (done) call I2CResource.release();
        }               
}

I found that if I edit /tinyos-2.x/tos/chips/cc2420/spi/CC2420SpiP.nc so
that the "async command error_t Resource.request[ uint8_t id ]()" command
simply returns EBUSY for all requests my I2C communication proceeds without
interruption. This obviously disables the radio, however.

I've tried calling RadioControl.stop() in my main program before sampling
the light sensor. This does not help. In fact, this problem occurs if I
even just include IPDispatchC in with the app and and never turn the radio
on or use it.

Any ideas on why the radio doesn't seem to be following the resource
arbitration?

Thanks,
Brad Campbell
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to