基于USB2.0的CMOS图像传感器视频传输系统的研制
详细信息    本馆镜像全文|  推荐本文 |  |   获取CNKI官网全文
摘要
随着数码产品的不断普及,摄像头的应用范围在不断的扩大,摄像头中的核心部件----图像传感器的用量也在日益增长,由于CCD图像传感器成本等因素的限制,近几年CMOS图像传感器的用量急剧上升,大量的摄像头生产厂商都选用了CMOS图像传感器,特别是在手机等数码产品所用的摄像头中都选用了CMOS图像传感器。本文就是基于以上背景的情况下,给出了基于USB2.0接口的CMOS图像传感器视频传输系统。它可广泛应用在摄像头产品的质量检测、图像获取系统,具有传输速度快、电路简单、成本低廉和连接安装方便等特点。
     围绕基于USB2.0的视频传输系统,文中讨论了它的基本组成,系统的硬件、软件设计方法,并详细描述了USB2.0接口部分的原理以及在PC上视频显示的原理,给出了相关程序设计过程和部分源代码,还进行了综合测试。
     系统采用的主要核心部件包括Cypress公司FX2系列的CY7C68013芯片、CMOS传感器组成的摄像头等。首先根据实际的需要设计了系统的硬件电路,制作了PCB板;然后在该硬件电路的基础上,编写了系统的固件程序。固件程序设计主要包括以下几部分:(1)USB2.0接口的初始化。通过对CY7C68013的CPUCS, USBCS, IFCONFIG等寄存器进行设定,使其工作在预定的模式下;(2)图像传感器的初始化程序设计;(3)通用编程接口(GPIF)程序设计。首先FIFO读波形描述符(GPIF波形)由GPIF Designer工具产生,然后固件启动FIFO读波形,从而实现对CMOS摄像头时序的控制和图像数据采集。(4)USB2.0的批量传输程序设计;(5)主程序设计。主程序的功能除了要完成(1)~(4)中断论述的功能外,还要给出USB控制传输的固件应答程序及相应的中断初始化和中断服务程序。最后,编写了应用程序。其主要功能有:检测USB设备、设置USB数据传输管道设置,从USB接口采集数据,在PC中实时(动态)显示并能实时抓取图像,为以后在该系统的基础上对需要的图像进行分析处理奠定了基础。
     设计过程充分利用了现有芯片资源,在不使用CPLD等控制芯片的条件下,用GPIF接口的控制逻辑来有效合理地控制CMOS摄像头的工作时序,并读取数据至缓冲区,从而节省了一般类似系统所必需的FIFO芯片和控制时序的CPLD芯片等。综上所述,本文给出的这种设计方案是一种优化性能突出的设计方案,它不仅降低了开发成本,也节省了系统容量,更利于产品开发。通过实验,系统数据传输稳定、图像清晰。该系统已应用在CMOS数字图像传感器摄像头的质量检测系统。
With the digital product being popularized, application range of the camera shooting is gradually expanded , the quantity in demand for image sensors in main component of the camera shooting is also increasing gradually, however, because of the limit of cost for CCD image sensor , the demand of CMOS image sensor is steeply rising in the past few years. The large number of producers for camera shooting has selected the CMOS image sensor, especially; camera shooting used for mobile phones and other digital products has used the CMOS image sensor. Based on the above background, the thesis plans to design the video transmission system of CMOS image sensor based on USB2.0. It can be widely applied to the system, which can detect camera shooting and capture image. And it has characteristics of high speed of transmission , circuit simplicity, low cost and facility of linking installation and so on.
     Based on the USB2.0 video transmission system, this thesis discusses its basic components, hardware, software design methods and a detailed description of the principle of the USB 2.0 interface and video display on PC, and it presents the program design process and part of the source code and also takes a comprehensive test.
     The components adopted in the system mainly include CY7C68013 of FX2 series manufactured by Cypress Semiconductor, camera shooting of CMOS sensor and so on. As for the framework of the thesis, firstly, the systematic hardware circuit are designed according to actual need and make the PCB boards. And then based on the hardware circuit, I programme the firmware procedure of system. Firmware procedure mainly includes several parts of the following: (1) USB2.0 interface's initialization. The procedure sets the registers for CPUCS, USBCS, IFCONFIG of the CY7C68013, and makes it work in the scheduled mode. (2) Image chip's initialization programming. (3) General Programmable Interface(GPIF) programming. First,GPIF designer are made use of to design waveform descriptors of FIFO Read(GPIF waveform ), and then it will be started up FIFO Read waveform descriptors by the firmware. So, FIFO Read waveform descriptors can control the time sequence of CMOS camera shooting and collect image data from CMOS camera shooting. (4) USB2.0 bulk transfer programming. (5) Main framework programming. The function of main program can't only accomplish the function of the (1)~(4) interruption, but give out firmware responsion of USB control transfers and corresponding procedures of interruption initialization and interruption service. Finally, applied procedure is programmed. Its main function includes: detecting USB device, setting up USB data transmission pipe, collecting data from USB interface, displaying the video data on PC and capturing video image at any moment, so based on the system, the applied procedure lays the foundation of analyzing and processing image data later.
     The system design takes full advantage of the current IC resources. It controls the time sequences of CMOS sensor efficiently by using GPIF, and reads the data into the given buffer, so that the whole system is designed without FIFO and CPLD which are indispensable to the normal solutions. In conclusion, the scheme proposed in this paper has the prominent performance on optimization, which can both reduce the cost and save the resource of the system. Further more, the product development will also be very easy. The experimental results show that the transmission of the system data is stable and the image is sharp. The system has been applied in the quality detection system of the camera shooting of CMOS digital image sensor.
