單片機(jī)外文翻譯--51單片機(jī)在編程電路中的應(yīng)用_第1頁
已閱讀1頁,還剩17頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡介

1、<p>  中文4840字,3100單詞,16700英文字符</p><p>  畢業(yè)設(shè)計(jì)(論文)外文資料翻譯</p><p><b>  一、譯文</b></p><p>  51單片機(jī)在編程電路中的應(yīng)用</p><p>  T. Islam, S. Ghosh, H. Saha</p><

2、;p>  本應(yīng)用指南說明了Atmel AT89C51是可在線可編程的微控制器。它為電路編程提出了相應(yīng)的例子,程序的修改需要在線編程的支持。這類顯示方法在應(yīng)用程序中的AT89C51單片機(jī)可通過電話線遠(yuǎn)程控制。該應(yīng)用指南所描述的電路只支持5v電壓下編程。此應(yīng)用軟件可以到Atmel進(jìn)行下載。</p><p><b>  總論</b></p><p>  當(dāng)不在進(jìn)行程序

3、設(shè)計(jì)的時(shí)候,在電路設(shè)計(jì)中的AT89C51設(shè)計(jì)將變得透明化。</p><p>  在編程期間必須重視EA/VPP這一腳。在不使用外部程序存儲(chǔ)器的應(yīng)用程序中,這腳可能會(huì)永久接到VCC。應(yīng)用程序使用的外部程序存儲(chǔ)器要求這一腳為低電平才能正常運(yùn)行。</p><p>  RST在編程期間必須為高電平。應(yīng)該提供一種方法使得電路通入電源以后,使RST代替主要的復(fù)位電路起到復(fù)位的作用 。</p>

4、;<p>  在編程過程中,PSEN必須保持低電平,在正常運(yùn)行期間絕不能使用。</p><p>  ALE/ PROG在編程過程中輸出低電平,在正常運(yùn)行期間絕不能使用。</p><p>  在編程過程中,AT89C51的I / O端口是用于模式應(yīng)用程序,地址和數(shù)據(jù)選擇的,可能需要該控制器從應(yīng)用的電路隔離。如何做到這一點(diǎn)取決于應(yīng)用程序。</p><p>

5、<b>  輸入端口</b></p><p>  在編程過程中,控制器必須與應(yīng)用電路的信號(hào)來源隔離。帶有三個(gè)輸出狀態(tài)的緩沖區(qū)會(huì)在應(yīng)用程序之間插入電路和控制器,同時(shí)在編程時(shí)緩沖區(qū)輸出三種狀態(tài)。一個(gè)多路復(fù)用器可用于信號(hào)源之間進(jìn)行選擇,適用于任何一方的應(yīng)用電路或編程控制器電路的信號(hào)。</p><p><b>  輸出端口</b></p>

6、<p>  如果應(yīng)用的電路可以允許端口在編程過程中的狀態(tài)變化,則不需要改變電路。如果應(yīng)用電路的狀態(tài),必須事先在編程過程中的保持不變,可能在控制器和應(yīng)用電路中插入鎖存。鎖存在編程期間是可用的,并保存應(yīng)用程序的電路狀態(tài)。</p><p><b>  應(yīng)用實(shí)例 </b></p><p>  應(yīng)用是該AT89C51一個(gè)移動(dòng)的顯示情況。此應(yīng)用程序有在電路重新編程時(shí)

7、將結(jié)果以圖表的形式顯示的簡單能力。文本顯示被設(shè)計(jì)作為其硬件的一部分,不能在無改編情況下變化。</p><p>  顯示的文本可在4位DIP開關(guān)選擇兩種模式之一中進(jìn)行。在第一種模式的時(shí)候,進(jìn)入一個(gè)字符從右邊顯示和快速移動(dòng),通過每個(gè)元素顯示其在最后的裝配位置的左側(cè)。在</p><p>  第二個(gè)模式,信息在信息窗口中右到左移動(dòng)顯示。這種模式與常常在股票價(jià)格的顯示器所使用的方法類似。</p

