【正文】
下一次呼叫。負(fù)載地址字段中包含數(shù)據(jù)寫入的地址。如果這是由于接收了末端文件或者是電源觸發(fā)從而接收的第一個有效的數(shù)據(jù)包,運用必要的控制信號清除在應(yīng)用控制器內(nèi)的記憶程序。應(yīng)用控制在程序模式中被保留,用以阻止它包含的不完整的或無效的程序。要返回應(yīng)用程序的正常運行,另一個傳入必須被接收,一個有效的程序文件被上傳,由末端文件包終止。然后編程器在三十秒延遲之下重新開始對一個數(shù)據(jù)包 報進行審查。成功的核查表明,方案是成功的,導(dǎo)致編程器向傳送者發(fā)送 ACK 信號。程序數(shù)據(jù)在一個無效的數(shù)據(jù)包被丟棄的處理過程中被積累。在數(shù)據(jù)包的接收過程中的任何時間,無效字符,奇偶校驗錯誤或超時的時間內(nèi)接待字符將導(dǎo)致部分?jǐn)?shù)據(jù)包被宣布無效,并丟棄。 當(dāng)程序控制器停止工作后,監(jiān)測調(diào)制解監(jiān)聽電話線,等待來電呼叫。 程序控制輸出無效時程序控制器上電,允許應(yīng)用程序正常運行。 上傳到程序控制器的文件是用英特爾 MCS 51 軟件開發(fā)包來創(chuàng)建的。 發(fā)射器將繼續(xù)重發(fā),直到接收到一個有效的反應(yīng),或者,超出文件傳輸被中止的時間。 在計算校驗和時那個程序控制器(接收器)讀取并剖析了數(shù)據(jù)包。更快的調(diào)制解調(diào)器如果需要的話可使用更快速的調(diào)制 解調(diào)器,盡管一旦該文件的傳輸時間低于 1 分鐘,進一步削減的傳輸時間不會進一步降低連接時間費用。 AT89C51 的程序不使用外部程序或數(shù)據(jù)存儲器,這需要犧牲所需要的 I / O引腳。 程序控制器電路由一個 AT89C51 和一個 RS 232 電平轉(zhuǎn)換器組成。 AT89C51 單片機復(fù)位電路,輸入多路復(fù)用器和輸出鎖存器是由程序控制器生成一個單一的信號來控制的。 由編程器生成的最 小的四位地址是與 DIP 轉(zhuǎn)換的數(shù)據(jù)在控制器的端口多路復(fù)用的 。無論外部程序存儲器或外部數(shù)據(jù) 存儲器都時可用的。 顯示的文本可在 4 位 DIP 開關(guān)選擇兩 種模式之一中進行。 輸入端口 在編程過程中,控制器必須與應(yīng)用電路的信號來源隔離。在不使用外部程序存儲器的應(yīng)用程序中,這腳可能會永久接到 VCC。 附 錄 附錄 A 外文資料 AT89C51 InCircuit Programming This application note illustrates the incircuit programmability of the Atmel AT89C51 Flashbased microcontroller. Guidelines for the addition of incircuit programmability to AT89C51 applications are presented along with an application example and the modifications to it required to support incircuit programming. A method is then shown by which the AT89C51 microcontroller in the application can be reprogrammed remotely, over a mercial telephone line. The circuitry described in this application note supports five volt programming only, requiring the use of an AT89C51XX5. The standard AT89C51 requires 12 volts for programming. The software for this application may be obtained by downloading from Atmel’s. General Considerations EA/VPP must be 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 during normal operation. 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 applied. PSEN must be held low during programming, but must not be driven during normal operation. ALE/PROG is pulsed low during programming, but must not be driven during normal operation. 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. How this is done is application dependent and will be addressed here only in general terms. Port Used for Input During programming, the controller must be isolated from signals sourced by the application circuitry. A buffer with three state outputs might be inserted between the application circuitry and the controller, with the buffer outputs threestated when programming is enabled. Alternately, 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. Port Used for Output 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 during 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. An Application Example This application was selected for its simplicity and ability to show graphically the results of incircuit reprogramming. The text to be displayed is programmed into the controller as part of its firmware, and cannot be changed without reprogramming the device. The displayed text is presented in one of two modes selected by the fourposition 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 position 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 displays of stock prices. The output consists of four DL1414T, fourdigit, 17segment alphanumeric displays with integral decoders and drivers. This yields 16 total display elements, each capable of displaying digits 09, the upper case alphabet, and some punctuation characters. The displayable character codes are ASCII 20H5FH. A poweron reset circuit and a 6MHz crystal oscillator plete the application. Neither external program memory nor external data memory is used. Modifications to the Application to Support InCircuit Programming Figure 2 shows the application modified for incircuit programming. When inactive, will neither drive nor excessively load the application. Since the application does not use external program memory, EA/VPP on the controller is connected to VCC. This meets the requirement for programming. The reset ci