- SPI - can a slave initiate a transfer?
- Posted by Ron Blancarte on September 11th, 2006
I am programming for a device where there are two Analog Devices
ADuC831 chips. One operates the communication for the device and the
other does data acquisition. The Comm chip is the slave to the
acquisit ion chip. This interface is something like this:
COMM (S) MAIN (M)
SClock <- SClock
MOSI <-> MOSI
MISO <-> MISO
~SS <- P3.4 (as a digital output)
--- ~SS (not connected in a useful way to the Comm chip)
(BTW - this is fixed, I am only programming it, I can't change this)
So my question is this - can Comm, acting ONLY as a slave, initiate a
transfer to Main?
The only other solution I have is that Main polls Comm to ask if it
needs to do a transfer.
Thanks.
RonB
--------------------------------------------------
"It is human nature to take shortcuts in thinking"
--------------------------------------------------
- Posted by Tim Wescott on September 11th, 2006
Ron Blancarte wrote:
If you could arrange for another wire between the comm and main to flag
the main chip when the comm had data waiting then yes.
If you can't then you're constrained to poll.
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Posting from Google? See http://cfaj.freeshell.org/google/
"Applied Control Theory for Embedded Systems" came out in April.
See details at http://www.wescottdesign.com/actfes/actfes.html
- Posted by Ron Blancarte on September 11th, 2006
On Mon, 11 Sep 2006 15:25:17 -0700 (while OU was sucking), Tim Wescott
wrote:
Thanks for the input.
Actually, I should RTFM, because it turns out that my boss who
designed this thing already planned out for this issue. He hooked up
one of the pin outs to the external interrupt of the main chip. When
I trigger that, THAT tells the system to start doing transfers from
the comm chip.
So in my description I left something out.
-R
--------------------------------------------------
"It is human nature to take shortcuts in thinking"
--------------------------------------------------
- Posted by Jim Granville on September 11th, 2006
Ron Blancarte wrote:
No. ( not unless you get clever with the SS line, and OR wire it, and
pulse it briefly LOW from the slave, to say 'hey' and then the
INT to master starts a slave transaction )
Yes. Normally you just include a null-packet as a slave present check,
with no data.
-jg