This website uses cookies. By using this site, you consent to the use of cookies. For more information, please take a look at our Privacy Policy.
Home > FPGA Technical Tutorials > Design Recipes for FPGAs Using Verilog and VHDL > High Speed Video Application > The Camera Link Interface

TABLE OF CONTENTS

Xilinx FPGA FPGA Forum

The Camera Link Interface

FONT SIZE : AAA

Hardware Interface 

There are a number of approaches for linking cameras for the high-speed transfer of data, with the two most common being USB (to PCs) and a standard Camera Link using LVDS serial data transmission. The LVDS (Low Voltage Differential Swing) system is a differential serial link that uses voltages of about 350 mV to transmit high-speed data with low noise and low power. Many FPGA development kits have a standard LVDS bus available and this means that the signals can be connected directly between the camera and the FPGA board to transfer data from the camera to the FPGA and hence to the storage (either RAM or HDD).

Data Rates 

The actual data rate required is theoretically the resolution multiplied by the frame rate multiplied by the number of bits required for each pixel, which in this example would mean the following calculation: Data rate = Resolution ∗ frame rate ∗ bits/pixel (7.1) 

which for the specification would mean a total data rate of:

Data rate = 640 ∗ 480 ∗ 100 ∗ 24 (7.2) 

Data rate = 737,280,000 bps (7.3)

This equates to a data rate of over 90 MB/s (megabytes per second) and as such is extremely fast for a practical application. Even if the FPGA could run at 100 MHz, the margin on such a system is pretty small.

The Bayer Pattern 

Luckily, in practice, most camera systems do not use 24 bits in this raw fashion. Kodak has developed the Bayer pattern which is a technique whereby instead of requiring each pixel to have its own individual three color planes (requiring 24 bits in total), an array of color filters is placed over the camera sensor and this limits the requirement for data bits per pixel to a single 8-bit byte (with a known color filter in place). The Bayer pattern is repeated over the image in a fixed configuration to standardize this process. The Bayer pattern is shown in Figure 7.2. Clearly, using this approach, the required data rate can be divided by three and reduces to a more manageable 30 MB/s. 

Clearly, the disadvantage of this approach is that the resolution is reduced; however, most images can be reconstructed fairly readily using a method of interpolation which checks firstly which color the current pixel is (red, green, or blue, denoted by R, G or B respectively) and then takes an average of the neighboring pixels of the missing colors. For example, if the current pixel color is green, then the blue and red color of the current pixel is obtained by averaging the neighboring blue (2) and red (2) pixels, respectively.

Basic Bayer pattern, and extended over a larger image areapng

Memory Requirements 

Taking the use of Bayer patterns to reduce the sheer amount of data required into account, this means that the RAM requirements are still high; in this case for a 640 × 480 image size, this will require a memory size of: 

Memory size = resolution ∗ bits/pixel (7.4) 

Memory size = resolution ∗ 8 bits (7.5) 

Memory size = 640 ∗ 480 ∗ 8 bits (7.6) Memory size = 307,200 ∗ 8 bits (per frame) (7.7)

Clearly, a large memory is going to be required for any significant memory storage and it is unlikely to be possible to store this on the FPGA itself. A more practical solution will be to use some RAM connected to the FPGA (or perhaps available on the development board itself). Options for the memory could include SDRAM or Flash memory. Both of these options will be discussed in detail later in the book; however, it is useful to consider the advantages and disadvantages of each approach in general. If we consider SDRAM (Synchronous Dynamic Random Access Memory), the key aspects of this type of memory to consider are:

• This type of DRAM (Dynamic RAM) relies on transistor capacitance on gates to store data. 

• DRAM is much more compact than SRAM (Static RAM). 

• DRAM cannot be synthesized; you need a separate DRAM chip. 

• SDRAM requires a synchronization clock that is consistent with the rest of the hardware system (it is designed to operate with microprocessors). 

• DRAM data must be refreshed as it is stored charge and decays after a certain time. 

• DRAM is slower than SRAM. Static RAM (SRAM) can be considered in a similar way to a ROM chip and it also has (differing) key aspects of behavior to consider: 

• Memory cells are based on standard latches. 

• SRAM is fast. 

• SRAM is less compact than DRAM (or SDRAM). 

• SRAM can be synthesized on an FPGA so is ideal for small, fast registers, or memory blocks.

Static RAM is essentially asynchronous, but can be modified to behave synchronously (as SDRAM is the synchronous equivalent of DRAM), and this is often called Synchronous RAM. Flash memory is useful to consider at this point, even though its operation is fundamentally different from the memory types considered thus far, simply because it is easy to use and is commonly available on many FPGA development boards. Flash memory is essentially a form of EEPROM (electrically programmable ROM) that can be used as a form of persistent RAM. Why persistent? In Flash memory, the device memory is retained even when the power is removed, so it is often used as a form of ROM, which makes it an interesting memory to use on FPGA systems as it could be used to store the FPGA program, but also used as a RAM storage (dynamically) for current data.



  • XCS20XL-5PQ208C

    Manufacturer:Xilinx

  • FPGA Spartan-XL Family 20K Gates 950 Cells 250MHz 3.3V 208-Pin HSPQFP EP
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XCS20XL-5VQ100C

    Manufacturer:Xilinx

  • FPGA Spartan-XL Family 20K Gates 950 Cells 250MHz 3.3V 100-Pin VTQFP
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS: No RoHS

  • XC2V1500-4FG676I

    Manufacturer:Xilinx

  • FPGA Virtex-II Family 1.5M Gates 17280 Cells 650MHz 0.15um Technology 1.5V 676-Pin FBGA
  • Product Categories: FPGAs

    Lifecycle:Obsolete -

    RoHS:

  • XC2V1500-5FFG896I

    Manufacturer:Xilinx

  • FPGA Virtex-II Family 1.5M Gates 17280 Cells 750MHz 0.15um Technology 1.5V 896-Pin FCBGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS:

  • XC2V1500-6BGG575C

    Manufacturer:Xilinx

  • FPGA Virtex-II Family 1.5M Gates 17280 Cells 820MHz 0.15um Technology 1.5V 575-Pin BGA
  • Product Categories: FPGAs (Field Programmable Gate Array)

    Lifecycle:Obsolete -

    RoHS:

Need Help?

Support

If you have any questions about the product and related issues, Please contact us.