Hi Cyrille,

I just did a few quick tests with generating high frequency square waves on the T4.0. What I find on my scope is that indeed the basic PWM tick frequency is 150MHz, so whatever frequency you choose is approximated by a certain number of ticks of 6.6ns each. For instance, you select 12MHz, your analog value of 127 will actually get a best approximation output consisting of 6 ticks 40ns high, 7 ticks ~47ns low, at 11.54MHz with a high duty cycle of 46%.

Now, the OV7670 datasheed specifies that XCLK must be between 10MHz and 48MHz and the duty cycle between 45% and 55%. But depending on your frequency selection and the limitations above your XCLK might go below 45% or above 55% duty cycle. This could be the reason for your issues when increasing the XCLK frequency.

The best you can get in the range that the OV7670 should accept is 37.5MHz that would be generated from exactly two ticks high, two ticks low: Click image for larger version. 

Name:	NewFile27.png 
Views:	14 
Size:	43.3 KB 
ID:	21798

Kind regards,
Sebastian