I am using the SPI to talk to a 4-channel ADC. I have configured it to be a Master Receive with DMA of 4 16-bit values. Everything appears to be working correctly, except I seem to be getting 5 * 16 clock pulses.
*pSPIBAUDB = 0x08; // 12.5MHz
// 16 bits, no CS Flag, Master mode
*pSPICTLB = TIMOD2 | WL16 | MSBF | CLKPL | SPIMS | SMLS | SPIEN;
*pIISPIB = (UINT)(&readBuffer); // recast the
*pIMSPIB = 1; // single int increment
*pCSPIB = 4; // read 4 values
// set DMA to receive and interrupt
*pSPIDMACB = SPIDEN | SPIRCV | INTEN;
As an experiment, I set CSPIB = 3, and observed 4 * 16 clock pulses, but only 3 values stored in the readBuffer.