8、><p>  輸出包括四個(gè)DL1414T,4位17段的積分解碼器和驅(qū)動(dòng)程序的字母數(shù)字顯示器。這就產(chǎn)生了16名顯示元素,每個(gè)數(shù)字有0-9的顯示能力,是大寫字母,標(biāo)點(diǎn)符號(hào)和一些字符??娠@示字符的ASCII 碼,范圍為20H-5FH。上電復(fù)位電路和一個(gè)6 MHz的晶體振蕩器完成應(yīng)用軟件程序。無論外部程序存儲(chǔ)器或外部數(shù)據(jù)存儲(chǔ)器都時(shí)可用的。</p><p>  支持應(yīng)用程序的修改 </p&

9、gt;<p>  據(jù)推測,編程器在休眠時(shí),既不會(huì)驅(qū)動(dòng),也不會(huì)加載應(yīng)用程序。由于應(yīng)用程序不使用外部程序存儲(chǔ)器,EA/VPP腳接VCC電源。復(fù)位電路被兩種轉(zhuǎn)換器改變狀態(tài),此轉(zhuǎn)換器允許編程時(shí)RST接高電平。在基本應(yīng)用時(shí)未使用的PSEN和ALE/ PROG,是被程序員直接控制的。</p><p>  編程器的編程需要獲得所有數(shù)據(jù)表中記錄的AT89C51的I / O端口。編程器是與那些應(yīng)用程序未使用的控制器的

10、引腳相連的,而這些應(yīng)用程序的引腳需要最低有效位的四所產(chǎn)生的地址是可獲得的,如下段所述。</p><p>  由編程器生成的最小的四位地址是與DIP轉(zhuǎn)換的數(shù)據(jù)在控制器的端口多路復(fù)用的</p><p>  請(qǐng)注意,加在開關(guān)上的四個(gè)電阻在基本應(yīng)用中并不是必須的,因?yàn)锳T89C51的端口上提供一個(gè)內(nèi)部上拉電阻。</p><p>  在應(yīng)用程序的正常運(yùn)作時(shí),控制器端口0,1個(gè)

11、分別在顯示器上提供數(shù)據(jù)和控制信號(hào)。在編程和程序驗(yàn)證時(shí),編程受端口0和端口2的一部分控制。程序設(shè)計(jì)器連接端口0和1,沒有緩沖,因?yàn)?,在不活?dòng)時(shí),它的存在不影響應(yīng)用程序的正常運(yùn)作。</p><p>  透明鎖存器被加在了控制器的兩個(gè)端口之間做輸入控制。鎖存持有的顯示控制信號(hào)在編程過程中不反應(yīng),從而消除端口0和2由于程序控制器的活動(dòng)造成操作失誤。顯示數(shù)據(jù)輸入是不能被孤立的,因?yàn)閿?shù)據(jù)應(yīng)用到輸入被忽略時(shí),控制信號(hào)無效。&l

12、t;/p><p>  AT89C51單片機(jī)復(fù)位電路,輸入多路復(fù)用器和輸出鎖存器是由程序控制器生成一個(gè)單一的信號(hào)來控制的。在編程過程中,復(fù)位鍵生效,多路開關(guān)信號(hào)輸入,以及凍結(jié)顯示鎖存控制線。</p><p>  為確??刂凭€顯示在已知的狀態(tài)前鎖定,AT89C51的外部中斷是用來允許程序控制器在復(fù)位之前向應(yīng)用程序發(fā)出信號(hào)。應(yīng)用程序固件響應(yīng)中斷顯示一條消息,關(guān)閉顯示控制線。</p>&

13、lt;p>  編程后,當(dāng)復(fù)位生效,當(dāng)鎖存可視控制器端口輸出高電平。由于顯示控制輸入不為高電平,直到新的程序?qū)懭腼@示器內(nèi)部不被打亂。雖然這個(gè)應(yīng)用程序是沒有必要的,它可能在某些應(yīng)用中必須指出,在編程過程中不會(huì)擾亂外圍電路的狀態(tài)</p><p><b>  程序控制器</b></p><p>  程序控制器生成的地址,數(shù)據(jù)和控制信號(hào),對(duì)嵌入到程序中的AT89C51有重

14、要作用。</p><p>  程序控制器電路由一個(gè)AT89C51和一個(gè)RS - 232電平轉(zhuǎn)換器組成。該控制器運(yùn)行在11.0592兆HZ,此頻率允許串口運(yùn)行在一個(gè)標(biāo)準(zhǔn)波特率下。一個(gè)MAXIM MAX232線路驅(qū)動(dòng)器/接收器產(chǎn)生RS - 232水平,而只需要5伏的電源系統(tǒng)。</p><p>  程序控制器所產(chǎn)生的信號(hào)許多只需直接連接到AT89C51,無需緩沖。這些信號(hào),在不活動(dòng)時(shí),不再是三種

