Adrian,
You did not understand the problem. Let me explain again step-by-step.
I'm using the KEA8 as an SPI slave, driven by an external master. Obviously the slave select (pin called PCS on the KEA8, but I call it SS here) is an input to the KEA8.
I reduced the problem to a few lines of code. This is the SLAVE code running on the KEA8.
n = 0;
while(1) {
// wait till the transmit buffer is empty
while (!(SPI0_S & SPI_S_SPTEF_MASK));
// load transmit buffer with new value to be transmitted to master
SPI0_D = n++;
}
This only works, if the frame length of the master is 1 byte. Or in other words. The master sets SS low, transmits one byte, sets SS high. Rinse and repeat.
This does not work if the master transmits more than 1 byte per frame. If the master sets SS low, transmits one byte, then transmits another byte and then sets SS high, the KEA8 does NOT send the expected data to the master. In fact only the first byte sent after the SS goes low is as expected.
I found the problem to be that the KEA8 does only load a new value into its shift register and only sets bit SPTEF=1 when SS goes high, not when a complete byte was shifted out. Obviously this problem also results in the SPI slave not working in cases where no SS pin at all is desired, but SS is permanently tied low.
I cannot believe that this was a conscious design decision of the chip designer, but have to assume that this is a bug, especially also because the RX side works as expected (meaning the KEA8 is capable of receiving multi bytes frames, it's just not capable of transmitting them).
I still hope I made a stupid mistake somewhere. Having to switch to a different MCU to solve this problem will be a lot less pleasant.