【正文】
參考文獻(xiàn)及引用資料目錄[1] 何立民. 單片機(jī)應(yīng)用技術(shù)選篇 北京航空航天出版社[2] 何立民. 51系列單片機(jī)應(yīng)用系統(tǒng) 北京航空航天出版社[3] 詹林. 電池供電單片機(jī)的低功耗設(shè)計(jì) 高教出版社[4] 鮑遠(yuǎn)律. 劉振安 微型定位、交通監(jiān)控與數(shù)字地圖 國(guó)防工業(yè)出版社[5] 田亞娟. 基于單片機(jī)的數(shù)據(jù)采集控制 工業(yè)科技,2004(4)[6] 李華. MCS 51系列單片機(jī)實(shí)用接口技術(shù)[M] 北京航空航天大學(xué)出版社,1993[7] 李廣弟. 單片機(jī)基礎(chǔ)[M] 北京航空航天大學(xué)出版社,1994[8] 張曉龍. AD7714在微小電阻測(cè)量?jī)x上的應(yīng)用 蘭州理工大學(xué)[9] 劉志存. 基于MCS51單片機(jī)的微電阻測(cè)量系統(tǒng) 陜西師范大學(xué)[10] 林育茲. 可編程序控制器原理及邏輯控制[M] 機(jī)械工業(yè)出版社,2006[11] 謝自美. (第二版) 華中科技大學(xué)出版社,2005[12] 張義和. Protel PCB98電腦輔助電路設(shè)計(jì)教程,[13] 周仲. 國(guó)內(nèi)外常用集成電路互換手冊(cè),[14] 胡漢才. 單片機(jī)原理及接口技術(shù) 清華大學(xué)出版社,1996[15] 李朝青. 單片機(jī)原理及接口技術(shù) 北京航空航天大學(xué)出版社,2000附錄1 英文資料及翻譯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’sGeneral ConsiderationsCircuitry added to support AT89C51 incircuit programming should appear transparent to the application when programming is not taking place. 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 InputDuring programming, the controller must be isolated from signals sourced by the application circuitry. A buffer with threestate 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 OutputNo 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 ExampleThe 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 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 SupportInCircuit Programming Figure 2 shows the application modified for incircuit programming. It is assumed that the programmer, 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 circuit has been modified by the addition of twotransistors, which allow RST on the controller to be forced high by the programmer.PSEN and ALE/PROG, unused in the basic application, areunder the direct control of the programmer.Programming requires programmer access 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 requires special treatment, as explained in the following paragraphs. The least significant four bits of the address generated by the programmer are multiplexed onto port one of the controller with the 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 pullups on port one.During the normal operation of the application, controller ports zero and two provide data and control signals (respectively) to t