Dear all,
Using LPCXPresso55S28 board I try to send 16 bit data via SPI. I'm using FLEXCOMM2 and I connected my locical analyzer to the board using the pins:
- P18 [15] -> MOSI
- P18 [18] -> SSEL0
- P18[8] -> SCK
Using MCUXpressoIDE peripherals configurator I configured FLEXCOMM2 as shown in the picture

I wrote a very simple program to test SPI functionality.
The program iterates 20 times using a loop. Inside the loop, a variable 'dato' is incremented by one in each iteration. This variable likely holds the data I want to send over SPI and the function called SPI_WreiteData is called to send information via SPI. Then a funcion called SPI_ReadData is called to read 'fummy' data from SPI.
SPI_WriteData(FLEXCOMM2_PERIPHERAL, dato, kSPI_FrameDelay | kSPI_FrameAssert);
xxy = SPI_ReadData(FLEXCOMM2_PERIPHERAL);
(xxy is a volatile uint32_t variable)
Unfortunately after the last frame is transmitted the CS signal remains low. The number of pulse clock of the last frame is wromg (15 pulses instead of 16 pulses)
In the following picture the captured signal of the two last frames are shown. You can observe only 15 clock pulses for the last frame instead of the expected 16.
