The above is the waveform of data pin and chip selection pin.(The yellow waveform is the data pin waveform. The blue waveform is the chip selection pin waveform. And chip selection pin is low level effective)
Currently, my colleague and I need to write a spi receiving program.
We are using the SPIS sample in examples\peripheral\spis of SDK15.3.
The data received by SPI in our program is only 16 bytes, but the data transferred is actually 17 bytes. We lost the second byte data.
As show in the Oscilloscope, the second bytes had sent after a long time after the first bytes(maybe 4.34 ms), and we read the rx_amount of nrf_drv_spis_event_t event in callback spis_event_handler, the value always is 1.
In this period, there are two bytes clk cycles(that mean clk has the 16 high low in turn) & two bytes appear there, and at the same time, the cs is low, so according the spi protocol, we should received two bytes, am we right?
After this period, the cs cycle changed to 500us, and in one cycle, there is a clk cycle(8 high low in turn), the interval is very short(maybe 30us), these data received perfect.
Please give us some suggestion on how to get the second bytes? how to modify the program?