SPI throughput problem MK22

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

SPI throughput problem MK22

662 Views
miguelasselberg
Contributor I

Dear all,

I have got a custom PCB design with the MK22FN512CAP12. I have got a SPI device connected to the SPI1 peripheral. The MK22 acts as the master. The baudrate is at 20 MHz. I used the dspi_edma_b2b_transfer_master example project, but I changed from SPI0 to SPI1. I am using SDK version 2.5.0.

I noticed that the data took longer to send than I anticipated, so I went on an investigation. I am sending 500 bytes of 0xAA to test.

I measured the SOUT pin of SPI1 when I sent data and saw that the MK22 sends out one byte of data and then a pause of about  a bytes length and then the next byte of data. See the attached picture: SPI1-SOUT.
I changed from the SPI1 peripheral back to the SPI0 perhipheral and did another measurement on SPI0-SOUT and noticed that the deadtime between bytes is much shorter. This is what I would expect from SPI. See attached picture: SPI0-SOUT.

When I increased the core clock speed from 80 MHz to 120 MHz I noticed that the deadtime between bytes is a little bit less.

I did the same experiment on the FRDM-K22FN dev kit and noticed the same result.

Does anyone know why this happens?

Tags (3)
0 Kudos
1 Reply

570 Views
jingpan
NXP TechSupport
NXP TechSupport

Hi Miguel,

I think this is because SPI0 TX FIFO size is 4 and SPI1 TX FIFO size is 1. Thus DMA can feed more data to SPI0 each time. If you set speed to 500k, there is almost no difference. But when set to 20M, it will be obvious.

Regards,

Jing

0 Kudos