mborgerson
Well-known member
Hi Cyrille,
no I don't know the OV7670.
What I know is that you are generating the clock for the OV7670 using the PWM feature of the Teensy 4, and you are driving it to its limits, have a look at the tables at https://www.pjrc.com/teensy/td_pulse.html. The F_BUS speed driving the PWM tick runs at a quarter of the F_CPU speed so at 150MHz, and if you request a 12MHz square wave by analogWriteFrequency(PinCamXclk,12000000); analogWrite(PinCamXclk,127) frankly I don't know how exact the square wave will be.
Within the limits of my 60MHz oscilloscope, it seems you get pretty good square waves when you request an analogWriteFrequency() which divides into 150MHz an even number of times:
150/6 = 25.00MHZ
160/8 = 18.75MHz
150/10 = 15.000 MHz
150/12 = 12.50MHZ
150/14 = 10.71MHz
150/16 = 9.375MHz
I'll probably start with one of the lower frequencies for XCLK until I get around to switching from a breadboard and jumper wires to a carefully solved breadboard with shorter wires.