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?
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/
I'm facing a similar issue. I want to read clock signal of 10Mhz. I'm able to read only up to 7MHz clock signal.
However, in my code, the GPLEV0 reading speed is about 40M times a second. Even with this reading speed, the clock is not able to read. [Makes no sense to say reading at 40MSPS yet not able to catch the clock at 10MHZ. But it is happening with me]
Anyways, the code to read GPLEV0 in a tight loop 30M times a second has been posted in the links below. To read at 40M times a second, you'll have to run the code in a service and add a start/stop triggering mechanism.
Here is my detailed issue with the code: