manitou
Senior Member+
OK, I fetched latest SPI lib with Kurt's update (but imrxt.h does not have his additions yet, so some hacking required) but here is summary of SPI performance with FIFO (1000-byte transfer MISO jumpered to MOSI)SPI.cpp work to do:
I ran SPI test with SerialFlash on T3.4 and T4. Despite T4 clock running at 37 mhz and T3.2 only at 30 mhz, the T3.2 did faster page reads than T4 (83 us vs 129us). T3 SPI lib is optimized to use FIFO so there are 16-bit transfers with small interframe gap (76ns). The T4 SPI still needs to be optimized, since it does simple byte transfers with 260 ns interframe gap. So T4 SPI needs to use its FIFO and/or 16 or 32-bit frame size. Also SPI.cpp needs T4 support of async/DMA transfer.
EDIT: Kurt had pending pull-request (now merged) to use FIFO. I need to re-run SerialFlash test ...
Code:
SPICLOCK 4 MHz CCR freq 4.0 MHz
2060 us 3.88 mbs
SPICLOCK 8 MHz CCR freq 7.5 MHz
1100 us 7.27 mbs
SPICLOCK 13 MHz CCR freq 12.6 MHz
680 us 11.76 mbs
SPICLOCK 16 MHz CCR freq 15.1 MHz
570 us 14.04 mbs
SPICLOCK 20 MHz CCR freq 18.9 MHz
470 us 17.02 mbs
SPICLOCK 30 MHz CCR freq 25.1 MHz
350 us 22.86 mbs
SPICLOCK 40 MHz CCR freq 37.7 MHz
270 us 29.63 mbs
Here is SPI CLK @37.7mhz on scope (you have to zoom scope in on sawtooth to see it report 37 mhz). You can see the reduced Vpp and the interframe gap variation.
SPI DMA data rates from post #717
Code:
SPI CLOCK 4000000 CCR freq 4.0 MHz
tx 1024 samples 1990 us 4.1 mbs scope clock 3.97 mhz
SPI CLOCK 8000000 CCR freq 7.5 MHz
tx 1024 samples 1080 us 7.6 mbs scope 7.57 mhz
SPI CLOCK 16000000 CCR freq 15.1 MHz
tx 1024 samples 570 us 14.4 mbs scope 14.9mhz
SPI CLOCK 30000000 CCR freq 25.1 MHz
tx 1024 samples 370 us 22.1 mbs ? scope 25 mhz Vpp 2.74 v
SPI CLOCK 40000000 CCR freq 37.7 MHz
tx 1024 samples 260 us 31.5 mbs scope 37.9 Vpp 2v
Last edited: