测控技术与仪器 单片机 外文翻译 外文文献 英文文献 51单片机在编程电路中的应用.doc
《测控技术与仪器 单片机 外文翻译 外文文献 英文文献 51单片机在编程电路中的应用.doc》由会员分享,可在线阅读,更多相关《测控技术与仪器 单片机 外文翻译 外文文献 英文文献 51单片机在编程电路中的应用.doc(15页珍藏版)》请在沃文网上搜索。
1、 AT89C51 In-Circuit Programming出处:Atmel Corporating This application note illustrates the in-circuit programmability of the Atmel AT89C51 Flash-based microcontroller. Guidelines for the addition of in-circuit programmability to AT89C51 applications are presented along with an application example and
2、 the modifications to it required to support in-circuit 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 application note supports five volt programming only, re
3、quiring the use of an AT89C51-XX-5. The standard AT89C51 requires 12 volts for programming. The software for this application may be obtained by downloading from AtmelsGeneral ConsiderationsCircuitry added to support AT89C51 incircuit programming should appear transparent to the application when pro
4、gramming 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
5、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, b
6、ut 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
7、 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 three-stated when programm
8、ing 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 ch
9、anges 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 ci
10、rcuitry. 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 in-circuit reprogramming. The text to be displayed is programmed into the controller as p
11、art of its firmware, and cannot be changed without reprogramming the device.The displayed text is presented in 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
12、 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 DL1
13、414T, four-digit, 17-segment alphanumeric displays with integral decoders and drivers. This yields 16 total display elements, each capable of displaying digits 0-9, the upper case alphabet, and some punctuation characters. The displayable character codes are ASCII 20H-5FH.A power-on reset circuit an
14、d a 6-MHz crystal oscillator complete the application. Neither external program memory nor external data memory is used.Modifications to the Application to SupportIn-Circuit Programming Figure 2 shows the application modified for in-circuit programming. It is assumed that the programmer, when inacti
15、ve, 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
16、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 t
17、hose 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
18、 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 pull-ups on port one.During the normal operation of the application, controller ports zero and two provide data and control signals (respecti
19、vely) to the displays. During programming and program verification, the programmer asserts control of port zero and part 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.A tran
20、sparent latch has 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 programmer activity on ports zero and two. No isolation ofthe display dat
21、a inputs is required, since data applied to the inputs is ignored when the control signals are inactive.The AT89C51 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,
22、 and the latch freezes the display control lines.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 before asserting reset. The application firmware responds to the interrupt b
23、y displaying a message and deactivating the display control lines.After programming, when reset is deasserted, the controller 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 d
24、isplay. Although not essential to this application, it might be imperative in some applications that the state of the peripheral circuitry not be disturbed during programming.The ProgrammerThe programmer (Figure 3) generates the addresses, data and control signals necessary to program the AT89C51 em
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
10 积分
下载 | 加入VIP,下载更划算! |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- 测控技术与仪器 单片机 外文翻译 外文文献 英文文献 51单片机在编程电路中的应用 测控 技术 仪器 外文 翻译 文献 英文 51 编程 电路 中的 应用