收藏 分销(赏)

The-General-Situation-of-AT89C51.doc

上传人:快乐****生活 文档编号:4425387 上传时间:2024-09-20 格式:DOC 页数:8 大小:42.50KB 下载积分:6 金币
下载 相关 举报
The-General-Situation-of-AT89C51.doc_第1页
第1页 / 共8页
The-General-Situation-of-AT89C51.doc_第2页
第2页 / 共8页


点击查看更多>>
资源描述
The General Situation of AT89C51 Chapter 1 The application of AT89C51 Microcontrollers are used in a multitude of mercial applications such as modems, motorcontrol systems, air conditioner control systems, automotive engine and among others、 The high processing speed and enhanced peripheral set of these microcontrollers make them suitable for such highspeed eventbased applications、 However, these critical application domains also require that these microcontrollers are highly reliable、 The high reliability and low market risks can be ensured by a robust testing process and a proper tools environment for the validation of these microcontrollers both at the ponent and at the system level、 Intel Plaform Engineering department developed an objectoriented multithreaded test environment for the validation of its AT89C51 automotive microcontrollers、 The goals of thisenvironment was not only to provide a robust testing environment for the AT89C51 automotive microcontrollers, but to develop an environment which can be easily extended and reused for the validation of several other future microcontrollers、 The environment was developed in conjunction with Microsoft Foundation Classes (AT89C51)、 The paper describes the design and mechanism of this test environment, its interactions with various hardware/software environmental ponents, and how to use AT89C51、 1、1 Introduction The 8bit AT89C51 CHMOS microcontrollers are designed to handle highspeedcalculations and fast input/output operations、 MCS 51 microcontrollers are typically used for highspeed event control systems、 mercial applications include modems,motorcontrol systems, printers, photocopiers, air conditioner control systems, disk drives,and medical instruments、 The automotive industry use MCS 51 microcontrollers in enginecontrol systems, airbags, suspension systems, and antilock braking systems (ABS)、 The AT89C51 is especially well suited to applications that benefit from its processing speed and enhanced onchip peripheral functions set, such as automotive powertrain control, vehicle dynamic suspension, antilock braking, and stability control applications、 Because of these critical applications, the market requires a reliable costeffective controller with a low interrupt latency response, ability to service the high number of time and event driven integrated peripherals needed in real time applications, and a CPU with above average processing power in a single package、 The financial and legal risk of having devices that operate unpredictably is very high、 Once in the market, particularly in mission criticalapplications such as an autopilot or antilock braking system, mistakes are financiallyprohibitive、 Redesign costs can run as high as a $500K, much more if the fix means 2 back annotating it across a product family that share the same core and/or peripheral design flaw、 In addition, field replacements of ponents is extremely expensive, as the devices are typically sealed in modules with a total value several times that of the ponent、 To mitigate these problems, it is essential that prehensive testing of the controllers be carried out at both the ponent level and system level under worst case environmental and voltage conditions、This plete and thorough validation necessitates not only a welldefined process but also a proper environment and tools to facilitate and execute the mission successfully、Intel Chandler Platform Engineering group provides post silicon system validation (SV) of various microcontrollers and processors、 The system validation process can be broken into three major parts、The type of the device and its application requirements determine which types of testing are performed on the device、 1、2 The AT89C51 provides the following standard features: 4Kbytes of Flash, 128 bytes of RAM, 32 I/O lines, two 16bittimer/counters, a five vector twolevel interrupt architecture,a full duple ser ial port, onchip oscillator and clock circuitry、In addition, the AT89C51 is designed with static logic for operation down to zero frequency and supports two software selectable power saving modes、 The Idle Mode stops the CPU while allowing the RAM, timer/counters,serial port and interrupt sys tem to continue functioning、 The Powerdown Mode saves the RAM contents but freezes the oscil –lator disabling all other chip functions until the next hardware reset、 13Pin Description VCC Supply voltage、 GND Ground、 Port 0:Port 0 is an 8bit opendrain bidirectional I/O port、 As an output port, each pin cansink eight TTL inputs、 When 1s are written to port 0 pins, the pins can be used as highimpedance inputs、Port 0 may also be configured to be the multiplexed loworder address/data busduring accesses to external program and data memory、 In this mode P0 has internalpullups、Port 0 also receives the code bytes during Flash programming,and outputs the codebytes during program verification、 External pullups are required during programverification、 Port 1:Port 1 is an 8bit bidirectional I/O port with internal pullups、The Port 1 output buffers can sink/so urce four TTL inputs、When 1s are written to Port 1 pins they are pulled high by the internal pullups and can be used as inputs、 As inputs, Port 1 pins that are externally being pulled low will source current (IIL) because of the internal pullups、Port 1 also receives the loworder address bytes during Flash programming and verification、 Port 2:Port 2 is an 8bit bidirectional I/O port with internal pullups、The Port 2 outputbuffers can sink/source four TTL inputs、When 1s are written to Port 2 pins they arepulled high by the internal pullups and can be used as inputs、 As inputs, Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pullups、 Port 2 emits the highorder address byte during fetches from external program memory and during accesses to Port 2 pins that are externally being pulled low will source current (IIL) because of the internal pullups、Port 2 emits the highorder address byte during fetches from external program memory and during accesses to external data memory that use 16bit addresses (MOVXDPTR)、 In this application, it uses strong internal pullups when emitting 1s、 During accesses to external data memory that use 8bit addresses (MOVX RI), Port 2 emits the contents of the P2 Special Function Register、Port 2 also receives the highorder address bits and some control signals durin Flash programming and verification、 Port 3:Port 3 is an 8bit bidirectional I/O port with internal pullups、The Port 3 outputbuffers can sink/sou rce four TTL inputs、When 1s are written to Port 3 pins they are pulled high by the internal pullups and can be used as inputs、 As inputs,Port 3 pins that are externally being pulled low will source current (IIL) because of the pullups、 Port 3 also serves the functions of various special featuresof the AT89C51 as listed below: RST:Reset input、 A high on this pin for two machine cycles while the oscillator is running resets the device、 ALE/PROG:Address Latch Enable output pulse for latching the low byte of the address duringaccesses to external memory、This pin is also the program pulse input (PROG) during Flash programming、In normal operation ALE is emitted at a constant rate of 1/6 the oscillator frequency,and may be used for external timing or clocking purposes、 Note, however, that one ALEpulse is skipped duri ng each access to external DataMemory、If desired, ALE operationcan be disabled by setting bit 0 of SFR location 8EH、 With the bit set, ALE is active onlyduring a MOVX or MOVC instruction、 Otherwise, the pin is weakly pulled high、 Settingthe ALEdisable bit has no effect if the microcontroller is in external execution mode、 PSEN:Program Store Enable is the read strobe to external program memory、 When theAT89C51 is executing code from external program memory, PSEN is activated twiceeach machine cycle, except that two PSEN activations are skipped during each access toexternal data memory、 EA/VPP:External Access Enable、 EA must be strapped to GND in order to enable the deviceto fetch code from external program memory locations starting at 0000H up to FFFFH、Note, however, that if lock bit 1 is programmed, EA will be internally latched onreset、EA should be strapped to VCC for internal program executions、 This pin alsreceives the 12volt programming enable voltage (VPP) during Flash programming, forparts that require 12volt VPP、 XTAL1:Input to the inverting oscillator amplifier and input to the internal clock operatingcircuit、 XTAL2 :Output from the inverting oscillator amplifier、Oscillator CharacteristicsXTAL1 and XTAL2 are the input and output, respectively, of an inverting amplifierwhich can be configured for use as an onchip oscillator, as shown in Figure 1、 Either aquartz crystal or ceramic resonator may be used、 To drive the device from an externalclock source, XTAL2 should be left unconnected while XTAL1 is driven as shown in Figure 2、There are no requirements on the duty cycle of the external clock signal, since the input to the internal clocking circuitry is through a dividebytwo flipflop, but minimum and maximum voltage high and low time specifications must be observed、 Idle Mode In idle mode, the CPU puts itself to sleep while all the onchip peripherals remain active、 The mode is invoked by software、 The content of the onchip RAM and all the special functions registers remain unchanged during this mode、 The idle mode can be terminated by any enabled interrupt or by a hardware reset、 It should be noted that when idle is terminated by a hard ware reset, the device normally resumes program execution, from where it left off, up to two machine cycles before the internal reset algorithm takes control、 Onchip hardware inhibits access to internal RAM in this event, but access to the port pins is not inhibited、 To eliminate the possibility of an unexpected write to a port pin when Idle is terminated by reset, the instruction following the one that invokes Idle should not be one that writes to a port pin or to external memory、 Powerdown Mode In the powerdown mode, the oscillator is stopped, and the instruction that invokes powerdown is the last instruction executed、 The onchip RAM and Special Function Registers retain their values until the powerdown mode is terminated、 The only exit from powerdown is a hardware reset、 Reset redefines the SFRs but does not change the onchip RAM、 The reset should not be activated before VCC is restored to its normal operating level and must be held active long enough to allow the oscillator to restart and stabilize、The AT89C51 code memory array is programmed bytebybyte in either programming mode、 To program any nonblank byte in the onchip Flash Memory, the entire memory must be erased using the Chip Erase Mode、 中文译文 AT89C51得概述 第一章 AT89C51得应用 单片机在商界上已广泛应用:例如调制解调器,电动机控制系统,空调控制系统,汽车发动机与其她得领域。单片机得处理速度得快速与增强型外围器件得集成使得它们适合应用于这种需要高速要求得应用场合。但就是,这些关键应用领域也要求这些单片机可靠性非常高。稳定得测试环境与用于验证这些无论在元部件层次还就是系统级别得单片机得合适得工具环境保证了可靠性非常高与市场风险非常低。Intel 平台工程部门开发了一种面向对象得应用于验证它得AT89C51 汽车单片机多线性测试环境。这种环境得目标不仅就是为AT89C51 汽车单片机提供一种稳定得检测环境,而且就是为了开发一种能够容易扩展并重复用来验证其她几种未来得单片机。开发得这种环境就是在连接AT89C51得基础之上得。本文讨论了这种测试环境得设计与原理,以及它与各种硬件、软件环境器件得交互性,以及如何应用AT89C51。 1、1 介绍 8 位AT89C51 CHMOS 工艺单片机被设计用于处理高速运算与快速得输入/输出。MCS51 单片机典型得应用就是处理高速事件得控制系统。商业应用包括调制解调器,电动机控制系统,打印机,影印机,空调控制系统,磁盘驱动器与医疗设备。汽车制造业把MCS51 单片机用于发动机控制系统,悬挂系统与反锁制动系统。AT89C51 应用范围广泛得益于它得处理速度与增强型片上外围功能集,诸如:汽车动力控制,车辆动态悬挂,反锁制动与稳定性控制应用。由于这些关键应用,市场需要一种可靠得具有低干扰潜伏响应得费用效能控制器,服务大量时间与事件驱动得在实时应用需要得集成外围得能力,具有在单一程序包中高出平均处理功率得中央处理器。拥有操作不可预测得设备得经济与法律风险就是很高得。一旦进入市场,尤其任务决定性应用诸如自动驾驶仪或反锁制动系统,错误将就是财力上所禁止得。重新设计得费用可以高达500K 美元,如果产品族享有同样内核或外围设计缺陷得话,费用会更高。另外,部件得替代品领域就是极其昂贵得,因为设备要用来把模块典型地焊接成一个总体得价值比各个部件高几倍。为了缓与这些问题,在最坏得环境与电压条件下对这些单片机进行无论在部件级别还就是系统级别上得综合测试就是必需得。Intel Chandler 平台工程组提供了各种单片机与处理器得系统验证。这种系统得验证处理可以被分解为三个主要部分。系统得类型与应用需求决定了能够在设备上执行得测试类型。 1、2 AT89C51提供以下标准功能: 4k 字节FLASH 闪速存储器,128 字节内部RAM,32 个I/O 口线,2 个16 位定时/计数器,一个5 向量两级中断结构,一个全双工串行通信口,片内振荡器及时钟电路。同时,AT89C51 降至0Hz 得静态逻辑操作,并支持两种可选得节电工作模式。空闲方式体制CPU 得工作,但允许RAM,定时/计数器,串行通信口及中断系统继续工作。掉电方式保存RAM 中得内容,但振荡器体制工作并禁止其她所有不见工作直到下一个硬件复位。 1、3引脚功能说明 ·Vcc:电源电压 ·GND:地 ·P0 口:P0 口就是一组8 位漏极开路型双向I/O 口,也即地址/数据总线复用。作为输出口用时,每位能吸收电流得方式驱动8 个TTL 逻辑门电路,对端口写“1”可作为高阻抗输入端用。在访问外部数据存储器或程序存储器时,这组口线分时转换地址(低8 位)与数据总线复用,在访问期间激活内部上拉电阻。在Flash 编程时,P0 口接受指令字节,而在程序校验时,输出指令字节,校验时,要求外接上拉电阻。 ·P1 口:P1 就是一个带内部上拉电阻得8 位双向I/O 口,P1 得输出缓冲级可驱动(吸收或输出电流)4 个TTL 逻辑门电路。对端口写“1”,通过内部得上拉电阻把端口拉到高电平,此时可作输入口。作为输入口使用时,因为内部存在上拉电阻,某个引脚被外部信号拉低时会输出一个电流(IIL)。Flash 编程与程序校验期间,P1 接受低8 位地址。 ·P2 口:P2 就是一个带有内部上拉电阻得8 位双向I/O 口,P2 得输出缓冲级可驱动(吸收或输出电流)4 个TTL 逻辑门电路。对端口写“1”,通过内部得上拉电阻把端口拉到高电平,此时可作输入口。作为输入口使用时,因为内部存在上拉电阻,某个引脚被外部信号拉低时会输出一个电流(IIL)。在访问外部程序存储器或16 位四肢得外部数据存储器(例如执行MOVX DPTR指令)时,P2 口送出高8 位地址数据,在访问8 位地址得外部数据存储器(例如执行MOVX RI 指令)时,P2 口线上得内容(也即特殊功能寄存器(SFR)区中R2 寄存器得内容),在整个访问期间不改变。Flash 编程与程序校验时,P2 也接收高位地址与其她控制信号。 ·P3 口:P3 就是一个带有内部上拉电阻得8 位双向I/O 口,P3 得输出缓冲级可驱动(吸收或输出电流)4 个TTL 逻辑门电路。对端口写“1”,通过内部得上拉电阻把端口拉到高电平,此时可作输入口。作为输入口使用时,因为内部存在上拉电阻,某个引脚被外部信号拉低时会输出一个电流(IIL)。P3 口还接收一些用于Flash 闪速存储器编程与程序校验得控制信号。 ·RST:复位输入。当振荡器工作时,RST 引脚出现两个机器周期以上高电平将使单片机复位。 ·ALE/PROG:当访问外部程序存储器或数据存储器时,ALE(地址锁存允许)输出脉冲用于锁存地址得低8 位字节。即使不访问外部存储器,ALE 仍以时钟振荡频率得1/6 输出固定得正脉冲信号,因此它可对外输出时钟或用于定时目得。要注意得就是,每当访问外部数据存储器时将跳过一个ALE 脉冲。对Flash 存储器编程期间,该引脚还用于输入编程脉冲(PROG)。如有必要,可通过对特殊功能寄存器(SFR)区中得8EH 单元D0 位置位,可禁止ALE 操作。该位置位后,只有一条MOVX 与MOVC 指令ALE 才会被激活。此外,该引脚会被微弱拉高,单片机执行外部程序时,应设置ALE 无效。 ·PSEN:程序存储允许输出就是外部程序存储器得读选通型号,当89C51 由外部存储器取指令(或数据)时,每个机器周期两次PSEN 有效,即输出两个脉冲。在此期间,当访问外部数据存储器,这两次有效得PSEN 信号不出现。 ·EA/VPP:外部访问允许。欲使CPU 仅访问外部程序存储器(地址为 0000H—FFFFH),EA 端必须保持低电平(接地)。需注意得就是:如果加密位LB1 被编程,复位时内部会锁存EA 端状态。如EA 端为高电平(接Vcc 端),CPU 则执行内部程序存储器中得指令。Flash 存储器编程时,该引脚加上+12v 得编程允许电源Vpp,当然这必须就是该器件使用12v 编程电压Vpp。 ·XTAL1:振荡器反相放大器及内部时钟发生器得输入端。 ·XTAL2:振荡器反相放大器得输出端。89C51 中有一个用于构成内部振荡器得高增益反相放大器,引脚XTAL1 与XTAL2分别就是该放大器得输入端与输出端。这个放大器与作为反馈元件得片外石英晶体或陶瓷谐振器一起构成自激振荡器,振荡电路参见图5。外接石英晶体或陶瓷谐振器及电容C1、C2 接在放大器得反馈回路中构成并联振荡电路。对电容C1、C2 虽没有十分严格得要求,但电容容量得大小会轻微影响振荡频率得高低、振荡器工作得稳定性、起振得难易程度及温度稳定性,如果使用石英晶体,我们推荐电容使用30Pf±10 Pf,而如使用陶瓷谐振器建议选择40Pf±10Pf。用户也可以采用外部时钟。这种情况下,外部时钟脉冲接到XTAL1 端,即内部时钟发生器得输入端XTAL2 则悬空。 ·掉电模式: 在掉电模式下,振荡器停止工作,进入掉电模式得指令就是最后一条被执行得指令,片内RAM 与特殊功能寄存器得内容在终止掉电模式前被冻结。推出掉电模式得唯一方法就是硬件复位,复位后将重新定义全部特殊功能寄存器但不改变RAM 中得内容,在Vcc 恢复到正常工作电平前,复位应无效,且必须保持一定时间以使振荡器重启动并稳定工作。89C51 得程序存储器阵列就是采用字节写入方式编程得,每次写入一个字符,要对整个芯片得EPROM 程序存储器写入一个非空字节,必须使用片擦除得方法将整个存储器得内容清楚。
展开阅读全文

开通  VIP会员、SVIP会员  优惠大
下载10份以上建议开通VIP会员
下载20份以上建议开通SVIP会员


开通VIP      成为共赢上传

当前位置:首页 > 包罗万象 > 大杂烩

移动网页_全站_页脚广告1

关于我们      便捷服务       自信AI       AI导航        抽奖活动

©2010-2025 宁波自信网络信息技术有限公司  版权所有

客服电话:4009-655-100  投诉/维权电话:18658249818

gongan.png浙公网安备33021202000488号   

icp.png浙ICP备2021020529号-1  |  浙B2-20240490  

关注我们 :微信公众号    抖音    微博    LOFTER 

客服