Content originally posted in LPCWare by MindBender on Tue May 03 05:56:46 MST 2016
I had found that work-around before, but dismissed it as too sloppy. However, after you hint I have tried it anyway, and it seems to work. So thanks for the reminder.
I do agree that this should go into the errata sheet, but perhaps it's even better to revise the SSP peripheral entirely, because it is seriously borked: In two of the four possible SPI modes no more than one byte can be transferred per !SSEL active period. These two modes are CPOL=0 CPHA=0 (Mode 0) and CPOL=1 CPHA=0 (Mode 2). Since many SPI uses the first of these two modes, and often multiple bytes must be transferred, !SSEL must be raised in between bytes. We use the SSP peripheral as a slave device and the master doesn't deactivate !SSEL in between bytes. This is all written in the manual, but still it's a really inconvenient short coming, because in many protocols !SSEL is also used for framing.
We work around this short coming by using an interrupt-capable gpio pin as our !SSEL on the bus, and another gpio pin to manipulate the SSP !SSEL after each byte.