Good stuff. Often the way to fix something that just refuses to work is do a rewrite.
I still don't see why the direct approach to SPDR didn't work, I have done almost exactly the same before with no problems. Here is the code from SPI.transfer
SPDR = _data;
while (!(SPSR & _BV(SPIF)))
;
return SPDR;
Apart from writing to SPDR because it is designed to send bytes as well it's really the same as your code. Go figure.
Now that I look at this I wonder if it works at high speed, just for an exercise can you crank the master back up to 2MHz and see what happens?
After I posted last night I wondered why you weren't using the SPI library and thought I'd suggest that in the morning. No need to now ![]()
Rob