Two arduinos exchanging data using SPI

I would like to send and recive data from one arduino to another, in both directions, using a low number of digital pins. I thought SPI protocol was a good idea (I may be wrong, if you have a better solution please let me know) Do you know of an example of bidirectional SPI comunication between arduinos ?

SPI is awesome, it's fast as heck. But what it is NOT, is robust. It has no buffer of any kind. You MUST be right there to get the incoming byte before the next is finished being received or it will be lost.

The way around this is to dedicate an interrupt to the line or use SPI to connect to a buffered go-between chip like the http://www.sparkfun.com/products/9981 on this breakout board. The UART then handles the buffering and flow control.

This is assuming you really need SPI speed.

Is slow good enough? Ask yourself... how much data are you transmitting? Would NewSoftSerial be fast enough? That's only 2 digital lines per Arduino. Hard to beat that for interface efficiency.

You are totally right.

Speed is not that important. My aim is to use arduino nano as a component, connecting several of them. The main goal is to reduce the complexity of the hardware to be assembled, as I have problems to finish the the things that on a protobard work fine.

For instance, I have a 12 keys keypad, but each of the keys needs a pin to be read. One nano can be used to program a controller, if then I can send the data to a master. Or directly control one logic state with each digital pin (for instance, to drive leds). Instead of using multiplexers or serial to parallel converters or other hardware I think that will be easier to use nanos. To do so I need to find an easy way to allow them to talk.

I don't know if I was very clear, I'm not a native English speaker and that probably makes my messages seem stupid or at least weird.

YES ! NewSoftSerial was fine. Now I have here a couple of nanos exchanging information in both directions, and each of them with the "normal" terminal so that I can see what's going on if needed, from processing or from the terminal monitor in the arduino environment. Thanks :)

Excellent!

So basically, you used a Nano to build a serial keypad you then access with a different Arduino. Excellent!

I found this short Processing sketch very useful, it is a small terminal program. You can have many of them running to debug the different arduinos. http://drewish.com/content/2009/06/simple_arduino_serial_communications