ALINX AN5640

Contents

ALINX AN5642 Dual Lens Camera Module User Manual

This manual provides detailed instructions for the ALINX AN5642 Dual Lens Camera Module. It covers product specifications, hardware connections, power-on sequences, register configurations, and operational procedures for various display modes.

1. Product Overview

The ALINX AN5642 is a dual-lens camera module that utilizes two OV5640 CMOS chip image sensors from OmniVision Corporation. It supports both independent and simultaneous display functions. Images are transmitted via the DVP interface for connection with an FPGA.

ALINX AN5642 Dual Lens Camera Module front view
Figure 1-1: AN5642 Module Product Photo

2. Product Specifications

The ALINX AN5642 Dual Lens Camera Module features the following parameters:

2.1. General Parameters

  • Module Interface: 40-pin 0.1 inch spacing female header, 2-way camera with separate DVP interface
  • Photosensitive Chip: 2 pieces of OV5640
  • Hardware Pixel: 5 Million (5MP)
  • Sensitive Size: 1/4"
  • Lens Parameters: 5MP/M12 Interface, Focal Length 3.6mm, Monitoring angle 80-96 degrees
  • Spacing: 40mm between the two cameras
  • Module Content: OV5640 Power Supply Circuit and Clock (Flash Drive Circuit also mentioned in listing)
  • Functional Support: Auto focus, Automatic Exposure Control (AEC), Automatic White Balance (AWB)
  • Image Format: RAW RGB, RGB565/555/444, CCIR656, YUV422/420, YCbCr422, and compression
  • Typical Application Fields: Smart Cameras and Vision Hardware
  • Battery Included: No
  • High-concerned chemical: None

2.2. Maximum Image Transfer Rate

  • QSXGA (2592 x 1944): 15 fps
  • 1080p: 30 fps
  • 1280 x 960: 45 fps
  • 720p: 60 fps
  • VGA (640 x 480): 90 fps
  • QVGA (320 x 240): 120 fps

2.3. Working Temperature

  • Operating Temperature Range: -30°C to 70°C (PDF)
  • Stable Working Temperature: 0°C to 50°C (PDF and Listing)

3. Hardware Connection

The AN5642 module connects to an FPGA development kit via its 40-pin female header. An ALINX AX516 development board is used as an example for connection.

ALINX AN5642 Dual Lens Camera Module angled view
Figure 3-1: AN5642 Module Angled View

3.1. Pin Assignment

The 40-pin female header pinout is detailed below:

Pin Assignment Diagram for AN5642 Camera Module
Figure 3-2: Pin Assignment for AN5642 Camera Module
PinPin NamePinPin Name
Pin1GroundPin2+5V
Pin3CMOS2_D9Pin4CMOS2_SDA
Pin5CMOS2_D6Pin6CMOS2_SCL
Pin7CMOS2_D7Pin8CMOS_D2
Pin9CMOS2_HREFPin10CMOS2_D8
Pin11CMOS2_D3Pin12CMOS2_RESET
Pin13CMOS2_D4Pin14CMOS2_D5
Pin15CMOS2_D1Pin16CMOS2_D0
Pin17CMOS2_VSYNCPin18CMOS2_PCLK
Pin19NCPin20CMOS1_SDA
Pin21CMOS1_D9Pin22CMOS1_D8
Pin23CMOS1_SCLPin24CMOS1_D5
Pin25CMOS1_D3Pin26CMOS1_D4
Pin27CMOS1_D6Pin28CMOS1_D0
Pin29CMOS1_D7Pin30CMOS1_D1
Pin31CMOS1_D2Pin32CMOS1_PCLK
Pin33CMOS1_HREFPin34CMOS1_VSYNC
Pin35CMOS1_RESETPin36NC
Pin37GroundPin38Ground
Pin39+3.3V (or NC)Pin40+3.3V (or NC)

Signal Descriptions:

  • CMOSx_D0~D9: Video image data captured by the OV5640 camera. For RGB format, only the upper 8 bits (D2~D9) are typically needed.
  • CMOSx_PCLK: Pixel clock signal. Data is collected on the rising edge of this clock.
  • CMOSx_HREF: Line valid signal. When high, one line of data is valid.
  • CMOSx_VSYNC: Column sync signal.

