I want to read the output of OV7670 camera module that produces 8-bit output at a very high frequency. The output pixel clock frequency is around 8MHz. I have to sample those 8-bit data at raspberry pi's GPIO at every falling edge of pixel clock. I am coding the same in python. can anyone can say at what speed raspberry pi samples at GPIO?

  • Why don't you just run your script and find out? – joan Mar 8 '20 at 17:28
  • I tried counting the number of pixel clock rising/falling clocks per second by enabling interrupt, but it didn't count the exact number. The pulses it counted is way more less than what it should be! – HEMASAI KUMAR Mar 8 '20 at 17:37
  • So you already know the answer. You might be able to optimise your script slightly but you will never achieve your aim with Python on the Pi. – joan Mar 8 '20 at 17:42
  • So raspberry pi isn't suitable for this application?or I can achieve this with raspberry pi using scripts other than python? – HEMASAI KUMAR Mar 8 '20 at 17:45
  • 1
    Does this answer your question? How fast can GPIO pins toggle? – Dmitry Grigoryev Jan 29 at 10:35

If you want to work with video on a Pi, you can get a USB VGA webcam for almost the same price as the OV7670 module, and get the video stream via v4l interface ("/dev/video") which will work faster and be easier to use.

If you want to play with low-level video acquisition, get a fast microcontroller with a dedicated data port (1 pins which can be read at once in a single byte). The Pi is not really suitable for this.


We have recently tested the read speed for two python libraries, PIGPIO and RPi.GPIO, by simulating on the raspberry an 8-bit sipo register with an 8-bit D flip flop connected on it's parallel output.

The test was performed on a Raspberry Pi 3b.

Both libraries perform well for frequencies of up to 5 KHz, with accuracy above 99%. The accuracy of the Rpi.GPIO library deteriorates over 5 KHz and at 50 KHz it is incapable of performing this task.

The PIGPIO library performs comparably better, with its accuracy being above 99% for frequencies up to 20 KHz. Above that frequency, its performance gradually deteriorates and at 110 KHz it cannot read correctly any phrase at all.

You can find the exact test setup and results on this this post: https://atman-iot.com/blog/raspberry-pi-benchmark/

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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