15、狀態(tài),但被接高電平。AT89C51的端口1,2,3內(nèi)部有大約3000歐姆的上拉電阻,因?yàn)槎丝?沒有內(nèi)部上拉電阻,所以外部10千歐姆的上拉電阻已經(jīng)加上允許適當(dāng)?shù)某绦蛘J(rèn)證模式操作。示例應(yīng)用程序在這種環(huán)境下可正常運(yùn)行。如果有需要的應(yīng)用程序兼容性,程序發(fā)出的信號(hào)可能在類似74xx125三態(tài)緩沖緩沖區(qū)內(nèi)緩沖。</p><p>  AT89C51的程序不使用外部程序或數(shù)據(jù)存儲(chǔ)器,這需要犧牲所需要的I / O引腳。這就要求程序

16、代碼和I / O緩沖區(qū)保持足夠小以適合片上存儲(chǔ)器。</p><p>  商業(yè)電話線遠(yuǎn)程編程 </p><p>  編程器和前面描述的顯示應(yīng)用是與通過調(diào)制解調(diào)器連接在遠(yuǎn)程站點(diǎn)電話線相連的。使用鏈接調(diào)制解調(diào)器的個(gè)人電腦,用戶可以上傳包含一個(gè)新的消息的程序,這個(gè)信息被變成進(jìn)了嵌入到應(yīng)用程序的AT89C51中。當(dāng)編程完成后,應(yīng)用程序執(zhí)行新的程序,它顯示新信息。</p><

17、;p><b>  本地配置</b></p><p>  測試配置的本地配置包括一臺(tái)IBM個(gè)人電腦級(jí)的計(jì)算機(jī)連接到與Hayes兼容的,普羅米修斯1200波特的調(diào)制解調(diào)器。選擇此調(diào)制解調(diào)器,因?yàn)樗橇畠r(jià)可得。更快的調(diào)制解調(diào)器如果需要的話可使用更快速的調(diào)制解調(diào)器,盡管一旦該文件的傳輸時(shí)間低于1分鐘,進(jìn)一步削減的傳輸時(shí)間不會(huì)進(jìn)一步降低連接時(shí)間費(fèi)用。更高的傳輸速度的可能優(yōu)勢是在某些高速調(diào)制解調(diào)器

18、內(nèi)的自動(dòng)錯(cuò)誤檢測和糾正。</p><p>  Procomm Plus版本2.01,是一個(gè)商業(yè)數(shù)據(jù)通信軟件包,用于配置調(diào)制解調(diào)器,建立通訊設(shè)置參數(shù),并建立與遠(yuǎn)程調(diào)制解調(diào)器的鏈接。 Procomm Plus包括所謂的宏語言方面,它允許用戶編寫實(shí)現(xiàn)自定義的文件傳輸協(xié)議的腳本。一個(gè)簡單的腳本編寫用來讀取一個(gè)程序文件的內(nèi)容,并上傳到遠(yuǎn)程編程器 。</p><p>  文件傳輸協(xié)議(FTP)的實(shí)施

19、,是一個(gè)簡單的發(fā)送和等待的,數(shù)據(jù)包導(dǎo)向的協(xié)議。FTP模式發(fā)送和接收的是用數(shù)字4和5,如流程圖所示。不在流程控制下發(fā)射器發(fā)送每個(gè)數(shù)據(jù)包,并等待響應(yīng)。</p><p>  在計(jì)算校驗(yàn)和時(shí)那個(gè)程序控制器(接收器)讀取并剖析了數(shù)據(jù)包。如果計(jì)算出的校驗(yàn)和是有效的,程序員通過發(fā)送一個(gè)ACK承認(rèn)此數(shù)據(jù)包。如果校驗(yàn)和錯(cuò)誤,程序員通過發(fā)送一個(gè)NAK來否定。當(dāng)接收一個(gè)ACK后,發(fā)射器發(fā)送下一個(gè)數(shù)據(jù)包。如果傳送者接收到NAK,它重新發(fā)