3.2. Connection to FPGA Board

Simply plug the camera module directly into the expansion port of the development board. Ensure correct alignment of PIN1. For AX515 or AX530 development boards, it may need to be plugged into the J3 port.

4. Chip OV5640 Power-on Requirements

The OV5640 chip has specific power-on timing requirements:

4.1. Power-on Sequence Diagram

OV5640 Power-on Sequence Diagram

Timing Delays:

  • t0: >= 0ms. Delay from DOVDD stable to AVDD stable.
  • t2: >= 5ms. Delay from AVDD stable to sensor power up stable.
  • t3: >= 1ms. Delay from sensor power up stable to Reset# pull high.
  • t4: >= 20ms. Delay from Reset pull high to SCCB initialization.

4.2. Power-on Steps

  1. Step 1: Pull ResetB low to reset AN5640, and pull PWDN high.
  2. Step 2: Power up both DOVDD and AVDD simultaneously (implemented in the module's power supply design).
  3. Step 3: After AVDD stabilizes for 5ms, pull PWDN low.
  4. Step 4: After PWDN goes low for 1ms, pull ResetB high.
  5. Step 5: After 20ms, initialize OV5640 via SCCB.

5. Register Configuration of CMOS Chip OV5640

The OV5640's registers are configured through the I2C interface of the FPGA (or other CPU). Users must configure the correct register values for the desired image format. For example, to output 720P (1280x720) video in RGB565 format at 30fps.

5.1. Internal Test Images for Debugging

The OV5640 can generate internal test images like color bars and color squares for debugging purposes.

5.1.1. Color Bar

write_i2c(0x503d, 0x80);write_i2c(0x4741, 0x00);

5.1.2. Color Square

write_i2c(0x503d, 0x82);write_i2c(0x4741, 0x0);

5.2. Data Format Configuration

The data format of the OV5640 camera output is configured in the 0x4300 registers. For RGB565 output format, refer to the OV5640 application guide or datasheet for detailed register descriptions.

6. Operating Instructions: Binocular Display Experiments

6.1. Binocular Switching Display Experiment

This experiment displays the image from one of the two cameras on a VGA display. The displayed video image can be switched between cameras using the KEY1 button on the development board. Each video image is displayed at 720P resolution.

6.1.1. Programming Logic

The FPGA program design involves several modules:

Binocular Camera Module FPGA Add-on Module AN5642
Figure 6-1: Binocular Camera Module AN5642

Program Flow:

  1. After power-on, the FPGA configures the binocular camera registers via the I2C bus, setting the OV5640 to 720P 30-frame video output.
  2. The camera signal selection module selects one video stream from the two cameras to enter the camera data acquisition module.
  3. The camera data acquisition module converts the video image into 32-bit or 64-bit wide data and stores it in a write FIFO.
  4. When the write FIFO data reaches a threshold, a burst write signal is sent to the DDR read/write control module, which writes data from the FIFO to the DDR chip.
  5. If the read FIFO data falls below a threshold, a burst read signal is sent to the DDR read/write control module, which reads data from the DDR into the read FIFO.
  6. The VGA display module reads data from the read FIFO and displays the video image on the VGA display.

Key Modules:

  • power_on_delay.v: Ensures OV5640 power-on timing requirements are met.
  • reg_config.v: Configures OV5640 registers via I2C for both chips (e.g., RGB565 format, 1280x720 resolution).
  • cmos_select.v: Detects KEY1 button presses to switch between CMOS1 and CMOS2 video signals (default is CMOS1).
  • COMS_Capture.v: Converts 8-bit image data from OV5640 to 32-bit or 64-bit width, generating FIFO write signals. For RGB565, 16 bits of data require two 8-bit outputs (2 clocks), so a 720P image row needs 1280 * 2 PCLK clocks.
  • dcfifo_ctrl.v: Manages two FIFOs (write and read) for buffering data between the camera, DDR, and VGA display.
  • mem_ctrl.v: Converts external burst read/write requests into DDR IP Local Bus signals, simplifying DDR access.
  • ddr3_top.v: DDR controller module generated by Xilinx/Altera IP.
  • vga_disp.v: Implements VGA display, generating sync signals and timing for image data (e.g., 1280x768@79.5MHz, 60Hz). It also centers the 1280x720 image within the 1280x768 VGA display by leaving the first and last 24 lines black.
  • bank_switch.v: Manages DDR read/write operations across different memory banks to prevent image distortion.
  • system_ctrl.v: Generates camera clock (24MHz), VGA image clock (79.5MHz), and system reset signals.

6.1.2. Experiment Procedure

  1. Write the FPGA program.
  2. Assign the pins of the FPGA.
  3. Recompile the project.
  4. Connect the AN5642 camera module to the development board.
  5. Connect a VGA display to the VGA interface of the development board.
  6. Download the .sof file to the FPGA.
  7. Observe the 1280x768 video images on the VGA display. By default, CMOS1 video is displayed.
  8. Press the development board button KEY1 to switch to the CMOS2 video image.
Dual-Lens Camera Display showing multiple views
Figure 6-2: Dual-Lens Camera Display Example

6.2. OV5642 Binocular Display Simultaneously Experiment

This experiment simultaneously displays video images from both cameras on a VGA display. The CMOS1 camera image is shown on the left side, and the CMOS2 camera image is shown on the right side. The VGA output resolution remains 1280x768, while each camera (CMOS1 and CMOS2) outputs at 640x480 resolution.

6.2.1. Programming Logic

For simultaneous display, additional read and write data FIFOs are required for the second camera's video storage. Multi-port arbitration programs for DDR read and write (ddr multiple port read arbitration and ddr multiple port write arbitration) are also added.

Key Modules:

  • mem_read_arbi.v (Multi-port DDR read arbitration module): Polls four input ports (ch0~ch3). If a port has a read request and a non-zero read burst length, it enters the read state for that port and outputs the burst read request. This ensures no read requests are lost.
  • mem_write_arbi.v (Multi-port DDR write arbitration module): Operates on the same polling principle as the read arbitration module.

6.2.2. Experiment Procedure

  1. Write the FPGA program.
  2. Assign the pins of the FPGA.
  3. Recompile the project.
  4. Connect the AN5642 camera module to the development board.
  5. Connect a VGA display to the VGA interface of the development board.
  6. Download the .sof file to the FPGA.
  7. Observe the video images from both cameras displayed simultaneously on the VGA monitor.

6.2.3. Picture-in-Picture Effect

Users can modify the program to display different video image sizes (e.g., CMOS1 at 1280x720, CMOS2 at 640x480) and achieve a picture-in-picture effect on the VGA display.

7. Troubleshooting and Adjustments

7.1. Adjusting Focus

If the captured video image appears unclear, rotate the corresponding camera lens to adjust its focus.

8. Safety Information

  • Be careful not to connect the wrong power supply.
  • Pay attention to anti-static precautions when handling the module.

9. Technical Support and Customer Service

For any errors, technical assistance, or instant quotes, please use the following contact information:

Seller-listed specifications

SpecificationSeller values
Battery Includedno
Typical Application FieldsSmart Cameras and Vision Hardware
High-concerned chemicalNone
Model NumberAN5640
OriginMainland China
FPGA ModuleAN5642
Interface40-pin 0.1 inch spacing female header
PixelHardware Pixel 5 Million
Photosensitive Chip2 Pieces of OV5640
Sensitive Size1/4
Lens Parameters5MP/M12 Interface, Focal Length 3.6mm, Monitoring angle 80-96 degrees
Module ContentOV5640 Power Supply Circuit and Flash Drive Circuit
Functional SupportAuto focus, Automatic Exposure Control (AEC), Automatic White Balance (AWB)
Image FormatRAW RGB, RGB565/555/444, CCIR656, YUV422/420,YCbCr422 and compression
Capture PictureQSXGA (2592 x 1944),1080p,1280 x 960, VGA(640 x 480), QVGA(320 x 240)
Working Temperature'0℃~50℃
Spacing40mm between Two Cameras
Documents and downloads

Ask a question about this manual

Ask about setup, troubleshooting, compatibility, parts, safety, or missing instructions. Manuals+ will review the question and use this page’s manual context to help answer it.

After a successful submission, we securely hash the supplied account or form email before sending it to Microsoft Advertising for conversion attribution. Privacy details.

Rate this product if you’ve used it

Was this page helpful?