引文
[1] NI USB 数据采集卡,http://ni.com/dataacquisition/usb/zhs/
    [2] Universal Serial Bus Specification[M], Rev 1.1 1998
    [3] 侯利军,王殊等.IDT72V2113 在高速数据采集系统中的应用[J].电子与封装,2004,4(6):53~56
    [4] FX to FX2 Comparison, Cypress Semiconductor Corporation 2003, 11
    [5] EZ-USB FX2 Technical Reference Manual, Cypress Semiconductor Corporation, 2002, 12;
    [6] Universal Serial Bus Speciation Rev2.0 2001
    [7] 边海龙,贾少华. USB2.0 设备的设计与开发.北京:人民邮电出版社,2004,1
    [8] 尹罗生,吉吟东,孙新亚等.一种 USB 外设的实现方法.计算机工程,2002 年,第 28 卷(第7 期):2007~2009
    [9] Cypress Semiconductor Corporation,EZ-USB FX2 Technical Reference Manual(Version 2.1), www.cypress.com,2001
    [10] FX to FX2 Comparison, Cypress Semiconductor Corporation 2003, 11
    [11] 米良川.USB2.0 高速数据采集系统.中国科技大学,2003
    [12] 钱峰.EZ-USB FX2 单片机原理、编程及应用. 北京航空航天大学出版社,2006,3
    [13] CY7C68013 High-Speed USB Peripheral Controller, Cypress Semiconductor Corporation, 2002, 12
    [14] 周云锋,孙书鹰,王宏.基于 USB2.0 的高速同步数据采集系统设计.电子技术应用2004,30(2):16-18
    [15] EZ-USB General Purpose Driver Specification 1999, 2
    [16] (美)Kate GreGory.Visual C++6 开发使用手册[M].北京:机械工业出版社,1999 年
    [17] 萧世文.USB2.0 硬件设计.北京:清华大学出版社,2002
    [18] 许永和.EZ-USB FX 系列单片机 USB 外围设备设计与应用.北京航空航天大学出版社,2005
    [19] 李军.51 系列单片机高级实例开发指南 .北京航空航天大学出版社,2004
    [20] Xing Yuejian, Peng Shusheng,Design of data acquisition and control card based on USB interface,Control&Automation,2005
    [21] Murovec, B. Kocijancic,Educational data acquisition system with USB interface, IEEE REGION 8 EUROCON, 2003
    [22] 于勇,雷志勇.Windows 下实时测控系统的实现.现代电子技术,2005 ( 5 ) .
    [23] David McCombs 著.PC 数据采集.中国电力出版社,2004
    [24] 李强.Visual C 十十项目开发实践.中国铁道出版社,2003
    [25] James Pcohoon, Jack W. Davidson 著.刘瑞挺、韩毅刚、盛素英等译,C++ 程序设计.电子工业出版社,2002
    [26] Wright, N.Judd, Using USB as a data acquisition interface, EE-EVAL ENG , 2004.
    [27] John Hyde,孙耀国,赵德刚译.USB 设计应用实例 .中国铁道出版社,2003
    [28] Jan Axetson 著,陈逸等译.USB 大全.中国电力出版社,2001
    [29] 马伟.USB 系统原理及主/从机设计.北京航空航天大学出版社,2004 年
    [30] Universal Serial Bus Specification Revision l.l,http://www.usb.org
    [31] USB Mass Storage Bulk-Only Transport,http://www.usb.org
    [32] 左长魁.基于 USB 通信的高速数据采集器的研究.哈尔滨工业大学硕士学位论文,2002

© 2004-2018 中国地质图书馆版权所有 京ICP备05064691号 京公网安备11010802017129号

地址:北京市海淀区学院路29号 邮编:100083

电话:办公室:(+86 10)66554848;文献借阅、咨询服务、科技查新:66554700