20、送相同的數(shù)據(jù)包。以這種方式傳輸,直到整個(gè)文件已被移交。</p><p>  程序控制器可能通過發(fā)送一個(gè)CAN來響應(yīng)數(shù)據(jù)包,CAN表明一個(gè)不可恢復(fù)的錯(cuò)誤發(fā)生,而發(fā)射機(jī)應(yīng)立即中止文件傳輸。如果程序員沒有在有限的時(shí)間內(nèi)響應(yīng)到一個(gè)數(shù)據(jù)包,發(fā)送器將重新發(fā)送相同的數(shù)據(jù)包。</p><p>  發(fā)射器將繼續(xù)重發(fā),直到接收到一個(gè)有效的反應(yīng),或者,超出文件傳輸被中止的時(shí)間。每個(gè)數(shù)據(jù)包接收和通過程序員驗(yàn)證后,

21、數(shù)據(jù)包中包含的數(shù)據(jù)被加載到的AT89C51單片機(jī)控制器編程。</p><p>  編程后,數(shù)據(jù)從控制器讀回并對(duì)接收的數(shù)據(jù)包進(jìn)行驗(yàn)證。成功的審查表明,成功的程序設(shè)計(jì),使程序員發(fā)送ACK給傳送者。如果編程失敗,程序員發(fā)送CAN向傳送者發(fā)送信號(hào)中止文件傳輸。</p><p>  簡單的FTP減少了AT89C51的程序在編程時(shí)使用的內(nèi)存量。由于AT89C51的編程和擦除時(shí)間可以很容易地吸收,F(xiàn)TP

22、發(fā)送和等待的性質(zhì)允許跨包延遲。對(duì)程序驗(yàn)證的支持是透明的,不需要明確的命令或結(jié)果代碼,或轉(zhuǎn)讓的其他數(shù)據(jù)。</p><p>  上傳到程序控制器的文件是用英特爾MCS- 51軟件開發(fā)包來創(chuàng)建的。在包中包括了MCS - 51宏匯編,MCS - 51單片機(jī)Relocator和連接器,以及一個(gè)有用的工具,OH。OH將8051絕對(duì)目標(biāo)文件轉(zhuǎn)換為為等效的ASCII十六進(jìn)制目標(biāo)文件。</p><p>&l

23、t;b>  遠(yuǎn)程配置</b></p><p>  在測試配置中的遠(yuǎn)程配置包括顯示應(yīng)用程序和程序員電路,如前所述,連接到一個(gè)與Hayes兼容的普羅米修斯1200波特調(diào)制解調(diào)器。在正常操作時(shí),應(yīng)用程序執(zhí)行其內(nèi)部程序,而調(diào)制解調(diào)器和程序員監(jiān)測來電電話線。</p><p>  通話被檢測到并連接建立后,程序器強(qiáng)迫暫停其程序的執(zhí)行。新的程序就被下載并嵌入到應(yīng)用程序中的AT89C51

24、的編程。當(dāng)編程完成后,應(yīng)用軟件程序獲準(zhǔn)開始其新的程序執(zhí)行,而程序控制器返回監(jiān)督下一個(gè)通話的電話線。</p><p>  程序控制輸出無效時(shí)程序控制器上電,允許應(yīng)用程序正常運(yùn)行。在配置調(diào)制解調(diào)器接聽來電后,程序控制器停止工作。是程序控制器不會(huì)影響到程序直到一個(gè)新的程序應(yīng)用程序被下載。</p><p>  程序員通過發(fā)送控制在串行接口上的ASCII命令字符串來控制調(diào)制解調(diào)器,對(duì)此調(diào)制解調(diào)器響應(yīng)

25、海斯式調(diào)制解調(diào)器的ASCII數(shù)字代碼。該軟件是專為與海斯兼容使用的調(diào)制解調(diào)器,其中包括這里使用的1200普羅米修斯ProModem。</p><p>  串行接口,程序員通過它連接到調(diào)制解調(diào)器,它支持兩個(gè)握手信號(hào),DTR和DSR。上電時(shí),程序控制器判定DTR,斷定為DTR后調(diào)制解調(diào)器響應(yīng)。如果調(diào)制解調(diào)器不響應(yīng)任何命令,包括命令掛斷,程序控制器抬高DTR點(diǎn)位,強(qiáng)制調(diào)制解調(diào)器下降。</p><p&

