Hallo,

also ich hab das so programmiert:

*********Master Seite***********
void send_koordinates(uint8_t bein,int16_t x, int16_t y, int16_t z)
{
if (bein == 1)
{
send_word_B1(x);
send_word_B1(y);
send_word_B1(z);
}
if (bein == 2)
.
.
.

void send_word_B1(int16_t word)
{
uint8_t high_byte;
uint8_t low_byte;

high_byte = word >> 8; //High anteil herrausnehmen
low_byte = word & 0xff; //Low anteil herrausnehmen
PORTB &= ~(1 << DDB3); //low (Chip des Beines 1 auswählen)
SPI_MasterTransmit(high_byte);
PORTB |= (1 << DDB3); // high
PORTB &= ~(1 << DDB3); //low
SPI_MasterTransmit(low_byte);
PORTB |= (1 << DDB3); // high
}

void SPI_MasterTransmit(char cData)
{
SPDR = cData;/* Start transmission */
while (!(SPSR & (1<<SPIF)));/* Wait for transmission complete */
}

********Slave Seite**********

volatile unsigned char dataarray[6];// global
volatile int i = 0; // global


ISR(SPI_STC_vect) //interrupt auf SPI
{
unsigned char data;
data=SPDR;
dataarray[i]=data;
i++;
}

Es muss mit den timings sicher gestellt werden, dass i nicht mal falsch mitzählt sonst werden die Koordinaten falsch zugewiesen.
Kann man sicher noch verbessern.

Daten wieder zu einem 16 bit Wert zusammensetzen: word = (high_byte << 8 )|low_byte;

Hoffe das hilft dir weiter

Gruß
LetsBuildBots