Getting Clock Out signal 8Mhz or more from BBB to work with ov7670 camera

I’m trying to interface with OV7670 camera, which requires an external clock signal of at least 8Mhz to power it up. What GPIO can I use to generate this? I wonder if PWM can do this?

I looked at the datasheet:

…and it seems like it wants a clock of nominal frequency 24MHz (10 min, 24 nom, 48 max).

Might the 24.576MHz pixel clock located at pin 25 of P9 do the trick? You might need to level shift it a bit (perhaps just a resistive divider) to match whatever IO voltage (typ 2.5V, but maybe 3.0V) you use on the camera.


I’ll try it tonight. What do I need to do to activate it, or does it output that frequency by default?

With a 24MHz input clock, any of the timer pins (TIMER4, TIMER5, TIMER6, TIMER7) can be programmed to produce 12MHz.

What are those pins? I searched everywhere for CLK_OUT, Timer Pin and so forth. Any pin layout schematics didn’t yield any useful information.

Every pin has all the possible outputs listed for each pin in the schematic. I suggest you take a look at the datasheet for the processor for more detailed information. Maybe even try looking at the TRM for the processor.



As far as I know, the 24.576MHz is always active when the card is in the default state. There is a note on page 3 of the schematic that says it can be disabled in software if that pin needs to be used as a GPIO, but I think that you should be OK as long as you have not tried to add that pin to a device tree.

Section 7.1 of the SRM has a couple of tables (one each for P8 and P9) that maps out all the pins and the pin-muxing possibilities. The timers are only a few rows down in table 10, but the 24.576MHz clock is a bit harder to find. It is “mcasp0_ahclkx” in table 11. It is the pixel clock that goes to the HDMI controller. I’ve successfully used it to clock an off-card I2S DAC for audio purposes, however.

The 24.576MHz clock comes from oscillator Y4 on page 3 of the schematic.


Section 7.1 of the BeagleBone Black System Reference Manual details all of the pins on the two expansion connectors (P8 and P9). On P8, pins 7, 8, 9, and 10 correspond to TIMER4, TIMER7, TIMER5, and TIMER6, respectively. In order to use those pins, you will need to configure the corresponding timer (see Section 20.1 in the AM335x Technical Reference Manual).

The TIMER4, TIMER5, TIMER6, and TIMER7 names can be found in most of the documentation, including the schematic, the BeagleBone Black System Reference Manual, and the AM335x Technical Reference Manual. These pins are used by the corresponding timer for various purposes. One of those purposes is to produce an external clock.

Did you manage to use the OV7670? Which modules did you use? On which pins have you connected the sensor?