26、gt;  當(dāng)程序控制器停止工作后,監(jiān)測調(diào)制解監(jiān)聽電話線,等待來電呼叫。當(dāng)檢測到輸入,調(diào)制解調(diào)器響應(yīng)并試圖與輸入建立通信。如果建立了連接,調(diào)制解調(diào)器發(fā)送一個(gè)代碼,喚醒程序控制器。程序控制器驗(yàn)證連接的代碼,并開始審查有效的數(shù)據(jù)包報(bào)頭。</p><p>  傳入數(shù)據(jù)包必須在少于30秒內(nèi)到達(dá),否則調(diào)制解調(diào)器掛斷和程序控制器繼續(xù)停止工作,等待下一次呼叫。如果來電掛斷,在得到下一次呼叫之前,三十秒時(shí)間必須終止。在復(fù)位延遲時(shí)間

27、傳入是被忽略的。</p><p>  如果復(fù)位延遲時(shí)間結(jié)束之前收到一個(gè)有效的數(shù)據(jù)包報(bào)頭,程序控制器將嘗試讀取和驗(yàn)證傳入的數(shù)據(jù)包。在數(shù)據(jù)包的接收過程中的任何時(shí)間,無效字符,奇偶校驗(yàn)錯(cuò)誤或超時(shí)的時(shí)間內(nèi)接待字符將導(dǎo)致部分?jǐn)?shù)據(jù)包被宣布無效,并丟棄。</p><p>  兩個(gè)數(shù)據(jù)包類型定義:數(shù)據(jù)和最終文件。數(shù)據(jù)包包含五個(gè)領(lǐng)域,除了包報(bào)頭,是一個(gè)可變長度的數(shù)據(jù)字段。數(shù)據(jù)字段包含程序的數(shù)據(jù)在應(yīng)用程序中被

28、寫入在AT89C51的控制器。負(fù)載地址字段中包含數(shù)據(jù)寫入的地址。末端文件包中包含與數(shù)據(jù)包相同的領(lǐng)域的文件,但該數(shù)據(jù)字段是空的。這包類型對(duì)程序控制器具有特殊的意義,如下所述。</p><p>  任何包含有效文種的數(shù)據(jù)包,記錄長度或校驗(yàn)和無效。程序數(shù)據(jù)在一個(gè)無效的數(shù)據(jù)包被丟棄的處理過程中被積累。編程器給傳送者發(fā)送一個(gè)NAK作為信號(hào)數(shù)據(jù)包的接收和恢復(fù)為一個(gè)有效的數(shù)據(jù)包報(bào)頭審查的警示信號(hào)。</p><

29、;p>  第一個(gè)有效數(shù)據(jù)的接收引起編程器中斷應(yīng)用程序控制器。該控制器的中斷響應(yīng)放棄其正在運(yùn)行的程序,并顯示一條消息,表明程序已經(jīng)被替代。如果這是由于接收了末端文件或者是電源觸發(fā)從而接收的第一個(gè)有效的數(shù)據(jù)包,運(yùn)用必要的控制信號(hào)清除在應(yīng)用控制器內(nèi)的記憶程序。然后編程器在程序模式中放置控制器。</p><p>  當(dāng)接收到第一個(gè)和其后的有效數(shù)據(jù)程序包時(shí),將它們分開,它們包含的數(shù)據(jù)被編程到程序包負(fù)載地址域中的地址中

30、的應(yīng)用控制器內(nèi)。編程后,從控制器內(nèi)將數(shù)據(jù)讀回并與接收到的數(shù)據(jù)包中的數(shù)據(jù)進(jìn)行比較。成功的核查表明,方案是成功的,導(dǎo)致編程器向傳送者發(fā)送ACK信號(hào)。由于30秒的復(fù)位延遲,編程器重新對(duì)有效的數(shù)據(jù)包報(bào)頭進(jìn)行測試。</p><p>  如果編程失敗,編程器向傳送者發(fā)送信號(hào)CAN中止文件傳輸。調(diào)制解調(diào)器掉線,程序器繼續(xù)休眠等待下一次呼叫。應(yīng)用控制在程序模式中被保留,用以阻止它包含的不完整的或無效的程序。</p>

