Raspberry Pi’s GPIO Speed

We all know that the raspi is a small and neat device for controlling our LEDs but sometimes I miss the possibility to add hardware to a “real” bus like a real CPU has. Sure it is possible to imitate a bus what is called bit banging. This way you can control external hardware like LCDs or writing data to external SRAM faster than utilizing SPI. So we were interested how fast the Pi can really switch these pins.

There are some benchmarks out there but I tried to find the real limit. Therefore we implemented the GPIO pin switching in assembler:

 

Here is the result:

 

Screenshot of oscilloscope showing max frequency of GPIO transfer
Screenshot of oscilloscope showing max frequency of GPIO transfer

As you can see, this code is able to switch it at 25 MHz and the the curve looks quite good. However, even further optimizations like loop-unrolling does not help. 25 MHz is really the highest frequency you can achieve.

Ein Gedanke zu „Raspberry Pi’s GPIO Speed“

Schreibe einen Kommentar