Skip to content

Example: Camera

Julian Kemmerer edited this page Sep 1, 2025 · 22 revisions

WORK IN PROGRESS


PMOD Camera

This page describes getting a video stream input into an FPGA development board via a Camera PMOD.

This example is from a series of examples designed for dev boards.

TODO link to code.

Camera Module

The camera used in this demo is the Omnivision OV2640.

Using the camera is documented in hardware application notes and consists of:

  • Clocks + Reset:
    • Hold the camera in reset
    • Provide clock to camera for it's PLL
    • Take the camera out of reset
  • Configure the camera over I2C like Serial Camera Control Bus (SCCB)
  • Receive video stream over Digital Video Port (DVP)

Pinout

On the Arty dev board PMOD connectors C and D are used. Arty PMOD C = Camera PMOD J2, Arty PMOD D = Camera PMOD J3.

TODO ALL PINS little table? or just link XK system clock This corresponds output signal Arty PMOD C, row B, I/0 2 aka .xdc top level pin jc(5).

Clocks

The XVCLK System clock input pin is the primary clock input for the camera. The camera datasheet and online examples use a typical rate of 24MHz. On the camera PMOD J2 connector, the system clock input pin labeled XK.

Reset

The hardware application notes show holding in reset (active low) for at least 3ms. Then SCCB initialization should occur at least 3ms after that.

Serial Camera Control Bus (SCCB)

Per the SCCB spec: Reads from the camera, and writes to the camera are completed by transferring bytes. Each 8b value is a 'phase'. Phases are padded with a 9th control/status bit called the Don't-Care bit (sigh, wtf?).

Read

A read transaction occurs over two two-phase transmission cycles (wtf?):

  • ID Address, device id, to select a specific device
  • Sub-address, register address, to select specific register

Then again the ID (wtf?):

  • ID Address, device id, to select a specific device

Then camera drives the bus during final phase:

  • Read Data, the data read from the selected device's register

TODO example Ex. manufacturer id

Write

A write transaction requires three phases of 8b values:

  • ID Address, device id, to select a specific device
  • Sub-address, register address, to select specific register
  • Write Data, the data to be written to the selected device's register

Video Stream

Clone this wiki locally