31、<p>  重要的是要注意,無效的數(shù)據(jù)包永遠(yuǎn)不會(huì)規(guī)劃到應(yīng)用程序控制器。這樣做將要求錯(cuò)誤被糾正之前,編程器中的記憶程序被徹底抹掉,造成先前所有數(shù)據(jù)的不可恢復(fù)。</p><p>  根據(jù)末端文件的接收,編程器向閑置的狀態(tài)電源返回其控制輸出,允許應(yīng)用程序控制器,開始執(zhí)行新的程序。然后編程器在三十秒延遲之下重新開始對(duì)一個(gè)數(shù)據(jù)包報(bào)進(jìn)行審查。</p><p>  如果一個(gè)有效的數(shù)據(jù)包在30

32、秒延遲之前接收,另一個(gè)只能被接受一個(gè)有效的末端文件而終止的程序循環(huán)開始執(zhí)行。</p><p>  如果復(fù)位在收有效末端文件之前終止,那么調(diào)制解調(diào)器會(huì)掉線,編程器停止工作,等待下一次傳入。在這種情況下應(yīng)用控制器被保留在程序設(shè)計(jì)模式,以防止它執(zhí)行這個(gè)程序。要返回應(yīng)用程序的正常運(yùn)行,另一個(gè)傳入必須被接收,一個(gè)有效的程序文件被上傳,由末端文件包終止。</p><p><b>  二、原文

33、</b></p><p>  AT89C51 In-Circuit Programming</p><p>  T. Islam, S. Ghosh, H. Saha</p><p>  This application note illustrates the in-circuit programmability of the Atmel AT89C5

34、1 Flash-based microcontroller. Guidelines for the addition of in-circuit programmability to AT89C51 applications are presented along with an application example and the modifications to it required to support in-circuit

35、programming. A method is then shown by which the AT89C51 microcontroller in the application can be reprogrammed remotely, over a commercial telephone line. The circuitry described in this applica</p><p>  G

36、eneral Considerations</p><p>  Circuitry added to support AT89C51 incircuit programming should appear transparent to the application when programming is not taking place.</p><p>  EA/VPP must be

37、 held high during programming. In applications which do not utilize external program memory, this pin may be permanently strapped to VCC. Applications utilizing external program memory require that this pin be held low d

38、uring normal operation. </p><p>  RST must be held active during programming. A means must be provided for overriding the application reset circuit, which typically asserts RST only briefly after power is ap

39、plied.</p><p>  PSEN must be held low during programming, but must not be driven during normal operation.</p><p>  ALE/PROG is pulsed low during programming, but must not be driven during normal

40、 operation.</p><p>  During programming, AT89C51 I/O ports are used for the application of mode select, addresses and data, possibly requiring that the controller be isolated from the application circuitry.

41、How this is done is application dependent and will be addressed here only in general terms.</p><p>  Port Used for Input</p><p>  During programming, the controller must be isolated from signals

42、 sourced by the application circuitry. A buffer with threestate outputs might be inserted between the application circuitry and the controller, with the buffer outputs three-stated when programming is enabled. Alternatel

43、y, a multiplexer might be used to select between signal sources, with signals applied to the controller by either the application circuitry or the programmer circuitry.</p><p>  Port Used for Output</p>

44、;<p>  No circuit changes are required if the application circuitry can tolerate the state changes which occur at the port during programming. If the prior state of the application circuitry must be maintained dur

45、ing programming, a latch might be inserted between the controller and the application circuitry. The latch is enabled during programming, preserving the state of the application circuitry. </p><p>  An Appli

46、cation Example</p><p>  The AT89C51 application shown in Figure 1 is an implementation of a moving display. This application was selected for its simplicity and ability to show graphically the results of in-

47、circuit reprogramming. The text to be displayed is programmed into the controller as part of its firmware, and cannot be changed without reprogramming the device.</p><p>  The displayed text is presented in

48、one of two modes selected by the four-position DIP switch. In the first mode, one character at a time enters the display from the right and moves quickly to the left through each element of the display to its final posit

49、ion in the assembled message. In the second mode, the message moves through the display, from right to left, with the display acting as a window onto the message. This mode is familiar as the method often used in display

50、s of stock prices.</p><p>  The output consists of four DL1414T, four-digit, 17-segment alphanumeric displays with integral decoders and drivers. This yields 16 total display elements, each capable of displa

