cdc類虛擬串口固件設計_畢業(yè)論文.doc
約40頁DOC格式手機打開展開
cdc類虛擬串口固件設計_畢業(yè)論文,摘 要在接口技術高速發(fā)展的今天,串口即將成為歷史。usb等接口將逐步取代串口成為新一代最常用的接口。然而,由于之前串口較為普及,針對串口的應用程序也非常多,而且有些功能還非常強大,如何能夠最大限度地減少接口更新對應用程序的影響,成為了當今接口技術的一個新課題。本文就基于usb的cdc類,在帶有usb口的c8051f34...
![](http://img.queshao.com/images/pcgzh.gif)
![](http://preview.queshao.com/tobuy/286579.gif)
內(nèi)容介紹
此文檔由會員 莎士比亞 發(fā)布
摘 要
在接口技術高速發(fā)展的今天,串口即將成為歷史。USB等接口將逐步取代串口成為新一代最常用的接口。然而,由于之前串口較為普及,針對串口的應用程序也非常多,而且有些功能還非常強大,如何能夠最大限度地減少接口更新對應用程序的影響,成為了當今接口技術的一個新課題。
本文就基于USB的CDC類,在帶有USB口的C8051F340單片機上,以開發(fā)USB虛擬串口固件為目標,通過標準請求、設備管理、數(shù)據(jù)傳輸?shù)饶K的設計與論證,并結(jié)合固件開發(fā)的實際,完成了USB到虛擬串口的轉(zhuǎn)換的設計。
本文的核心是建立ACM模型,即抽象控制模型。根據(jù)這個模型,對CDC類下的通信接口類和數(shù)據(jù)接口類進行設計開發(fā),并著重對通信接口和數(shù)據(jù)接口的各個端點進行設計論證。在此基礎上,實現(xiàn)對USB設備的枚舉,控制以及數(shù)據(jù)傳輸?shù)裙δ?,從而為實現(xiàn)USB到虛擬串口的轉(zhuǎn)換提供了保證。
關鍵詞:USB;虛擬串口;CDC;抽象控制模型
Abstract
Nowadays, as the interface technology develops in a high speed, the serial port is going to be history. Interface such as USB will replace serial port gradually and be the most common one in a new generation. However, since the widely spreading of serial port in past with great deal of development programs of serial port, and some functions are powerful, it has been a new problem that how to reduce the influence caused by interface update to application program to the maxima limit.
The paper focuses on how to convert Universal Serial Bus (USB) to a serial port in the C8051F340 microcontroller with USB port. In order to realize the function of virtual serial port, we combine with the actual firmware, design and demonstrate the standard request, device management and data transmission module.
The core of this paper is to establish an ACM , that is the Abstract Control Model. Based on this model, the data communication interface class and interface class which under the CDC are designed and developed. Focusing on the various endpoints which are included in the communication interface and data interface it has a demonstration. On this basis, it have realized the enumeration and control on the USB device, also, data transfer capabilities. Thus, it guarantees the alteration from USB to virtual serial port.
Keywords: USB; virtual serial port; Abstract Control Model
目 錄
1 引言 1
1.1 課題背景 1
1.2 課題要求 1
1.3 課題意義 2
2 相關技術及開發(fā)工具 3
2.1 CDC類簡述 3
2.2 C8051F340單片機簡介 3
2.3 開發(fā)環(huán)境簡介 4
3 總體設計 6
3.1 應用軟件的模塊設計 7
3.2 應用軟件的功能設計 7
4 詳細設計 10
4.1 標準請求 10
4.1.1 設備描述符 10
4.1.2 配置描述符 11
4.1.3 接口描述符 12
4.1.4 端點描述符 13
4.1.5 字符串描述符 14
4.1.6 描述符設計要求 14
4.1.7 標準命令 15
4.2 類請求的實現(xiàn) 17
4.2.1 SEND_ENCAPSULATED_COMMAND請求 17
4.2.2 GET_ENCAPSULATED_RESPONSE請求 17
4.2.3 GET_LINE_CODING 請求 17
4.2.4 SET_LINE_CODING 請求 18
4.2.5 SET_CONTROL_LINE_STATE請求 19
4.3 數(shù)據(jù)傳輸?shù)膶崿F(xiàn) 19
4.3.1 令牌包 19
4.3.2 數(shù)據(jù)包 20
4.3.3 握手包 20
4.3.4 數(shù)據(jù)傳輸 20
4.4 INF文件的創(chuàng)建 21
4.4.2 INF文件的規(guī)范 23
4.4.3 INF文件的內(nèi)容 23
5 聯(lián)機調(diào)試 26
5.1 調(diào)試設置 26
5.2 下載調(diào)試 26
6 固件測試及結(jié)論 30
6.1 串口調(diào)試工具設置 31
6.2 數(shù)據(jù)傳輸測試 31
6.3 結(jié)論 31
參考文獻 33
致 謝 35
在接口技術高速發(fā)展的今天,串口即將成為歷史。USB等接口將逐步取代串口成為新一代最常用的接口。然而,由于之前串口較為普及,針對串口的應用程序也非常多,而且有些功能還非常強大,如何能夠最大限度地減少接口更新對應用程序的影響,成為了當今接口技術的一個新課題。
本文就基于USB的CDC類,在帶有USB口的C8051F340單片機上,以開發(fā)USB虛擬串口固件為目標,通過標準請求、設備管理、數(shù)據(jù)傳輸?shù)饶K的設計與論證,并結(jié)合固件開發(fā)的實際,完成了USB到虛擬串口的轉(zhuǎn)換的設計。
本文的核心是建立ACM模型,即抽象控制模型。根據(jù)這個模型,對CDC類下的通信接口類和數(shù)據(jù)接口類進行設計開發(fā),并著重對通信接口和數(shù)據(jù)接口的各個端點進行設計論證。在此基礎上,實現(xiàn)對USB設備的枚舉,控制以及數(shù)據(jù)傳輸?shù)裙δ?,從而為實現(xiàn)USB到虛擬串口的轉(zhuǎn)換提供了保證。
關鍵詞:USB;虛擬串口;CDC;抽象控制模型
Abstract
Nowadays, as the interface technology develops in a high speed, the serial port is going to be history. Interface such as USB will replace serial port gradually and be the most common one in a new generation. However, since the widely spreading of serial port in past with great deal of development programs of serial port, and some functions are powerful, it has been a new problem that how to reduce the influence caused by interface update to application program to the maxima limit.
The paper focuses on how to convert Universal Serial Bus (USB) to a serial port in the C8051F340 microcontroller with USB port. In order to realize the function of virtual serial port, we combine with the actual firmware, design and demonstrate the standard request, device management and data transmission module.
The core of this paper is to establish an ACM , that is the Abstract Control Model. Based on this model, the data communication interface class and interface class which under the CDC are designed and developed. Focusing on the various endpoints which are included in the communication interface and data interface it has a demonstration. On this basis, it have realized the enumeration and control on the USB device, also, data transfer capabilities. Thus, it guarantees the alteration from USB to virtual serial port.
Keywords: USB; virtual serial port; Abstract Control Model
目 錄
1 引言 1
1.1 課題背景 1
1.2 課題要求 1
1.3 課題意義 2
2 相關技術及開發(fā)工具 3
2.1 CDC類簡述 3
2.2 C8051F340單片機簡介 3
2.3 開發(fā)環(huán)境簡介 4
3 總體設計 6
3.1 應用軟件的模塊設計 7
3.2 應用軟件的功能設計 7
4 詳細設計 10
4.1 標準請求 10
4.1.1 設備描述符 10
4.1.2 配置描述符 11
4.1.3 接口描述符 12
4.1.4 端點描述符 13
4.1.5 字符串描述符 14
4.1.6 描述符設計要求 14
4.1.7 標準命令 15
4.2 類請求的實現(xiàn) 17
4.2.1 SEND_ENCAPSULATED_COMMAND請求 17
4.2.2 GET_ENCAPSULATED_RESPONSE請求 17
4.2.3 GET_LINE_CODING 請求 17
4.2.4 SET_LINE_CODING 請求 18
4.2.5 SET_CONTROL_LINE_STATE請求 19
4.3 數(shù)據(jù)傳輸?shù)膶崿F(xiàn) 19
4.3.1 令牌包 19
4.3.2 數(shù)據(jù)包 20
4.3.3 握手包 20
4.3.4 數(shù)據(jù)傳輸 20
4.4 INF文件的創(chuàng)建 21
4.4.2 INF文件的規(guī)范 23
4.4.3 INF文件的內(nèi)容 23
5 聯(lián)機調(diào)試 26
5.1 調(diào)試設置 26
5.2 下載調(diào)試 26
6 固件測試及結(jié)論 30
6.1 串口調(diào)試工具設置 31
6.2 數(shù)據(jù)傳輸測試 31
6.3 結(jié)論 31
參考文獻 33
致 謝 35