[Tinyos-devel] Re: I2C and SPI sharing

Jonathan Hui jwhui at cs.berkeley.edu
Thu Oct 12 09:35:47 PDT 2006


Where are you making this change?

It looks like it's either a problem with configuring the SPI or the
arbiter, which signals events to configure the SPI.

Just to confirm, are you seeing that exact order of events with
setModeSpi() occurring between 2 and 3? If so, it's probably not the
arbiter itself.

The code to configure/unconfigure the SPI has also changed somewhat
recently. Though I don't see anything obious in the code. Vlado or
Philipp, do you have any ideas?

A few additional questions:
- Does SpiByte.write() always fail after using the I2C for the first
time? Or after some number of I2C request()/release() cycles?
- Does it still fail if you simply request()/release() the I2C
resource but don't actually send any I2C packets in between?
- Can you send minimal code that reproduces the problem?

-- 
Jonathan W. Hui
jwhui at cs.berkeley.edu
http://www.cs.berkeley.edu/~jwhui/

On 10/12/06, Max CORTIANA <max.cortiana at st.com> wrote:
> 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
> >>
> >>
> >>
> >
> >
>
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>


More information about the Tinyos-devel mailing list