Arduino as SPI slave?

Hi!

This topic became very interesting. Thankyou for your replies! Thankyou Nick for letting me borrow your code. There are not many examples on AVR running as slave to be found. Sorry for not giving you credits.

I've tried the coding examples forwarded by CrossRoads. The result is still the same. Lots of $FF chars and less than 1% real data.

After some more research my theory is that the clock pulse in not high long enough to be sampled. The specification says more than two clock pulses, which is more than 125 nS @ 16 MHz. Looking at the oscilloscope output the clock pulse is high (>3V) in around 100 nS. Therefore the clock pulse i probably lost which causes the loss of data. So it looks like as if this is not possible to solve using a 16 MHz Arduino.

Here is the clock line:

Will the onboard LED on the Arduino board cause any problems? The LED is glowing when the master is driving the SCLK line.

Another question regarding the SS pin on the AVR when running as slave: The only pin that can be used is pin 10 and it is not configurable?

Since about 150 bytes of data is written every 5 seconds maybe adding some buffering logics could solve the task. Any ideas on how to do that?

Regards,
Torgil