Well, I think I have a bit-banging SPI implementation now, but it still doesn't work - exactly the same results, just slower.
This is my bitbanging code - if you someone could just make sure that it is doing what I hope it is - it should be the equivalent to SPI mode CHPA=0 and CPOL=0:
#define SPI_DELAY 10
uint8_t spi_send(uint8_t b) {
uint8_t reply;
uint8_t outgoing;
uint8_t bits;
pinMode(MOSI,OUTPUT);
pinMode(MISO,INPUT);
pinMode(SCK,OUTPUT);
digitalWrite(SCK,LOW);
reply = 0;
outgoing = b;
for(bits=0; bits<8; bits++)
{
digitalWrite(MOSI,outgoing&0b10000000?HIGH:LOW);
outgoing = outgoing << 1;
delay(SPI_DELAY);
digitalWrite(SCK,HIGH);
reply = reply << 1;
reply |= digitalRead(MISO)==HIGH ? 1 : 0;
delay(SPI_DELAY);
digitalWrite(SCK,LOW);
}
return reply;
}