SPI speed test

I’ve been meaning to check the actual speed of the SPI communication between the STM32F401RE and the Raspberry Pi for some time and yesterday I finally got around to it.

I’ve set the speed to 16 MHz on the Raspberry Pi, which is setup as the master. I would have preferred to have the Nucleo F401 as master, but I guess I can’t have the cake and eat it too.

The rpi has more limitations still. It insists on transferring only 8bit data, and long story short: It means moving 7388 bytes, which with a speed of 16 MHz should take 3.7 ms.

And here it is (we’re looking at channel 7 which is connected to the SCLK line):

SPI-speed2

As you can see it takes four-point-something miliseconds. Not too bad I think.

If you been visiting my blog before you’ll know I usually borrow the high school I work at’s Picoscope, which works great with linux. This time however I’ve used a logic analyzer  (a really cheap Saleae Logic clone) together with the fantastic Sigrok software.¹

You get what you pay for and the logic analyzer is no exception. As you see there’s lots of crosstalk between the channels, so if you need a proper tool I suggest you buy the real thing from Saleae.

¹I tried compiling Sigrok from source, but eventually I settled for a precompiled package, though not the one from the Debian repositories (I’ll add the link once I find it again).

Advertisements

One thought on “SPI speed test

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s