4

I read that 8-bit is faster than SPI, how much faster is 8-bit than SPI?

Say, if I wanted to run a video loop of a wheel spinning, would the speed difference between SPI and 8-bit mode be obvious?

1
  • 2
    There's no good answer to this question... "how much faster?" ... It depends on many factors. In general, it is faster to read and write a full byte at a time rather than place data in a shift register and output it one bit at a time synchronized with a clock signal. If the clock is the same frequency on both the serial interface and the parallel interface (8-bit), then the data rate on the parallel might be effectively 8 times the serial rate... However, implementation limitations need to be considered.... "Video of a spinning wheel" ... what is the desired frame rate, res? SPI clock OK? Commented Nov 17, 2017 at 0:52

1 Answer 1

4

I assume you are talking about connecting a display on the GPIO of the PI.

GPIO bandwidth

Here are some speed benchmarks for the GPIOS: github page, and one can toggle a GPIO on the PI 3 at 65.8Mhz.

This is the speed for toggling one bit. If you want to drive a 8-bit parallel bus, you will need to drive the 8-bits of data + the control bits (at least the write signal), so you will probably need to write one more register in every loop, reducing the speed by 33% -> ~43.8 MHz. So the maximum theoretical bandwith is ~43.8 MB/s.

SPI bandwidth

According to this answer, the SPI can run at 125 MHz, giving a maximum bandwidth of 15.625 MB/s (125/8 bits).

Bandwidth conclusion

The GPIO method using one full core at 100% can be almost 3 times faster than the SPI, but since the SPI is driven by DMA, it will use much less CPU.

On a Rapsberry PI 2, the gain will be slightly less, and on a Raspberry PI 1 it will even be slower than the SPI.

(Real) conclusion

If you really need a video output, all Raspberry PI except the zero have a DSI connector, which is really the better way of connecting a display to it (the software and the hardware already exist).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.