摘 要:隨著通信技術的發展,通用串行總線作為一種新型接口技術得到廣泛應用,它使得計算機與外部設備的連接十分方便。首先介紹USB 2.0特點,并給出了利用CY7C68013A設計控制系統的總體方案,同時對系統固件功能和驅動程序設計做了詳細討論,并提出系統設計中需要注意的一些關鍵性問題。控制系統固件程序采用C語言編寫,上位機界面在VC++6.0環境下開發。實驗表明該系統運行良好。
關鍵詞:CY7C68013A; 通用串行總線; VC++6.0; 固件; 上位機
中圖分類號:TP368.1 文獻標識碼:A
文章編號:1004-373X(2010)13-0190-04
Design of USB Control System Based on CY7C68013A
ZHAO Tie-jun
(Equipment Power Department, China Coal Beijing Coal Mining Machinery Co. Ltd., Beijing 102400, China)
Abstract: With the increasing development of the communication technology, the universal serial bus (USB) as a new interface technology that makes the connection of PCs with peripheral equipments very simple has been extensively adopted. The feature of USB2.0 is introduced firstly, and then the overall plan for designing the control system by using CY7C68013A is presented. The function of the system firmware and the design of drive program are discussed in detail. The key issues which should be taken more attention during the system design are proposed. The control system firmware is programmed with C language. The control interface on PC is developed under the VC++6.0 development environment. The experiment indicates that the whole system runs perfectly well.
Keywords: CY7C68013A; USB; VC6.0; firmware; PC
0 引 言
通用串行總線 (Universal Serial Bus,USB)作為計算機上的新型接口技術,越來越受到人們的青睞。與以前的RS 232,RS 485,ISA,PCI和并行接口等接口相比,USB避免了接口體積大、接口規范不統一、不支持熱插拔等缺陷,具有使計算機與外部設備連接十分方便的優點[1-2]。目前,很多設備都開始使用USB接口來實現,如鼠標、鍵盤、打印機等。在實際設計工作當中,也越來越多地采用了USB技術,如數據采集等[3-4]。USB的設計和應用已經成為現代電子設計中一個非常重要的部分。
1 USB 2.0特點
USB是一種高效、快速、價格低廉、體積小的新型串行通信接口,其最大的特點是支持熱插拔,可以在不重新啟動計算機的情況下直接將USB外部設備連接到計算機并開始通信。
USB具有以下主要特點[2]:
(1) 節省系統資源。在計算機中,系統為USB主控制器分配一根中斷控制線和一些輸入/輸出地址,USB再為外部設備分配惟一的地址。
(2)可以提供電源。計算機上的USB接口可以向外部設備提供一定的電力支持,其輸出電流最小值為100 mA,最大值為500 mA,輸出電壓為5 V。……