ImageVerifierCode 换一换
格式:DOC , 页数:15 ,大小:61KB ,
资源ID:824068      下载积分:10 积分
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 微信支付   
验证码:   换一换

加入VIP,免费下载资源
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【http://www.wodocx.com/d-824068.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(测控技术与仪器 单片机 外文翻译 外文文献 英文文献 51单片机在编程电路中的应用.doc)为本站会员(精***)主动上传,沃文网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知沃文网(发送邮件至2622162128@qq.com或直接QQ联系客服),我们立即给予删除!

测控技术与仪器 单片机 外文翻译 外文文献 英文文献 51单片机在编程电路中的应用.doc

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

25、bedded in the application. The programmer circuitry consists of an AT89C51 and an RS-232 level translator. The controller 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 interfac

26、e while requiring only a five volt supply.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 pulled high. The AT89C51 has internal pull-ups of approximately three Koh

27、ms 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 operation of program verification mode. The sample application operates correctly in this environment. If required for compatibility with an application,

28、 programmer signals may be buffered with three-state buffers similar to the 74xx125.The AT89C51 in the programmer does not utilize external program or data memory, which would require sacrificing needed I/O pins. This requires that program code and I/O buffers be kept small enough to fit in on-chip

29、memory.Remote Programming Over a CommercialTelephone LineThe 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 new message, which is programmed into

30、the AT89C51 embedded in the application. When programming is complete, the application executes the new program, which displays the new message.Local StationThe local station in the test configuration consists of an IBM PC AT-class computer connected to a Hayes-compatible, Prometheus 1200 baud modem

31、. The modem was selected because it was inexpensive and 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 advantage to higher transmiss

32、ion speeds is the automatic error detection and correction available in some high speed modems.Procomm Plus version 2.01, a commercial data communications package, is used to configure the modem, set up communications parameters, and establish a link with the remote modem. Procomm Plus includes a ma

33、cro language called ASPECT, which allows the user to write and compile scripts which implement custom file transfer protocols. A simple ASPECT script was written to read the contents of a program file and upload it to the remote programmer.The file transfer protocol (FTP) implemented is a simple sen

34、d-and-wait, packet-oriented 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 receiver) reads and dissects the packet while calcu

35、lating a checksum. If the calculated checksum is valid, the programmer acknowledges the packet by sending an ACK. If the checksum is in error, the programmer negatively acknowledges the packet by sending a NAK. Upon receipt of an ACK, the transmitter sends the next packet. If the transmitter receive

36、s a NAK, it resends the same packet. Transmission proceeds in this manner until the entire file has been transferred.The programmer 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 transfe

37、r. If the programmer fails to respond to a 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 exceeded, at which time the file trans

38、fer is aborted. After each packet is received and validated by the programmer, the data contained in the packet is programmed into the AT89C51 controller in the application. After programming, the data is read back from the controller and verified against the received packet data. Successful verific

39、ation indicates 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.The simplicity of the FTP reduces the amount of AT89C51 program memory used in the programmer. The send-a

40、ndwait nature of the FTP allows inter-packet delays due to AT89C51 program and erase times to be easily absorbed. Support for program verification is transparent, requiring no explicit command or result codes, or additional data transfers.The files which are uploaded to the programmer are created wi

41、th the tools in the Intel MCS-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 ASCII hexadecimal object file.The records in the hex

42、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 begins 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 fi

43、eld in each record. Since seven-bit ASCII coding is utilized, the eighth bit of each byte is available to be used for parity checking.Because the AT89C51 in the programmer does not utilize external data memory, necessary packet buffering must be done using internal RAM. Limited memory precludes the

44、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 little memory for buffering.The ready availability of a utility for creating the packetized program file, combined with s

45、mall packet size and adequate error checking, makes the hex packet format a near 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

46、otherwise be required. This is not a severe limitation, however, since typical file transfer times are less than one minute. Overall, the simplicity of the custom FTP/hex packet format implementation outweighs the drawbacks.51单片机在编程电路中的应用本应用指南说明了Atmel AT89C51是可在线可编程的微控制器。它为电路编程提出了相应的例子,程序的修改需要在线编程的支

47、持。这类显示方法在应用程序中的AT89C51单片机可通过电话线远程控制。该应用指南所描述的电路只支持5v电压下编程。此应用软件可以到Atmel进行下载。总论当不在进行程序设计的时候,在电路设计中的AT89C51设计将变得透明化。在编程期间必须重视EA/VPP这一脚。在不使用外部程序存储器的应用程序中,这脚可能会永久接到VCC。应用程序使用的外部程序存储器要求这一脚为低电平才能正常运行。RST在编程期间必须为高电平。应该提供一种方法使得电路通入电源以后,使RST代替主要的复位电路起到复位的作用 。在编程过程中,PSEN必须保持低电平,在正常运行期间绝不能使用。ALE/ PROG在编程过程中输出低

48、电平,在正常运行期间绝不能使用。在编程过程中,AT89C51的I / O端口是用于模式应用程序,地址和数据选择的,可能需要该控制器从应用的电路隔离。如何做到这一点取决于应用程序。输入端口在编程过程中,控制器必须与应用电路的信号来源隔离。带有三个输出状态的缓冲区会在应用程序之间插入电路和控制器,同时在编程时缓冲区输出三种状态。一个多路复用器可用于信号源之间进行选择,适用于任何一方的应用电路或编程控制器电路的信号。输出端口如果应用的电路可以允许端口在编程过程中的状态变化,则不需要改变电路。如果应用电路的状态,必须事先在编程过程中的保持不变,可能在控制器和应用电路中插入锁存。锁存在编程期间是可用的,

49、并保存应用程序的电路状态。应用实例 应用是该AT89C51一个移动的显示情况。此应用程序有在电路重新编程时将结果以图表的形式显示的简单能力。文本显示被设计作为其硬件的一部分,不能在无改编情况下变化。显示的文本可在4位DIP开关选择两种模式之一中进行。在第一种模式的时候,进入一个字符从右边显示和快速移动,通过每个元素显示其在最后的装配位置的左侧。在第二个模式,信息在信息窗口中右到左移动显示。这种模式与常常在股票价格的显示器所使用的方法类似。输出包括四个DL1414T,4位17段的积分解码器和驱动程序的字母数字显示器。这就产生了16名显示元素,每个数字有0-9的显示能力,是大写字母,标点符号和一些字符。可显示字符的ASCII 码,范围为20H-5FH。上电复位电路和一个6 MHz的晶体振荡器完成应用软件程序。无论外部程序存储器或外部数据存储器都时可用的。支持应用程序的修改 据推测,编程器在休眠时,既不会驱动,也不会加载应用程序。由于应用程序不使用外部程序存储

版权声明:以上文章中所选用的图片及文字来源于网络以及用户投稿,由于未联系到知识产权人或未发现有关知识产权的登记,如有知识产权人并不愿意我们使用,如有侵权请立即联系:2622162128@qq.com ,我们立即下架或删除。

Copyright© 2022-2024 www.wodocx.com ,All Rights Reserved |陕ICP备19002583号-1 

陕公网安备 61072602000132号     违法和不良信息举报:0916-4228922