版權說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權,請進行舉報或認領
文檔簡介
1、<p><b> 中文3234字</b></p><p> 本科生畢業(yè)設計(論文)專業(yè)外文翻譯</p><p> 原 文:PC and single chip microcomputer serial communication design</p><p> 譯 文:關于PC機與單片機串行通信設計的實現(xiàn)</
2、p><p> 指導教師 : 職稱: 講師 </p><p> 學生姓名 : 學號: </p><p> 專 業(yè) : 電氣工程及其自動化 </p><p> 院(系) : <
3、/p><p> 2014年3月20日</p><p> PC and single chip microcomputer serial communication design</p><p> PC is the abbreviation of the Personal Computer, which can run independently, perform
4、 specific functions of the Personal Computer. Personal computer does not need to share other computer resources such as processing, disks and printer can work independently.</p><p> 1. 1. PC development bri
5、ef history</p><p> According to the logic element process change, can be divided into four stages:</p><p> Ø first generation: 1946-1958 is the vacuum tube computer. Its characteristic is
6、 that the big volume, power consumption, more slowly, but laid the foundation of computer technology. </p><p> Ø second generation: 1958-1964 is the transistor computer. Its characteristic is that the
7、volume reduction, reduce power consumption, speed, cost reduction; </p><p> Ø third generation: 1964-1971 is the integrated circuit computer, than on the characteristics of the second generation of the
8、 third generation has a larger increase; </p><p> Ø fourth generation: mass of very large scale integrated circuit computer since 1971, it from large to tiny development, cost performance is greatly im
9、proved; Ø</p><p> The fifth generation computer will develop to is.</p><p> 1.2. The PC hardware profile</p><p> Hardware is running software platform, software control hard
10、ware work to complete the scheduled tasks. First of all, let us understand the computer hardware.</p><p> 1.2.1. Central processing unit (CPU)</p><p> The CPU is the abbreviation of central pr
11、ocessing unit (CPU), it is the core computer components. CPU chip mainly contain arithmetic unit and controller. Ø unit</p><p> Arithmetic unit is used for data arithmetic operation (addition, subtract
12、ion, multiplication, division, etc.) and logic operations (comparison, shift, Boolean calculation, etc.) of the device. Data from memory in the unit operation, operation result and sent to memory, these operations are ca
13、rried out under the control of the controller. Ø controller</p><p> Controller is the command center of the computer, is used to control, accused the entire computer system automatically, continuously
14、running and coordinated work between the parts.</p><p> Single chip microcomputer hereinafter referred to as single chip microcomputer, it is the central processing unit (CPU), memory (RAM and ROM), timer/c
15、ounter, and all sorts of interface circuits are integrated into a integrated circuit chip microcomputer. With the development of computer technology, especially the single chip microcomputer technology, people have incre
16、asingly come to some industrial control system by single chip microcomputer testing and control parameters such as temperature and</p><p> Serial communication refers to the peripherals and computer use a d
17、ata line between a a transmission of data, each data occupy a fixed length of time. "Serial" refers to the way of information transmission between peripherals and interface circuit, between CPU and interface is
18、 still working in parallel way. Serial data during transmission, due to the interference may cause error information. How to find errors in the transmission, error detection; After found errors, how to eliminate the erro
19、r, </p><p> (1) serial data transmission mode</p><p> 1) double office way communication both sides can simultaneously send and receive operation.</p><p> 2) only 1 half duplex m
20、ode transferring data signals, requiring communications sent and received by the electronic switch on both sides. Because there is only one channel, so the data can't transfer in both directions at the same time.<
21、/p><p> 3) simplex mode allows only transmit data according to a fixed direction.</p><p> (2) serial communication can be divided into two types: synchronous communication and asynchronous commun
22、ication.</p><p> Asynchronous communication: a character in a character transfer, each character a a transmission, transmission of a character, begins with a start bit, and then transfer the character itsel
23、f, ladies and gentlemen, then transfer check, finally ends with a stop bit the transmission of the characters. A transfer of the start bit, characters, ladies and gentlemen, parity, stop bits, constitute a complete set o
24、f information, known as the Frame (Frame). Between the frame and the frame can have any spa</p><p> (1) a start bit is located in the character frame at the beginning, only one, for low level logic "0&
25、quot;, is used to notify the receiving device, the sender to start sending data. Character on a line without transmission should be kept as "1". Receiving end constantly check the status of a line, such as cont
26、inuous for later, "1" to a "0", know from a new character, should be ready to receive immediately.</p><p> (2) data: data bits (D0 - D7) j just behind the starting for, usually for 5 to
27、8, on the basis of data bits were transmitted from low to high order.</p><p> (3) parity check bits, parity check bits only take up one, and immediately behind the data bits used to represent the serial com
28、munication using odd parity or even check, also can use this one (I/O) to determine the nature of this character represents more information in a frame (address/data, etc.).</p><p> (4) stop bit: located in
29、 the character frame in the end, the characterization of the end of the characters, it must be a high level (logic "1"). Stop bits can be 1, 1.5 a, 2 a. On the receiving end after receiving the stop bit, know a
30、 character has been transferred, and at the same time to prepare for receiving the next character (as long as to receive a "0" is the new characters of the start bit). If stop, since is not followed by passing
31、the next character, keep on a line as "1".</p><p> Synchronous communication: synchronous transmission bit group is much larger. It is not independently send each character, each character has its
32、 own start and stop bits, but put them together to send together. We call these combined data frames, or frames for short.</p><p> This design topic research between systems, data transmission and control s
33、ystem and peripherals. Serial port in system and ACTS as a connection between peripheral tasks and in serial communications with RS485 and RS232 serial interface technology most widely used, this topic mainly studies des
34、ign of RS485 serial port, and in order to meet the RS485 communication standard MAXIM company has designed a model named MAX488 for this chip, the chip connotation is a drive and a receiver, with low power</p><
35、;p> AT89C2051 MCU when executing commands to failure, can through the chip IMP813 microcontroller reset. It can also be awaken single-chip computer from sleep mode or idle mode. In the present AT89 series single-chip
36、 microcomputer serial port communication technology in the current popular solution is to adopt RS485 interface. It takes one and two bus interface, USES a half duplex communication bus difference level of data transmiss
37、ion. Microcomputer to realize RS485 protocol communication generally</p><p> System USES AT89C51 as a machine and PC as upper machine, both through the RS - 232 serial port to send and receive data. RS - 23
38、2 signal level and single chip microcomputer serial signal level, must be between the two level transformation, system used in the integration level conversion chip MAX232 implementing RS - 232 / TTL level transformation
39、.</p><p> This design using the single chip microcomputer principle and microcomputer interface technology and so on knowledge of single chip microcomputer and PC serial communication design. There are invo
40、lved during description, serial communication system of serial communication principle, the electric standard of RS - 232 interface, level conversion method and the single chip microcomputer minimum system design related
41、 issues.</p><p> This system consists of hardware and softwareThis system consists of two parts of hardware and software coordination is complete, the hardware part mainly complete information display; Soft
42、ware mainly complete signal processing and control function, etc. System hardware design adopts modular design, AT89C51 single-chip microcomputer as the core, the serial port communication circuit of control system. Soft
43、ware design using a query and receive interrupt way to complete data, and further processin</p><p> During implementation behind also adopted, for example, and the simulation debugging, namely using Protues
44、 platform, virtual serial port software to create virtual COM port, a pair of interlinked MSC0mm software based serial debugging software tools such as PC and single chip computer serial communication system simulation.&
45、lt;/p><p> Involving the baud rate in the title, baud rate the data transfer rate, said every second transmission of binary digits, it is the unit of g bit/SEC (b/s), commonly used BPS said. Baud rate is an im
46、portant indicator of asynchronous communication, characterization data transmission speed, the higher the baud rate, the faster the speed of data transmission, the data transfer mode is determined, at a rate of about how
47、 to send/receive data, is to realize the serial communication must solve the probl</p><p> Suppose/S data transfer rate is 120 characters, each character format containing 10 code 120 character/S, x 10 / ch
48、aracter = 1200 b/S = 1200 baud.</p><p> Each transmission time for the reciprocal of baud rate: Td = 1/1200 = 0.833 ms</p><p> Asynchronous communication is according to the characters of the
49、transmission and receiving equipment as long as after receiving a start signal in a transmission time internal energy of the characters and send equipment in sync can be received correctly. The arrival of the next charac
50、ter start bit make synchronization and recalibrate.</p><p> System works in MSC - 51 microcontroller serial port to send/receive data, through the two serial buffer SBUF, automatically send characters at th
51、e end of the beginning, by the hardware (low level) combined with a start bit and stop bit (electronic) and other control bits, such as the parity bit, etc.), and then under the control of the mobile pulse, low before, a
52、nd in the high bit by bit from the TXD except way (0).</p><p> In the process of accepting, serial port to receive or not under the control of the state of permitted to accept a REN, when REN is the softwar
53、e after the "1", allows the receiver to receive. Serial receiver to 16 times the speed of the selected baud rate to monitor RXD line. When "1" to "0" jump, detector sampling to RXD line low
54、electricity at ordinary times in A row, then decided that there have start bit RXD, then receive the controller starts to work, in each transmission time 7, 8, 9 three</p><p> In the design, the function of
55、 the system consists of two parts of hardware and software coordinated, the hardware part mainly complete information display; Software mainly complete signal processing and control function, etc.</p><p> H
56、ardware mainly adopts modular design, AT89C51 single-chip microcomputer as the core, and serial port communication circuit of control system, LED display circuit display modules. The system hardware mainly includes the f
57、ollowing several modules: AT89C51 control module, LED display module, serial port communication module is mainly to complete communication between MCU and PC.</p><p> 關于PC機與單片機串行通信設計的實現(xiàn)</p><p>
58、 PC是Personal Computer的縮寫,能獨立運行、完成特定功能的個人計算機。個人計算機不需要共享其他計算機的處理、磁盤和打印機等資源也可以獨立工作。</p><p> 1. PC發(fā)展簡介史</p><p> 按照邏輯元件的工藝變化,可分為四個階段: </p><p> ? 第一代:1946年-1958年是電子管計算機
59、.其特點是,體積大,耗電多,速度慢,但奠定了計算機技朮的基礎; </p><p> ? 第二代:1958年-1964年是晶體管計算機.其特點是,體積減少,耗電減少,速度提高,成本降低; </p><p> ? 第三代:1964年-1971年是集成電路計算機,第三代在特點上比第二代有了個較大的提高; </p><p&g
60、t; ? 第四代:1971年以來的大規(guī)模超大規(guī)模集成電路計算機,它由大型向微型發(fā)展,性能價格比大大提高; ?</p><p> 第五代計算機將向光腦發(fā)展. </p><p> 1.2.PC硬件簡介 </p><p> 硬件是運行軟件的平臺,軟件控制硬件工作來完成預定任務.首先讓我們一起了解計算機硬件. <
61、;/p><p> 1.2.1.中央處理器(CPU) </p><p> CPU是中央處理器的縮寫,它是計算機核心部件。 CPU芯片主要含有運算器和控制器. ? 運算器 </p><p> 運算器是用來對于數(shù)據(jù)進行算朮運算(加、減、乘、除等)和邏輯運算(比較、移位、布爾
62、運算等)的器件.在運算器中進行運算的數(shù)據(jù)取自內(nèi)存,運算結果又送往內(nèi)存,這些操作都是在控制器的控制下進行的. ? 控制器 </p><p> 控制器是計算機的指揮中心,用來控制、指控整個計算機系統(tǒng)自動、連續(xù)地運行和各個部件之間協(xié)調(diào)一致地工作。</p><p> 單片微型計算機簡稱單片機,它是將中央處理器(CPU)、存儲器(RAM,ROM)、定時/計數(shù)器和各種
63、接口電路都集成到一塊集成電路芯片上的微型計算機。隨著計算機技術尤其是單片機技術的發(fā)展,人們已越來越多地采用單片機來對一些工業(yè)控制系統(tǒng)中如溫度、濕度等參數(shù)進行檢測和控制。PC機具有強大的監(jiān)控和管理功能,而單片機則具有快速及靈活的控制特點,通過PC機的RS 232串行接口與外部設備進行通信,是許多測控系統(tǒng)中常用的一種通信解決方案。因此如何實現(xiàn)PC機與單片機之間的通信具有非常重要的現(xiàn)實意義。針對一些遠距離控制或者是危險性比較高的數(shù)據(jù)采集和控制
64、的應用情況,本文主要介紹一種用雙工方式實現(xiàn)PC機與單片機之間的串行通信。</p><p> 所謂串行通信是指外設和計算機間使用一根數(shù)據(jù)信號線一位一位地傳輸數(shù)據(jù),每一位數(shù)據(jù)都占據(jù)一個固定的時間長度?!按小笔侵竿庠O與接口電路之間的信息傳送方式,CPU與接口之間仍按并行方式工作。串行數(shù)據(jù)在傳輸過程中,由于干擾可能引起信息的出錯。如何發(fā)現(xiàn)傳輸中的錯誤,叫檢錯;發(fā)現(xiàn)錯誤后,如何消除錯誤,叫糾錯。 (1) 串行數(shù)據(jù)傳輸
65、方式 1) 雙辦工方式通訊雙方能同時進行發(fā)送和接收操作。 2) 半雙工方式只有1根數(shù)據(jù)線傳送數(shù)據(jù)信號,要求通訊雙方的發(fā)送和接收由電子開關切換。由于只有一條信道,所以數(shù)據(jù)不能同時在兩個方向上傳送。 3) 單工方式只允許數(shù)據(jù)按照一個固定的方向傳送。(2) 串行通信可以分為兩種類型:同步通信和異步通信。</p><p> 異步通信:一個字符一個字符地傳輸,每個字符一位一位地傳輸,傳輸一個字符時,以起始位開始,
66、然后傳輸字符本身的各位,接著傳輸校驗位,最后以停止位結束該字符的傳輸。一次傳輸?shù)钠鹗嘉?、字符各位、校驗位、停止位構成一組完整的信息,稱為幀(Frame-)。幀與幀之間可有任意個空閑位。起始位之后是數(shù)據(jù)的最低位。</p><p> 起始位:位于字符幀開頭,僅占一位,為邏輯低電平“0”,用來通知接收設備,發(fā)送端開始發(fā)送數(shù)據(jù)。線路上在不傳送字符時應保持為“1”。接收端不斷檢查線路的狀態(tài),如連續(xù)為“1”以后又測到一個“
67、0”,就知道發(fā)來一個新字符,應馬上準備接收。</p><p> 數(shù)據(jù)位:數(shù)據(jù)位(D0-D7)j緊接在起始為后面,通常為5到8位,依據(jù)數(shù)據(jù)位由低到高的順序依次傳送。</p><p> 奇偶校檢位:奇偶檢驗位只占用一位,緊接在數(shù)據(jù)位后面,用來表征串行通信中采用奇校檢還是偶校檢,也可以用這一位(I/O)來確定這一幀中的字符多代表信息的性質(zhì)(地址/數(shù)據(jù)等)。</p><p&
68、gt; 停止位:位于字符幀的最后,表征字符的結束,它一定是高電平(邏輯“1”)。停止位可以是1位、1.5位、2位。接收端收到停止位后,知道上一字符已經(jīng)傳送完畢,同時也為接收下一位字符做好準備(只要再收到“0”就是新的字符的起始位)。若停止,位以后不是緊跟著傳送下一個字符,則讓線路上保持為“1”。</p><p> 同步通信:同步傳輸?shù)谋忍胤纸M要大得多。它不是獨立地發(fā)送每個字符,每個字符都有自己的開始位和停止位
69、,而是把它們組合起來一起發(fā)送。我們將這些組合稱為數(shù)據(jù)幀,或簡稱為幀。</p><p> 本設計課題主要研究系統(tǒng)之間、系統(tǒng)與外設之間的數(shù)據(jù)傳輸和控制。在系統(tǒng)與外設之間充當連接任務串口了而在串口通信技術中又以RS485和RS232串口技術應用最為廣泛,本課題主要研究設計RS485串口,而為了滿足RS485的通信標準MAXIM公司為此就設計了一款名為MAX488的芯片,該芯片內(nèi)涵一個驅(qū)動器和一個接收器,同時具有低功耗
70、、單+5V電源供電、驅(qū)動器有過載保護、無需外接元器件等特點。</p><p> AT89C2051單片機在執(zhí)行命令的時候出現(xiàn)故障,就可通過芯片IMP813將單片機復位。它也可以將單片機從休眠模式或空閑模式喚醒。在目前的AT89系列單片機的串口通信技術中目前流行的解決方案是采用RS485接口。它時一種并接式二總線的接口,采用的是半雙工通信總線的差分電平方式進行數(shù)據(jù)傳輸。微機要實現(xiàn)RS485協(xié)議通信總體上概括可以采
71、用兩種方法:第一種采用通信卡,插在微機主板擴展槽上;第二種采用RS232與RS485轉換接口裝置。</p><p> 系統(tǒng)中采用AT89C51單片機作為下位機,PC機作為上位機,兩者通過RS-232串行口收發(fā)數(shù)據(jù)。RS-232信號的電平和單片機串口信號的電平不一致,必須進行二者之間的電平轉換,系統(tǒng)中使用集成電平轉換芯片MAX232實現(xiàn)RS-232/TTL電平轉換。</p><p> 本
72、設計運用單片機原理和微機接口技術等知識探討完成單片機與PC機的串行通信設計。期間有涉及到串行通信原理的簡述、串行通信的制式、RS-232接口的電氣標準、電平轉換的方式方法和單片機最小系統(tǒng)設計等相關專業(yè)問題。</p><p> 本系統(tǒng)由硬件和軟件兩大部分協(xié)調(diào)完成,硬件部分主要完成信息的顯示;軟件主要完成信號的處理及控制功能等。系統(tǒng)的硬件設計采用模塊化設計,以AT89C51單片機為核心,串行口通信電路組成控制系統(tǒng)。
73、軟件設計部分運用查詢和中斷方式完成數(shù)據(jù)的接收,并進一步處理。</p><p> 并且,實現(xiàn)期間在后面還采用了仿真調(diào)試,即運用Protues平臺、虛擬串口軟件創(chuàng)建的一對相通的虛擬COM口、基于MSC0mm軟件的串口調(diào)試軟件等工具來仿真實現(xiàn)PC機與單片機串口通信系統(tǒng)。</p><p> 在題目中涉及了波特率,波特率即數(shù)據(jù)傳送速率,表示每秒鐘傳送二進制代碼的位數(shù),它的單位是位/秒(b/s),
74、常用bps表示。波特率是異步通信的重要指標,表征數(shù)據(jù)傳輸?shù)乃俣龋ㄌ芈试礁?,?shù)據(jù)傳輸速度越快,在數(shù)據(jù)傳送方式確定后,以多大的速率發(fā)送/接收數(shù)據(jù),是實現(xiàn)串行通信必須解決的問題。</p><p> 假設數(shù)據(jù)傳送的速率是120字符/S,每個字符格式包含10個代碼位120字符/s,×10位/字符=1200b/s=1200波特。</p><p> 每一位的傳輸時間為波特率的倒數(shù):Td=
75、1/1200=0.833ms</p><p> 異步通信是按字符傳輸?shù)?,接收設備在收到起到起始信號之后只要在一個字符的傳輸時間內(nèi)能和發(fā)送設備保持同步就能正確接收。下一個字符起始位的到來又使同步重新校準。</p><p> 系統(tǒng)的工作原理中MSC-51單片機串行口發(fā)送/接收數(shù)據(jù)時,通過2個串行緩沖器SBUF進行,由硬件自動在發(fā)送字符的始、末加上起始位(低電平)、停止位(高電子)及其它控制
76、位(如奇偶位等),而后在移動脈沖的控制下,低位在前,高位在后,逐位從TXD端(方式0除外)發(fā)出。</p><p> 在接受過程中,串行口的接收與否受制于允許接受位REN的狀態(tài),當REN被軟件置“1”后,允許接收器接收。串口的接收器以所選波特率的16倍速對RXD線進行監(jiān)視。當’’1”到“0”跳變時,檢測器連續(xù)采樣到RXD線上低電平時,便認定RXD端出現(xiàn)起始位,繼而接收控制器開始工作,在每位傳送時間的第7、8、9三
77、個脈沖狀態(tài)采樣RXD線,決定所接收的值為“0”或“1”。當接收完停止位后,指控電路使用中斷標志R1置“1”,此時程序可通過MOV A,SBUF指令將接收到的字符從SUBF送入累加器A,從而完成一幀數(shù)據(jù)的接收工作。</p><p> 在實現(xiàn)設計里面,系統(tǒng)的功能由硬件和軟件兩大部分協(xié)調(diào)完成,硬件部分主要完成信息的顯示;軟件主要完成信號的處理及控制功能等。</p><p> 硬件主要采用模
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負責。
- 6. 下載文件中如有侵權或不適當內(nèi)容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 小型pic單片機與pc機模擬串行通信【外文翻譯】
- 51單片機與pc機系統(tǒng)設計的串行口通信【外文翻譯】
- pc機與單片機串行通信課程設計
- -vc 6_0實現(xiàn)pc機與單片機的串行通信
- 畢業(yè)設計---pc機與多臺單片機串行通信設計
- 單片機串口通信課程設計-- pc和單片機的串行雙工通信
- arm系列單片機與pc機之間的串行通信
- 單片機課程設計--利用rs-232實現(xiàn)單片機與pc間的串行通信
- 單片機與pc機串口通信實現(xiàn)
- 單片機單片機課程設計-雙機串行通信
- pc機與單片機串口通信
- 雙單片機串行通信
- 單片機串行通信_485
- 單片機串行通信發(fā)射機
- 單片機串行口與pc機通訊資料
- 單片機單片機課程設計-雙機串行通信e
- 單片機串行通信發(fā)射機
- 單片機串行通信發(fā)射機
- 單片機串行通信發(fā)射機
- 實驗單片機與pc機串口通信
評論
0/150
提交評論