版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡(jiǎn)介
1、<p><b> 外文資料</b></p><p> Data Transfer Techniques</p><p> The actual transfer of data between the microcomputer and external and external devices is commonly carried out usin
2、g three different techniques:</p><p> (1)ling;(2)errupters; (3) emory access; These techniques can be used individually or in combination..</p><p><b> Polling</b></p><p&
3、gt; Polling routines are used for programmed input/output purposes.A number of peripheral devices attached to the microcomouter are continuously polled at specified time intervals to determine the device wishes to input
4、 data to the microproccssor. Similarly, for the transfer of data to an output device,the state of its buffer is checked to determine if it is empty and ready to receive the data. A soft program is required to check the s
5、tate of the peripheral devices. Hardware flaga are used to indaca</p><p> Polled input/output is very simple and common method of data transfer which does not require any additional logic circuitry.The only
6、 requirement is for an efficient program which is executed at very high speed.</p><p> Interrupted Intput/output</p><p> The polling procedure is a form of time-sharing whereby the facilities
7、of the computer are shared between a numbers of uses. The computer continually polls each of the terminals, and serves a terminal for a specified period of time before moving on to the next one. This procedure is ineffic
8、ient because system overheads are incurred in polling all the perpheral devices irrespective of the actual need. The time available for the processing of the real-time requirements of process control system in</p>
9、<p> Some real-time control applications involve the use of critical programs which must not be interrupted during their execution. Some of the interrupted are trivial which others have to be serviced. For exam
10、ple, data input can be delayed which alarms muse be raised immediately.Differernt types of interrupts, maskable and non-maskable,can be used to overcome these difficulties. Software programs are used to enable or disable
11、 a maskable interrupt. Thus,if the maskable interrupt. Thus, if the mask</p><p> The interrupt used in a microprocessor system might be a fixed interrupt or a vectored interrupt. A fixed interrupt requires
12、relatively simple hardware. The flag is set on the interrupt line to indicate that service is required. If there is only one device attached to interrupt line ,then the control will be transferred to a fixed memory locat
13、ion which provide the program for servicing that device. When a number of of devices are attached to a given interrupt line, each with its own servicing ro</p><p> Interrupts with multiple lines provide the
14、 addresses of different memory locations to which the program should transfer in response to an interrupt on a particular It would be necessary to use as many lines as the number of interrupts or resort to polling routin
15、es if more than one device is attached to the same interrupts line .</p><p> A preferred alternative is to use a vectored interrupt whereby the interrupting device is directly identifed .This device identif
16、ication can be used to to look up the starting memory location of the service routine for that device. Some vectored interrupts not only identify the interrupting device,but alse provide the starting memory location of t
17、he service routine to which the program should jump.Thus the address of the memory location, stored in the peripheral controller ,is placed on the data</p><p> A system with only one device which can interr
18、upt the normal work of the microcomputer is a very simple one and the particular interrupt can be readily serviced. In practice a large number of devices can provide interrupt requests to the microcomputer .Under normal
19、circumstances, it is likely that two or more devices may provide an interrupt request at the same time.It then becomes necessary to decide the priority to be allocated to individual interrupt request .A number of procedu
20、res can be use</p><p> Priorities can be allocated to peripherals attached to a single interrupt line by using a simple daisy chain procedure. Once interrupt, the microcomputer sends a signal to the first d
21、evice in the daisy If it is the interrupting device ,then it will provide the memory address of its service routine and the signal will not be passed on to the other way round devices in the daisy chain. If, however ,the
22、 first device did not cause the interrupt,then the massage will be passed on to the next device. </p><p> An alternative to daisy chains is to use priority interrupt circuits which identify and service the
23、device with highest priority. Level 0 means highest priority,followed by level 1, level 2 and so on. These priority interrupt circuits identify up to 8 interrupt level by means of a 3-bit code which can be inspected by t
24、he microprocessor.Since event such as power failure must be identified quickly and alarms must be raised as soon as possible, these sub-systems are attached to higher priority inte</p><p> Some of the curre
25、ntly available priority interrupt circuits carry out far more than the identification of the highest priority device which requires attention. Then will also provide the address of the memory location to which the contro
26、l should be transferred. If two interrupts occur simultaneously, the device serviced by the microcessor program has the higher priority. </p><p> Direct Memory Access </p><p> While interrupte
27、d input/output throughput rate is higher than the throughput applications requiring fast data transfering. Direct memory access (DMA) techniques bypass the central processing unit and substantially increase the data tran
28、sfer rate which can be as high as the memory cycle time allows. The other limiting factor is the speed of the peripheral device. This technique can be used to write data required at high speeds or for transfers between t
29、he memory and the mass storage devices attac</p><p> Direct memory access operation can take place in different modes. It is possible to suspend the normal operations of the microcomputer completely for the
30、 period of time during which direct memory access, operations are being carried out. In this particular type of direct memory access, the peripheral wishing to carry out high-speed data transfer informs the DMA controlle
31、r by means of an interrupt signal. The controler has to obtain control of the data and address buses before the high-speed data</p><p> Another mode of direct memory access used in large systems involves th
32、e stealing of cycles during which the microprocessor is carrying out other tasks which do not require access to the memory and the data bus is not being used. Data is trantsferred one byte at a time. The cycle steaking c
33、an be trantsparent to the microcomputer in the sense that the normal operation of the processor are not suspended. This mode of DMA operation requires that CPU and the external device must not attempt to gin ac</p>
34、<p> The vast majority of the availzble microprocessor have DMA facilities and suitable LST-based DMA controller chips are obteainable. Sophisticated systems make use of dedicated microcessor chips as DMA control
35、ers.</p><p> To summarize,the three input/output techniques discussed here have their own advantages and disadvantages, and are suitable for connecting to different types of devices.The programmed input/out
36、put is suitable for use with fast devices which are regularly providing data to the microcomputer.Interrupted input/output can be used with slow peripherals such as teletypewriters.High-speed data transfer between the me
37、mory and external storage devices,such as floppy disca,can be achieved by using direct </p><p> From Microprocessors and Their Manufacturing Application by A.K.K.ochhar and N.D.Burns </p><p>&l
38、t;b> 數(shù)據(jù)傳送指令</b></p><p> 通常,微機(jī)與外設(shè)間的數(shù)據(jù)的傳送用三種不同的方法進(jìn)行:(1)查詢;(2)中斷;(3)直接存儲(chǔ)器存儲(chǔ)。這些方法可單獨(dú)使用或組合使用。</p><p><b> 查詢</b></p><p> 查詢程序用于編程輸入/輸出目的。在規(guī)定的時(shí)間間隔內(nèi),不斷的查詢連接到各微機(jī)上的各外
39、設(shè),以便確定是否裝置要求向微處理器輸入數(shù)據(jù)。類似的,當(dāng)向輸出裝置輸出數(shù)據(jù)時(shí),要檢查該裝置緩沖器的狀態(tài),以便決定是否已空和是否準(zhǔn)備就緒接受數(shù)據(jù)。這就要求用軟件程序來檢查外設(shè)的狀態(tài)。用硬件標(biāo)志來表示外部設(shè)備的發(fā)送和接收數(shù)據(jù)。若某裝置已準(zhǔn)備好傳送數(shù)據(jù),便可用合適的軟件程序來為特定的裝置服務(wù),進(jìn)行數(shù)據(jù)傳送。確保在執(zhí)行查詢程序或任何外設(shè)的服務(wù)程序時(shí)。來自任何外設(shè)的數(shù)據(jù)都不會(huì)丟失,這是十分必要的。由于多數(shù)外設(shè)都是慢速裝置,故丟失數(shù)據(jù)的可能性很小。其
40、他方法,如直接存儲(chǔ)器存取(DMA),可用于實(shí)現(xiàn)與特定外設(shè)間的高速數(shù)據(jù)傳送。</p><p> 查詢式輸入/輸出是一種簡(jiǎn)單又常用的數(shù)據(jù)傳送法,此法不要求附加的邏輯電路。唯一的要求是要有一個(gè)高速運(yùn)行的有效程序。</p><p><b> 中斷式輸入/輸出</b></p><p> 查詢過程是分時(shí)的一種形式,靠它計(jì)算機(jī)資源可為若干用戶所共享。計(jì)
41、算機(jī)不斷的查詢每個(gè)終端,在轉(zhuǎn)至下一個(gè)終端之前,為某一個(gè)終端服務(wù)一段特定的時(shí)間。這種方法效率不高,因?yàn)椴还軐?shí)際是否需要便去查詢?nèi)客庠O(shè),導(dǎo)致系統(tǒng)開銷增大??晒﹫?zhí)行的指令的時(shí)間將顯著減少。此外,要對(duì)過程控制系統(tǒng)的實(shí)時(shí)要求做出相應(yīng),也是不可能的。在過程控制中,當(dāng)處理器正在為某一個(gè)輸入/輸出裝置服務(wù)時(shí),另一特定裝置可能要求緊急服務(wù)。在某些情況下,實(shí)際數(shù)據(jù)就可能被失。應(yīng)用硬件中斷輸入/輸出系統(tǒng)便可克服這些缺點(diǎn)。利用這些中斷,微機(jī)系統(tǒng)的輸出就可得到
42、明顯的提高,因?yàn)檩斎?輸出裝置僅在它表示了已經(jīng)準(zhǔn)備好發(fā)送和接收數(shù)據(jù)之后,才被服務(wù)。任何時(shí)刻都可能有輸入/輸出請(qǐng)求,也就是說是一種異步方式,有關(guān)裝置通過將中斷標(biāo)志置1,來表示申請(qǐng)中斷。微處理器響應(yīng)中斷,完成現(xiàn)行指令的執(zhí)行,保存好寄存器的內(nèi)容,然后通過把控制轉(zhuǎn)至合適的輸入/輸出程序,來表示發(fā)出中斷請(qǐng)求的裝置服務(wù)。一旦完成對(duì)外設(shè)的服務(wù),微處理器便將中斷請(qǐng)示標(biāo)志復(fù)位,以表示該裝置已被服務(wù),控制轉(zhuǎn)回到原程序,并從它被中斷的地方重新執(zhí)行。</
43、p><p> 某些實(shí)時(shí)控制要用到一些執(zhí)行時(shí)決不允許中斷的關(guān)鍵程序。有些中斷請(qǐng)求是無關(guān)緊要的,而另一些則是務(wù)必要給予響應(yīng)的。例如,數(shù)據(jù)輸入可以推遲,而報(bào)警就必須立即響應(yīng)。不同類型的中斷(可屏蔽及不可屏蔽中斷)便可用來克服這些困難。用軟件程序來開或關(guān)可屏蔽中斷。于是,若可屏蔽中斷已被關(guān)閉,微處理器將不響應(yīng)中斷請(qǐng)求。微處理器對(duì)非屏蔽中斷請(qǐng)求必須響應(yīng),并為其服務(wù)。</p><p> 微機(jī)系統(tǒng)中應(yīng)用
44、的中斷可能是固定中斷,也可能是向量中斷。固定中斷要求相對(duì)簡(jiǎn)單的硬件。中斷請(qǐng)求線置1,就表示裝置有中斷請(qǐng)求。如果只有一個(gè)裝置連至中斷線,那么控制將轉(zhuǎn)至提供為該裝置服務(wù)的程序固定存儲(chǔ)單元。若多個(gè)裝置連至給定的中斷線,而每個(gè)裝置均有自己的中斷服務(wù)程序,那么就必須得識(shí)別發(fā)出中斷的外設(shè)。為此,必須用查詢程序判斷出要求服務(wù)的外設(shè),然后確定為該外設(shè)服務(wù)的程序的起始地址。多中斷線便可用來克服這些困難。</p><p> 具有多
45、條中斷線的中斷請(qǐng)求提供為響應(yīng)某一特定中斷線的中斷請(qǐng)求,程序所應(yīng)轉(zhuǎn)至的不同存儲(chǔ)單元。如果一個(gè)以上的裝置連接至同一根中斷請(qǐng)求線,那就有必要使用與中斷裝置數(shù)目相同的中斷線數(shù)或者采用查詢程序。</p><p> 另一種辦法是使用能直接鑒別中斷裝置的中斷向量,這種中斷裝置鑒別法可用來為發(fā)出中斷的裝置查出其服務(wù)程序的起始地址。有些中斷向量不僅能鑒別中斷裝置,還能提供程序應(yīng)跳至的服務(wù)的起始地址。為此,保存在外設(shè)控制器中的存儲(chǔ)
46、單元的地址要放到數(shù)據(jù)總線上去,并用來傳送控制。</p><p> 只有一個(gè)能中斷微機(jī)正常工作的裝置的系統(tǒng),是很簡(jiǎn)單的系統(tǒng)。該特定中斷很容易得到服務(wù)。實(shí)際上,大量的裝置都可能向微機(jī)發(fā)出中斷請(qǐng)求。在正常的情況下,很可能兩個(gè)或更多的裝置同時(shí)提出中斷請(qǐng)求。于是,就有必要確定分配給每個(gè)中斷請(qǐng)求的優(yōu)先權(quán)。優(yōu)先權(quán)分配有多種方法。</p><p> 利用簡(jiǎn)單的菊花鏈方法,可將中斷優(yōu)先權(quán)分配給連至單一中
47、斷線上的多個(gè)外部設(shè)備。一旦有中斷請(qǐng)求,微機(jī)便給菊花鏈中的第一個(gè)裝置發(fā)出一個(gè)信號(hào)。若中斷是該裝置發(fā)出的,它將提供其中斷服務(wù)的地址。該信號(hào)便不傳至菊花鏈中其他的裝置。可是,如果中斷不是第一個(gè)裝置發(fā)出的,那么該信號(hào)將被傳至下一個(gè)裝置。這一過程是一直重復(fù)到發(fā)出中斷申請(qǐng)的裝置被找到為止。很明顯,菊花鏈中的第一個(gè)位置具有最高優(yōu)先權(quán),其次是第二個(gè),等等。一旦某中斷請(qǐng)求得以響應(yīng),并正在被服務(wù),所有其他中斷請(qǐng)求要么被關(guān)閉,要么必須允許優(yōu)先權(quán)高的中斷去中斷
48、正在執(zhí)行的服務(wù)程序。</p><p> 替代菊花鏈的另一方法是利用優(yōu)先權(quán)中斷電路,該電路能鑒別并為優(yōu)先權(quán)最高的裝置服務(wù)。級(jí)別0表示優(yōu)先權(quán)最高,隨后的是級(jí)別1,2等等。這些優(yōu)先權(quán)中斷電路通過微處理器檢查3位碼,便可鑒別高達(dá)8級(jí)的中斷。由于像斷電這樣的事件務(wù)必很快的鑒別,并且要盡快報(bào)警,這類子系統(tǒng)就要連結(jié)在中斷優(yōu)先權(quán)較高的地方。類似地,其他要求快速響應(yīng)的外設(shè),要比低速外設(shè)配以較高的優(yōu)先權(quán)。有供序員選擇性的屏蔽一級(jí)或
49、多級(jí)的方法。若某中斷請(qǐng)求正在服務(wù)時(shí),發(fā)生另一個(gè)中斷請(qǐng)求,那么這個(gè)新中斷請(qǐng)求的優(yōu)先權(quán)要與先行中斷的優(yōu)先權(quán)進(jìn)行比較。允許優(yōu)先權(quán)較高的中斷終止現(xiàn)行的中斷服務(wù),優(yōu)先權(quán)較低的中斷要一直等到優(yōu)先權(quán)較高的中斷被服務(wù)完之后。</p><p> 某些現(xiàn)有的中斷優(yōu)先權(quán)電路遠(yuǎn)不止完成對(duì)優(yōu)先權(quán)最高的中斷的鑒別,它們還提供控制應(yīng)轉(zhuǎn)至的存儲(chǔ)單元的地址。若同時(shí)出現(xiàn)兩個(gè)中斷請(qǐng)求,微機(jī)程序所服務(wù)的裝置將具有較高的優(yōu)先權(quán)。</p>
50、<p><b> 直接存儲(chǔ)器存儲(chǔ)</b></p><p> 盡管中斷式輸入/輸出的吞吐率高于查詢法,但還是不能滿足許多高速數(shù)據(jù)傳送應(yīng)用的要求,直接存儲(chǔ)器存取(DMA)技術(shù)不使用CPU,顯著的提高了數(shù)據(jù)傳送速率,其速度高達(dá)存儲(chǔ)器周期所能接受的速度。另一個(gè)制約因素是外設(shè)的速度。DMA技術(shù)用于要求高速的向存儲(chǔ)器寫入數(shù)據(jù)或在存儲(chǔ)器連至微機(jī)的海量存儲(chǔ)器裝置間進(jìn)行數(shù)據(jù)傳送。DMA要求在存儲(chǔ)
51、器與合適的外設(shè)間進(jìn)行數(shù)據(jù)傳送時(shí),把全部裝置(而非僅只用于數(shù)據(jù)傳送的那哥裝置)都從存儲(chǔ)器分離出來。專用的DMA控制器可用來實(shí)現(xiàn)這種高速的數(shù)據(jù)塊傳送。DMA控制器使用地址總線和數(shù)據(jù)總線進(jìn)行數(shù)據(jù)傳送。</p><p> DMA操作可用不同方式進(jìn)行。在DMA操作期間,完全中至微處理器的正常操作是可能的。在這種特定類型的DMA操作中,希望進(jìn)行高速數(shù)據(jù)傳送的外設(shè)用中斷信號(hào)通知DMA控制器。在進(jìn)行高速數(shù)據(jù)傳送之前,控制器必須
52、獲得對(duì)數(shù)據(jù)和地址總線的控制。這是通過對(duì)微處理器發(fā)出HOLD信號(hào)實(shí)現(xiàn)的,微處理器在執(zhí)行完現(xiàn)行指令后,暫停它的操作。把數(shù)據(jù)和地址總線的控制轉(zhuǎn)給DMA控制器,數(shù)據(jù)塊的起始單元地址以及欲傳送的字?jǐn)?shù)要賦給DMA控制器。然后,數(shù)據(jù)便在存儲(chǔ)器和外設(shè)之間進(jìn)行傳送。在數(shù)據(jù)傳送期間,微處理器不進(jìn)行任何其他的操作。這類被稱為可見的或噴發(fā)式的DMA操作,其速度相當(dāng)高,常用與微機(jī)系統(tǒng)。但是,微處理器的操作速度卻被降低了。</p><p>
53、 另一種用于大系統(tǒng)的DMA方式,采用機(jī)器周期挪用。在周期挪用期間,微處理器執(zhí)行不涉及存儲(chǔ)器訪問和使用數(shù)據(jù)總線的其他任務(wù)。每次傳送一個(gè)字節(jié)。從處理器的正常操作未被中止的意義上講,周期挪用對(duì)微機(jī)而言是透明的。這種方式的DMA操作,要求CPU和外部器件絕不能試圖同時(shí)訪問存儲(chǔ)器。</p><p> 絕大多數(shù)已有的微處理器都有DMA功能,并且合適的基于大規(guī)模集成電路的DMA控制芯片也是可以買到的。復(fù)雜系統(tǒng)用專用微處理器
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 眾賞文庫僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
- 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。
最新文檔
- mcgs數(shù)據(jù)采集單片機(jī)數(shù)據(jù)傳送的設(shè)計(jì)
- mcgs數(shù)據(jù)采集單片機(jī)數(shù)據(jù)傳送的設(shè)計(jì)資料
- 單片機(jī)畢業(yè)設(shè)計(jì)外文翻譯
- 計(jì)算機(jī)專業(yè)畢業(yè)論文外文翻譯--數(shù)據(jù)傳送指令
- 單片機(jī)畢業(yè)設(shè)計(jì)外文翻譯7
- 單片機(jī)畢業(yè)設(shè)計(jì)外文翻譯9
- 單片機(jī)基礎(chǔ)畢業(yè)設(shè)計(jì)外文翻譯
- 單片機(jī)畢業(yè)設(shè)計(jì)外文翻譯1
- 單片機(jī)畢業(yè)設(shè)計(jì)外文翻譯-- pic系列單片機(jī)的特點(diǎn)
- 單片機(jī)畢業(yè)設(shè)計(jì)外文翻譯單片機(jī)at89c51
- 單片機(jī)畢業(yè)設(shè)計(jì)外文文獻(xiàn)翻譯
- 基于單片機(jī)的無線數(shù)據(jù)傳輸模塊畢業(yè)設(shè)計(jì)
- 畢業(yè)設(shè)計(jì)--單片機(jī)畢業(yè)設(shè)計(jì)溫度控制(外文翻譯)
- 單片機(jī)數(shù)據(jù)采集畢業(yè)設(shè)計(jì)
- 單片機(jī)遙控系統(tǒng)畢業(yè)設(shè)計(jì)(含外文翻譯)
- 單片機(jī)畢業(yè)外文翻譯
- 畢業(yè)設(shè)計(jì)--基于avr單片機(jī)的數(shù)據(jù)采集系統(tǒng)設(shè)計(jì)(含外文翻譯)
- 單片機(jī)畢業(yè)設(shè)計(jì)--基于單片機(jī)的智能恒溫箱設(shè)計(jì)(含外文翻譯)
- 單片機(jī)畢業(yè)設(shè)計(jì)英文翻譯--單片機(jī)的組成
- 單片機(jī)畢業(yè)設(shè)計(jì)外文翻譯--at89s52
評(píng)論
0/150
提交評(píng)論