Code


// initialize I/O
PORTB |= (1<<7); //sck = hi

DDRB |= (1<<4)|(1<<5)|(1<<7); //SS,MOSI,SCK = OUT

DDRB &= ~(1<<6); //MISO = IN

//SPI init:
// - master mode
// - positive clock phase
// - msb first
// - maximum SPI speed (fosc/2)
// - enable spi
SPCR = (0<<CPOL)|(1<<MSTR)|(0<<DORD)|(0<<SPR1)|(0<<SPR0)|(1<<SPE);
SPSR = (1<<SPI2X);

Verweise

http://avr.auctionant.de/avrETH1/software_download.html