[Tinyos-help] SPI Bus arbitration on micaz
Varun Jain
varun at spiderbox.com.au
Mon Aug 4 17:59:09 PDT 2008
Thanks a lot for your reply. I am using Chipcon boards CC2420DBK from
Texas Instruments
(http://focus.ti.com/docs/toolsw/folders/print/cc2420dbk.htm)
My platform exports SPI on a 20-pin connector, so can I use it for
arbitration or I should still use software arbitration. I saw at
/tos/platforms/chips/cc2420/HplCC2420PinsC that for CC2420
communication, only the Slave Select Line is used from the HplAtm128SpiC
and not MISO pin. Whereas my SPI interface (a 7-segment LED screen in
this case) is only expecting a Clock and Data input from the Atm128. I
saw the schematics of Micaz and it appears that the Atm128 and CC2420
connection does not use the SCK and MOSI/MISO connections which are
provided on the 51-pin connector (PROG_MOSI, PROG_MISO, SPI_SCK). Does
that mean that these connections are free to use without selecting
between the radio chip and any other spi device, I mean it will not
interfere with the radio communication, am I right???? Am I on the
correct path?
You said in your reply a following sentence:
"You'll see that it connects HplCC2420SpiP's to Atm128SpiC; the latter
provides the power lock to the former"
Did you mean HplCC2420SpiC's instead of HplCC2420SpiP's???
This is what I have thought that I will do: I will need to have a
HplLEDScreenC.nc which connects to Atm128SpiC and rest will be taken
care of by the Atmegas's Hardware Abstraction layers. Secondly, in my
application, I will need to call SpiPacket/SpiByte interface wired to
HplLEDScreenC in the module. But then how will it work out that it needs
to send this to the SPI device and not CC2420, will I need to use a
different am id??
Regards,
Varun Jain
R&D Embedded Design Engineer
Spiderbox Pty. Ltd.
P: +617 3318 9509
F: +617 3318 9595
M: +61401 091 248
E: varun at spiderbox.com.au
W: http://www.spiderbox.com.au
-----Original Message-----
From: Philip Levis [mailto:pal at cs.stanford.edu]
Sent: Tuesday, August 05, 2008 2:04 AM
To: Varun Jain
Cc: tinyos-help at millennium.berkeley.edu
Subject: Re: SPI Bus arbitration on micaz
On Aug 3, 2008, at 11:05 PM, Varun Jain wrote:
> Hello Dr.Phil,
> I was looking through the archives and I found that you have
> discussed the topic about using multiple SPI devices. In the
> following link you said that you might post some code for using
> multiple SPI devices:
>
>
http://mail.millennium.berkeley.edu/pipermail/tinyos-help/2008-April/032
819.html
>
>
> Have you posted it somewhere?? I am trying to attach an LED screen
> to the SPI interface of the atmel atmega128 processor. My platform
> (Chipcons CC2420DBK) is very similar to Micaz and I have ported my
> platform in TinyOS correctly and all the test applications are
> working correctly. I am now building an application where I need to
> display certain data to all the nodes in the network and collect
> data to a BaseStation. So, for displaying I need to attach this
> external LED/LCD screen.
>
> DOES anyone else has used SPI in micaz to interface some external
> devices using arbitration. Will the following process work for this
> task:
> Toggle clock line
> Set the output line
> Send the data from master to slave
>
> Also I wanted to know that if we are using Dissemination to insert
> data into the network every few seconds, then will it be alright to
> use SPI to interface external devices as there might be a conflict
> in accessing the SPI bus.
The micaz does not export the SPI interface via the 51-pin connector:
it is dedicated to the CC2420. The SPI to the at45db is just bit-
banged GPIO. You therefore need to connect directly to the atm128 if
you want to use the SPI. Take a look at the schematic.
For software arbitration, look at platform/micaz/chips/cc2420/
HplCC2420SpiC.nc. You'll see that it connects HplCC2420SpiP's to
Atm128SpiC; the latter provides the power lock to the former. So
that's Atm128SpiC is the component you want to connect to.
Phil
More information about the Tinyos-help
mailing list