51、ying digits 0-9, the upper case alphabet, and some punctuation characters. The displayable character codes are ASCII 20H-5FH.</p><p>  A power-on reset circuit and a 6-MHz crystal oscillator complete the app

52、lication. Neither external program memory nor external data memory is used.</p><p>  Modifications to the Application to Support</p><p>  In-Circuit Programming Figure 2 shows the application mo

53、dified for in-circuit programming. </p><p>  It is assumed that the programmer, when inactive, will neither drive nor excessively load the application. Since the application does not use external program mem

54、ory, EA/VPP on the controller is connected to VCC. This meets the requirement for programming.</p><p>  The reset circuit has been modified by the addition of twotransistors, which allow RST on the controlle

55、r to be forced high by the programmer.</p><p>  PSEN and ALE/PROG, unused in the basic application, areunder the direct control of the programmer.</p><p>  Programming requires programmer acces

56、s to all of the four AT89C51 I/O ports, as documented in the data sheet. The programmer is connected directly to those controller pins which are unused by the application, while access to pins used by the application req

57、uires special treatment, as explained in the following paragraphs. </p><p>  The least significant four bits of the address generated by the programmer are multiplexed onto port one of the controller with t

58、he data from the DIP switch. Note that the four resistors added at the switch are not required in the basic application, since the AT89C51 provides internal pull-ups on port one.</p><p>  During the normal o

59、peration of the application, controller ports zero and two provide data and control signals (respectively) to the displays. During programming and program verification, the programmer asserts control of port zero and par

60、t of port two. The programmer is connected to ports zero and two without buffering, since, when inactive, its presence does not affect the normal operation of the application.</p><p>  A transparent latch ha

61、s been added between port two of the controller and the display control inputs. The latch holds the display control signals inactive during programming, which eliminates erratic operation of the displays due to programme

62、r activity on ports zero and two. No isolation of</p><p>  the display data inputs is required, since data applied to the inputs is ignored when the control signals are inactive.</p><p>  The AT

63、89C51 reset circuit, input multiplexer and output latch are controlled by a single signal generated by the programmer. During programming, reset is asserted, the multiplexer switches inputs, and the latch freezes the dis

64、play control lines.</p><p>  To ensure that the display control lines are in a known state before they are latched, an AT89C51 external interrupt is used to allow the programmer to signal the application bef

65、ore asserting reset. The application firmware responds to the interrupt by displaying a message and deactivating the display control lines.</p><p>  After programming, when reset is deasserted, the controlle

66、r ports are high as the latch becomes transparent. Since the display control inputs are inactive high, the display contents are not disturbed until the new program writes the display. Although not essential to this appli

67、cation, it might be imperative in some applications that the state of the peripheral circuitry not be disturbed during programming.</p><p>  The Programmer</p><p>  The programmer (Figure 3) gen

68、erates the addresses, data and control signals necessary to program the AT89C51 embedded in the application. </p><p>  The programmer circuitry consists of an AT89C51 and an RS-232 level translator. The cont

69、roller runs at 11.0592 MHz, which allows the serial port to operate at a number of standard baud rates. A Maxim MAX232 line driver/receiver produces RS-232 levels at the serial interface while requiring only a five volt

70、supply.</p><p>  Many of the signals generated by the programmer are connected directly, without buffering, to the AT89C51 in the application. These signals, when inactive, are not threestated, but are pulle

71、d high. The AT89C51 has internal pull-ups of approximately three Kohms on ports one, two and three. Because port zero does not have internal pull-ups, external pull-ups of ten Kohms have been added to permit proper opera

72、tion of program verification mode. The sample application operates correctly in this envir</p><p>  The AT89C51 in the programmer does not utilize external program or data memory, which would require sacrifi

73、cing needed I/O pins. This requires that program code and I/O buffers be kept small enough to fit in on-chip memory.</p><p>  Remote Programming Over a Commercial</p><p>  Telephone Line</p&g

74、t;<p>  The programmer and display application described previously are connected to a phone line via a modem at a remote site. Using a personal computer with a modem, a user can upload a new program containing a

75、new message, which is programmed into the AT89C51 embedded in the application. When programming is complete, the application executes the new program, which displays the new message.</p><p>  Local Station&l

