Hello guys. I'm trying to make an spi connection between the arduino and an IC. Actually it's not an arduino, it's an atmega328 on a breadboard, but i'm programming it with the arduino IDE through ICSP. I've got a problem, this sketch doesn't work:
void setup(){
byte clr; SPCR=B01010011;
clr=SPSR;
clr=SPDR;
digitalWrite(10, LOW); //10 is basically the SLAVE SELECT pin
spi_transfer(B00000100); //powerup delay(10);
digitalWrite(10, HIGH);
digitalWrite(10, LOW);
spi_transfer(B00000000); //setrec