Hi,
One more idea, when you do the write operations on the SPIC1, and SPIC2, in your code, you do it bit by bit, and the datasheet suggests, that this would be done bytewise, in other words, something like SPIC1 |= SPIE | SPE ...
...anyway...
I have set up an SPI master once, to receive , (I'm not a sw-expert, so please don't laugh, but) master controls look like this:
/*Some Init code for the peripherals*/
SOPT = 2; //Disable WD
ICGC2 = 0x08; //10MHz Crystal -> 40MHz Core, 20MHz Bus
ICGC1 = 0xFE;
PTCDD = 0x08; //PTC3 -> INT_ENAn(Out), PTC2 -> DIR_SEL(In)
PTDDD = 0x08; //PTD3 -> PWM(Out)
PTEDD = 0x04; //PTE2 -> SSn(Out)
PTCD = 0x08; //Disable IRQ
PTDD = 0x08; //PWM is active low, so off
PTED = 0x04; //SSn is active low, so off
SPIC1 =0x54; //Enable,Master Mode,CPHA=1
SPIC2 =0x00;
SPIBR =0x40; //CLK = (BUSCLK / 5) / 2 = 1MHz
TPM1SC = 0x48; //TPM1 will produce timing INT (int on every 1mS)(1kHz)
TPM1MODH = 0x4E; //Set the Modulo to be 20000
TPM1MODL = 0x20; //wich is req'd for 1kHz
TPM1C0VH = 0; //just to start up the timer
TPM1C0VL = 0; //Same reason
TPM1C0SC = TPM1C1SC = 0x00;
TPM2SC = 0x08; //TPM2 will be free-running PWM generator
TPM2MODH = 0x3F; //Set the Modulo to be 16383
TPM2MODL = 0xFF; //wich is req'd for 14bit res
TPM2C0SC = 0x24; //Low True Pulses
TPM2C0VH = 0; //Off for now...
TPM2C0VL = 0;
EnableInterrupts; /* enable interrupts */
...and in the interrupt routine, i give dummy bytes to the spi, to start transfer, but I only need the received bytes, anyway I suppose the sent bytes are out also...
...
PTED = 0x00; //Set SSn low,
for (aB = 0; aB < 2; aB++){ //Do it twice...
SPID = 0xFF; // Put 0xFF to SPID
bB = 0;// Wait for transfer to end
while (!(bB)) bB = (SPIS & 0x80);
SPIDataW = SPIDataW << 8;
SPIDataW += SPID; // Get the data from the SPID
};//...Until this line
PTED |= 0x04; //Set SSn high
...
This is how I handled the master, without irq unfortunately, but show some things...
Another question:
Could you confirm with an oscilloscope, that during transmission, data, and clk lines are toggling, or they are idle?
this can guide us towards finding the problem.