76、t;/p><p>  The local station in the test configuration consists of an IBM PC AT-class computer connected to a Hayes-compatible, Prometheus 1200 baud modem. The modem was selected because it was inexpensive and

77、available. A faster modem may be used if desired, although once the file transmission time is reduced below one minute, further reductions in transmission time do not further reduce connect time charges. A possible advan

78、tage to higher transmission speeds is the automatic error detection and correctio</p><p>  Procomm Plus version 2.01, a commercial data communications package, is used to configure the modem, set up communic

79、ations parameters, and establish a link with the remote modem. Procomm Plus includes a macro language called ASPECT, which allows the user to write and compile scripts which implement custom file transfer protocols. A si

80、mple ASPECT script was written to read the contents of a program file and upload it to the remote programmer.</p><p>  The file transfer protocol (FTP) implemented is a simple send-and-wait, packet-oriented

81、protocol. The transmit and receive modes of the FTP are illustrated by the flowcharts in figures 4 and 5, respectively. The transmitter sends each packet without flow control and waits for a response. The programmer (the

82、 receiver) reads and dissects the packet while calculating a checksum. If the calculated checksum is valid, the programmer acknowledges the packet by sending an ACK. If the checksum is in erro</p><p>  The p

83、rogrammer might respond to a packet by sending a CAN, which indicates that a non-recoverable error has occurred and that the transmitter should immediately abort the file transfer. If the programmer fails to respond to a

84、 packet within a limited period of time, the transmitter will resend the same packet. The transmitter will continue to resend the same packet until a valid response is received or until the allowed number of attempts is

85、exceeded, at which time the file transfer is aborted. A</p><p>  After programming, the data is read back from the controller and verified against the received packet data. Successful verification indicates

86、successful programming, causing the programmer to send ACK to the transmitter. If programming fails, the programmer sends CAN to signal the transmitter to abort the file transfer.</p><p>  The simplicity of

87、the FTP reduces the amount of AT89C51 program memory used in the programmer. The send-andwait nature of the FTP allows inter-packet delays due to AT89C51 program and erase times to be easily absorbed. Support for program

88、 verification is transparent, requiring no explicit command or result codes, or additional data transfers.</p><p>  The files which are uploaded to the programmer are created with the tools in the Intel MCS-

89、51 Software Development Package for the IBM PC. Included in the package are the MCS-51 Macro Assembler, MCS-51 Relocator and Linker, and a useful utility, OH. OH converts an absolute 8051 object file to an equivalent ASC

90、II hexadecimal object file.</p><p>  The records in the hex file produced by the OH utility serve, unchanged, as the packets in the FTP described above; no service fields need to be added. The colon which be

91、gins each record serves as the packet signature field. The load address field serves as the packet sequence number. A checksum is provided as the last field in each record. Since seven-bit ASCII coding is utilized, the e

92、ighth bit of each byte is available to be used for parity checking.</p><p>  Because the AT89C51 in the programmer does not utilize external data memory, necessary packet buffering must be done using interna

93、l RAM. Limited memory precludes the use of conventional FTPs which utilize packets of 128 bytes and larger. The hex packet format used in this application limits packet data fields to 16 or fewer entries, requiring littl

94、e memory for buffering.</p><p>  The ready availability of a utility for creating the packetized program file, combined with small packet size and adequate error checking, makes the hex packet format a near

95、ideal solution for this application. A disadvantage is the use of ASCII, which requires each program data byte to be expressed as two hex characters. This demands that nearly twice as many bytes be transferred as might o

96、therwise be required. This is not a severe limitation, however, since typical file transfer times are less</p><p>  Remote Station</p><p>  The remote station in the test configuration consists

97、of the display application and programmer circuits, described previously, connected to a Hayes-compatible, Prometheus 1200 baud modem. During normal operation, the application executes its internal program while the mode

98、m and programmer monitor the phone line for incoming calls.</p><p>  After a call has been detected and a connection established, the programmer forces the application to suspend execution of its program. Th

99、e new program is then downloaded and programmed into the AT89C51 embedded in the application. When programming is complete, the application is allowed to begin execution of its new program, and the programmer returns to

100、monitoring the phone line for the next call.</p><p>  The programmer powers up with its programming control outputs inactive, allowing the application to run normally. After configuring the modem to answer i

溫馨提示

  • 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ì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論