【正文】
器的輸出。當(dāng)振蕩器正在運(yùn)行時(shí),持續(xù)給出 RST 引 腳兩個(gè)機(jī)器周期的高電平便可完成復(fù)位。一般作為擴(kuò)展時(shí)地址總線的高 8 位復(fù)用口。一般作為擴(kuò)展時(shí)的地址/數(shù)據(jù)總線口使用。 ② GND:電路地。使得 STC89C52 為眾多控制應(yīng)用系統(tǒng)提供高靈活、超有效的解決方案。在大批量使用時(shí)有可觀的經(jīng)濟(jì)效益和可靠性效益。 雖然單片機(jī)對(duì)運(yùn)行速度要求遠(yuǎn)不如通用計(jì)算機(jī)系統(tǒng)或數(shù)字信號(hào)處理對(duì)指令運(yùn)行速度的要求,但速度的提高會(huì)帶來(lái)許多好處,并拓寬單片機(jī)應(yīng)用領(lǐng)域。 單片機(jī)發(fā)展概況及發(fā)展方向 單片機(jī)的出現(xiàn)使現(xiàn)代科學(xué)技術(shù)研究得到了質(zhì)的飛躍,可以毫不夸張地說(shuō),它給現(xiàn)代工業(yè)領(lǐng)域帶來(lái)了一次新的技術(shù)革命。 三江學(xué)院 2020屆本科生畢業(yè)設(shè)計(jì)(論文) 6 第 3 章 系統(tǒng)硬件設(shè)計(jì) STC89C52 單片機(jī)簡(jiǎn)介及最小系統(tǒng) 隨著電子技術(shù)的迅速發(fā)展,特別是隨著大規(guī)模集成電路產(chǎn)生而出現(xiàn)的微型計(jì)算機(jī),給人類(lèi)生活帶來(lái)了根本性的改變。 IRP 是由操作系統(tǒng)定義的,而 USB 傳輸與總線操作是 USB規(guī)范定義的。 三、 USB 連接(數(shù)據(jù)流) USB 連接實(shí)際上是指 USB 器件和 USB 主機(jī)連接并進(jìn)行通信的方法,它可以將存在于 USB 主機(jī)和 USB 設(shè)備之間的 USB 數(shù)據(jù)傳輸模型描述為一個(gè)管道( pipe),管道只是一個(gè)邏輯上的概念。 ( 2)用于內(nèi)存特征字,存儲(chǔ)實(shí)現(xiàn)外設(shè)特殊功能程序及廠家信 息的協(xié)議 ROM( 3)用于實(shí)現(xiàn)外設(shè)功能的傳感器及對(duì)資料進(jìn)行簡(jiǎn)單處理的 DSP 部分( 4)將外設(shè)連接到主機(jī)或 USB Hub 的接口部分。 USB 設(shè)備是實(shí)現(xiàn)某種具體功能的硬件設(shè)備,如鍵盤(pán),鼠標(biāo)和攝像頭等。 軟 件部分分為三部分,分別是: 1. USB 設(shè)備驅(qū)動(dòng)程序( USB Device Drivers)通過(guò) I/O 請(qǐng)求包發(fā)出給 USB 設(shè)備的請(qǐng)求,而這些 I/O 請(qǐng)求包則完成對(duì)目標(biāo)設(shè)備傳輸?shù)脑O(shè)置。 一、 USB 宿主 USB 宿主( host)是一個(gè)帶有 USB 主控制器的 PC 機(jī)或者嵌入式系統(tǒng),在 USB 系統(tǒng)中只有一個(gè)宿主,它是 USB 系統(tǒng)的主控者。 ( 3) 480 Mbit/s (57 MByte/s)的高速速率。 ( 1) Mbit/s (183 KByte/s) 的低速速率,主要用于人機(jī)接口設(shè)備( Human Interface 三江學(xué)院 2020屆本科生畢業(yè)設(shè)計(jì)(論文) 4 Devices , HID)例如鍵盤(pán)、鼠標(biāo)、游戲桿。復(fù)位電路是保證系統(tǒng)安全運(yùn)行的基礎(chǔ),由于單片機(jī)的運(yùn)行環(huán)境無(wú)法確定,無(wú)法保證單片機(jī)在長(zhǎng)時(shí)間的運(yùn)行過(guò)程中能夠一直保證系統(tǒng)的穩(wěn)定性,復(fù)位電路就是在單片機(jī)無(wú)法正常運(yùn)行后,軟復(fù)位無(wú)法進(jìn)行復(fù)位的情況下,能夠保證系統(tǒng)能夠重新啟動(dòng) USB技術(shù)指標(biāo) USB 最大的特點(diǎn)是支持熱插拔( Hot plug)和即插即用 (Plugamp。缺少一個(gè)雙向、價(jià)廉、與外設(shè)連接的中低速的總線,限制了外圍設(shè)備 (如電話 /電傳 /調(diào)制解調(diào)器的適配器、掃描儀、鍵盤(pán)、 PDA)的開(kāi)發(fā)。 二、易用性 眾所周知 , PC 機(jī)的改裝是極不靈活的。 USB 使用四種數(shù)據(jù)傳輸方式:控制傳輸( control)、中斷傳輸( interrupt)、批量傳輸( bulk)及等時(shí)傳輸( isochronous)。典型產(chǎn)品有 Philips公司的 PDIUSBD11( I2C接口)、PDIUSBD12(并行接口), NS公 司的 USBN9603/9604(并行接口), NetChip公司的 三江學(xué)院 2020屆本科生畢業(yè)設(shè)計(jì)(論文) 2 NET2888 等。目前,市場(chǎng)上供應(yīng)的 USB控制器主要有兩種:帶 USB接口的單片機(jī)( MCU)或純粹的USB接口芯片。易于使用還表現(xiàn)在 USB接口支持熱插拔,并且所有的配置過(guò)程都由系統(tǒng)自動(dòng)完成,無(wú)需用戶干預(yù)。局局域 中用得最多的是以太網(wǎng)接口,速度可達(dá) 100Mbps,當(dāng)使用光纖傳輸時(shí),速度可達(dá)1000Mbps。串行接口出現(xiàn)最早,使用最廣的 RS232接口,但其速度太慢,現(xiàn)在已經(jīng)逐漸被淘汰。 關(guān)鍵詞 : USB; D12; PC VI Abstract With the rapid development of puter technology and multimedia technology constantly updated, traditional puter peripheral interface because there are many shortings have been unable to meet the development needs of the to traditional AT, PS / 2, serial, Universal Serial Bus USB, with fast, flexible and easy to use, easy to expand, support Plug and Play, a series of advantages, such as low cost, has been widely used. This paper describes the 51 series and USB related content, detailing some of the features of the system design, including hardware and software debugging a simple serial munication circuit, through the serial port debugging assistant master USB transfer instructions, which designed the entire program has played a significant role in smallest singlechip system consisting of analog keyboard with a USB keyboard hardware system, by learning and exploration D12 chips, with the support of its basic mand interface, in conjunction with the corresponding hardware firmware design, making it in the USB protocol, USB module data munication with the PC, the USB keyboard to plete the functional simulation. This paper summarizes research work has elaborated the principle of the USB bus, the system is designed to require the analysis, ponents and solutions based on the specific requirements of the selected programming for the system to achieve the function of the relevant chips are described in detail in the hardware part of the design as well as the principle of Figure. Keywords:USB; D12; PC 目 錄 第一章 緒 論 ............................................... 1 PC 接口簡(jiǎn)介 ...................................................... 1 USB 接口分析 .................................................... 1 USB 器件的選擇 .................................................. 1 第二章 系統(tǒng)分析 ............................................. 3 USB 總線簡(jiǎn)介 ..................................................... 3 USB 技術(shù)指標(biāo) ..................................................... 3 USB 系統(tǒng)構(gòu)成 ..................................................... 4 第 3 章 系統(tǒng)硬件設(shè)計(jì) ......................................... 6 STC89C52 單片機(jī)簡(jiǎn)介及最小系統(tǒng) .................................... 6 單片機(jī)發(fā)展概況及發(fā)展方向 .................................... 6 單片機(jī)特點(diǎn)及結(jié)構(gòu) ............................................ 6 復(fù)位電路設(shè)計(jì) ................................................ 8 單片機(jī)最小系統(tǒng)硬件設(shè)計(jì) ...................................... 9 PDIUSBD12 接口芯片設(shè)計(jì) .......................................... 9 USB 接口芯片簡(jiǎn)介 ............................................ 9 USB 接口芯片引腳配置 ....................................... 11 USB 接口芯片硬件設(shè)計(jì) ....................................... 14 USB 接口芯片端點(diǎn)描述 ....................................... 14 USB 接口芯片命令 ........................................... 16 USB 鍵盤(pán)硬件設(shè)計(jì) ................................................ 18 第 4 章 系統(tǒng)軟件設(shè)計(jì) ........................................ 19 固件編程的實(shí)現(xiàn) .................................................. 20 USB 接口芯片工作流程圖 ..................................... 20 PDIUSBD12 命令接口 ........................ 21 USB 中斷服務(wù)程序 .............................. 21 按鍵處理流程圖 ............................................. 21 USB 鍵盤(pán)處理程序 .................................. 22 USB 主循環(huán)程序 .................................. 23 實(shí)物演示 ........................................................ 25 結(jié)束語(yǔ) ...................................................... 27 致 謝 ...................................................... 28 參考文獻(xiàn) .................................................... 29 附錄 A ...................................................... 30 附錄 B ...................................................... 37 三江學(xué)院 2020屆本科生畢業(yè)設(shè)計(jì)(論文) 1 第一章 緒 論 PC接口簡(jiǎn)介 PC中的接口有兩類(lèi):串行接口和并行接口。 本論文闡述了 51 系列單片機(jī)和 USB 的相關(guān)內(nèi)容,詳細(xì)介紹了系統(tǒng)的一些功能設(shè)計(jì),包括硬件設(shè)計(jì)和軟件設(shè)計(jì)。 :任務(wù)書(shū)、