[Tinyos-devel] Re: I2C and SPI sharing

Max CORTIANA max.cortiana at st.com
Thu Oct 12 09:20:15 PDT 2006


Yes, it is called.

I've made some tests.
If instead of calling Resource.Request() i do

...
//call Resource.Request()
post loop();

task void loop(){
if (call Resource.ImmediateRequest() != SUCCESS)
	post loop();
}

it works fine. Obviously it's a computation waste.

- Max



> Sounds like the USART is not being configured properly, especially
> since SpiByte.write() is not returning. Do you know if
> HplMsp430Usart.setModeSpi() is getting called between steps 2 and 3?


Max Cortiana wrote:
> Woops..
>
> I'm using TinyOs 2.x
>
> - Max
>
>
> Max Cortiana wrote:
>> Hi
>>
>> I'm working on TeosB and I have a problem when sharing I2C and SPI, 
>> used by the cc2420 Radio.
>> The channel is shared correctly until SPI tries to access the channel 
>> while the channel is busy with I2C.
>> I see the following steps are:
>>
>>   1. Resorce is requested by SPI.
>>   2. I2C finishes its operations and releases the shared resource
>>      (MSP430UsartShare0) ;
>>   3. SPI receives the granted event.
>>   4. Radio tries to send a byte through SPI
>>   5. The byte isn't sent.
>>   6. SPI  loops inside a while, waiting for an interrupt which will
>>      never arrive.   7. Since a task i locked in an infinite loop, 
>> the mote is like dead.
>>
>>
>> Any suggestion?
>>
>> Thanks
>> - Max
>>
>>
>>
>
>



More information about the Tinyos-devel mailing list