本站所列毕业设计(论文)资料均属于原创者所有,初衷是为大家在毕业设计(论文)过程中参考和学习交流之用。

毕业设计我帮你

基于微控制器和单片机的设计

www.bysj580.com / 2016-12-03

Microcontroller and microcontroller-based design    
Microcontrollers are used in a multitude of commercial applications such as modems, motor-control 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 high-speed event-based 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 component and at the system level. Intel Platform Engineering department developed an object-oriented multi-threaded test environment for the validation of its AT89C51 automotive microcontrollers. The goals of this environment 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 components, and how to use AT89C51.
1.1 Introduction The 8-bit AT89C51 CHMOS microcontrollers are designed to handle high-speed calculations and fast input/output operations. MCS 51 microcontrollers are typically used for high-speed event control systems. Commercial applications include modems, motor-control systems, printers, photocopiers, air conditioner control systems, disk drives, and medical instruments. The automotive industry use MCS 51 microcontrollers in engine-control 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 on-chip peripheral functions set, such as automotive power-train control, vehicle dynamic suspension, antilock braking, and stability control applications. Because of these critical applications, the market requires a reliable cost-effective 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 critical applications such as an autopilot or anti-lock braking system, mistakes are financially prohibitive. 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 components is extremely expensive, as the devices are typically sealed in modules with a total value several times that of the component. To mitigate these problems, it is essential that comprehensive testing of the controllers be carried out at both the component level and system level under worst case environmental and voltage conditions. This complete and thorough validation necessitates not only a well-defined 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 micro-controllers 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.
Now,this MCU has a very wide field of use,such as smart meters, real-time industrial control,communications equipment,navigation systems,home appliances and so on.
Once the microcontroller were using a variety of products,you can serve to upgrade the effectiveness of the product,often in the product name is preceded by the adjective-smart,such as washing machines and so intelligent.At present,some technical personnel of factories or other amateur electronics developers to engage in out of certain products,not the circuit is too complex,that is,function are too simple and easy to be copied.The reason may be stuck in the product without the use of a microcontroller or other programmable logic device.
SCM basic component is a central processing unit(CPU in the computing device and controller).read-only memory(usually expressed as a ROM),read-write memory(also known as Random Access Memory MRAM is usually expressed as a RAM),input/output port(also divided into parallel port and serial port,expressed as I/O port),and so composed.In fact there is also a clock circuit microcontroller,so that during operation and control of the microcontroller,can rhythmic manner.In addition,there are so-called “break system”,the system is a “janitor”role,when the microcontroller control object parameters that need to be intervention to reach a particular stare,can after this “janitor”communicated to the CPU,so that CPU priorities of the external events to take appropriate counter-measures.
 
1 Electric boiler temperature system
1.MCU
A microcontroller(or MCU)is a computer-on-a-chip.It is a type of micripricessor emphasizing self-sufficiency and cost-effectiveness,in contrast to a general-purpose microprocessor(the kind used in a PC).
The majority of computer systems in use today are embedded in other machinery such as telephones,clocks,appliances,vehicles,and infrastructure.An embedded system usually has minimal requirements for memory and program length and may require simple but unusual input/output systems.For example,most embedded systems lack keyboards,screens,disks,printers,or other recognizable I/O devices of a personal compter.They may control electronic motors,relays or voltages,and read switches,variable resistors or other electronic devices.Often,the only I/O device readable by a human is a single light-emitting diode,and severe cost or power constraints can even eliminate that.
In contast to general-purpose CPUs,microconrtollers do not have an address bus or a data bus,because they integrate all the RAM and non-volatile memory on the same chip as the CPU.Because they need fewer pins,the chip can be placed in a much smaller, cheaper package.
Integrating the memory and other peripherals on a single chip and testing them as a unit increases the cost of that chip,but often results in decreased net cost of the embedded system as a whole.(Even if the cost of a CPU that has integrated peripherals is slightly more than the cost of a CPU+external peripherals,having fewer chips typically allows a smaller and cheaper circuit board,and reduces the labor required to assemble and test the circuit board).This trend leads to design.
A micricintroller is a single integrated circuit, commonly with the following features: cental processing unit-ranging from small and simple 4-bit processors to sophisticated.
32-or 64-bit processors
 
Input/output interfaces such as serial ports(UARTs)
Area Network for system interconnect peripherals such as timers and watchdog RAM tor data storage ROM,EPROM,EEPROM or Flash memory for program storage clock generator-often an oscillator for a quartz timing crustal,resonator or RC circuit many include analog-to-digital converters.
This integration drastically reduces the number of chips and the amount of wiring and PCB space that would be needed to produce equivalent systems using separate chips and have proved to be highly popular in embedded systems since their introduction in the 1970s.
Some mifrocontrollers can afford to use a Harvard architecture:separate memory buses for instructions and data,allowing accesses to take place concurrently.
The decision of which peripheral to integrate is often difficult.The Microcontroller vendors often trade operating frequencies and system design flexibility against time-to-market requirements from their customers and overall lower sustem cost.Manufacturers have to balance the need to minimize the size against additional functionality.
Micricinrtiller architectures are available from many different vendors in so many varieties that each instruction set architecture could rightly belong to a category of their own.Chief a processor core,memory,and programmable input/output peripherals.
Micricinrtiller include an integrated CPU,memory (a small amout of RAM,program memory,or both)and peripherals capable of input and output.
It emphasizes high integration,in contrast to a microprocessor which only contains a CPU(the kind used in a PC).In addition to the usual arithmetic and logic elements such as read-write memory for data storage,read-only memory for program storage,Flash memory for permanent data storage,peripherals,and input/output interfaces.At clock speeds of as little as 32kHz,microcontrollers often operate at very low speed compared to microprocessors,but this is adequate for typical applications.They consume relatively little power(milliwatts or even microwatts),and will generally have the ability to retain functionality whlie waiting for an even such as a button press or interrupt.Power consumption while sleeping(CPU clock and peripherals disabled)may be just nanowatts making them ideal for low power and long lasting battery applications.
 Micricinriollers are used in automatically controlled products and devices,such as automobile engine control systems,remote controls,office machines,appliances,power tools,and toys.By reducing the size,cost,and input/output devices,micricitrollers make it economical to electronically control mary more processes.
The majority of computer systems in use today are embedded in other machinery such as automobiles,telephones,appliances,and peripherals for computer systems.These are called embedded systems.While some embedded systems are very sophisticated,many have minimal have minimal requirements for memory and program length,with no operating system,and low software complexity.Typical input and output decices include switches,relays for data such as temperature,humidity,light level etc.Embedded systems usually have no keyboard,screen,disks,printers,or other recognizable I/O devices of a personal computer,and may lack human interaction deveces of any kind.
It is mandatory that micricintrollers provide real time response to events in the embedded system they are controlling.When certain events occur,an interrupt system can signal the processor to suspend processing the current instruction sequence and to begin an interrupt service routine(ISR).The ISR will perform any processing required based on the source of the interrupt before returning to the original instruction sequence.Possible interrupt sources are device dependent,and often include events such as an internal timer overflow,completing an analog to digital conversion,a logic level change on an input such as from a button being pressed,and data received on a communication link.Where power consumption is important as in battery operated devices,interrupts may also wake a microconroller from a low power sleep state where the processor is halted until required to do something by a peripheral event.
Microcontroller programs must fit in the available on-chip program memory,since it would be costly to provide a system with external,expandable,memory.Compilers and assembly language are used to turn high-level language programs into a compact machine code for storage in the microcontroller`s memory.Depending on the device,the program memory may be permanent,read-only memory that can only be programmed at the factory,or program memory may be field-alterable flash or erasable read-only memory.
Since embedded processors are usually used to control devices,they sometimes need to accept input from the device they are controlling.This is the purpose of the analog to digital converter.Since processors are usually used to control devices,they sometimes need to accept input from the device they are controlling.This is the purpose of the purpose of the analog to digital converter.Since processors are built to interpret and process digital data,i.e.1s and 0s,they won`t be able to do anything with the analog signals that may be being sent to it by a device .So the analog converter is used to converter is used to convert the incoming data into a form that the processor can recognize.There is also a digital to analog converter that allows te processor send data to the device it is controlling.
In addition to the converters,many embedded microprocessors include a variety of timers as well.One of the most common types of timers is the Programmable Interval Timer,or PIT for short.A PIT just counts down from some value to zero.Once it reaches zero,it sends an interrupt to the processor indicating that it has finished counting.This is useful for devices such as thermostats,which periodically test the temperature around them to see if they need to turn the air conditioner on,the heater on,etc.
Time processing Unit or TPU for short.Is essentially just another timer,but more sophisticated.In addition to counting down,the TPU can detect input events,generate output events,and other other useful operations.
Dedicated Pulse width Modulation (PWM)block makes it possible for the CPU to control power converters, resistive loads,motors,etc,without using lost of CPU resources in tight timer loops.
Universal Asynchronous Receiver/Transmitter(UART)block makes it possible to receive and transmit data over a over a serial line with very little load on the CPU.
For those wanting ethernet one can use an external chip like Crystal Semiconductor CS8900A,Realtek RTL8019,or Microchip ENC 28J60.All of allow easy interfacing with low pin count.
 
2 Programming Algorithm
Before programming the AT89C51, the address, data and control signals should be set up according to the Flash programming mode table and Figure 3 and Figure 4. To program the AT89C51, take the following steps.1. Input the desired memory location on the address lines.2. Input the appropriate data byte on the data lines. 3. Activate the correct combination of control signals. 4. Raise EA/VPP to 12V for the high-voltage programming mode. 5. Pulse ALE/PROG once to program a byte in the Flash array or the lock bits. The byte-write cycle is self-timed and typically takes no more than 1.5 ms. Repeat steps 1 through 5, changing the address and data for the entire array or until the end of the object file is reached. Data Polling: The AT89C51 features Data Polling to indicate the end of a write cycle. During a write cycle, an attempted read of the last byte written will result in the complement of the written datum on PO.7. Once the write cycle has been completed, true data are valid on all outputs, and the next cycle may begin. Data Polling may begin any time after a write cycle has been initiated.
    2.1Ready/Busy:  The progress of byte programming can also be monitored by the RDY/BSY output signal. P3.4 is pulled low after ALE goes high during programming to indicate BUSY. P3.4 is pulled high again when programming is done to indicate READY. Program Verify:  If lock bits LB1 and LB2 have not been programmed, the programmed code data can be read back via the address and data lines for verification. The lock bits cannot be verified directly. Verification of the lock bits is achieved by observing that their features are enabled.  2.2 Chip Erase:  The entire Flash array is erased electrically by using the proper combination of control signals and by holding ALE/PROG low for 10 ms. The code array is written with all “1”s. The chip erase operation must be executed before the code memory can be re-programmed. 2.3 Reading the Signature Bytes:  The signature bytes are read by the same procedure as a normal verification of locations 030H, 031H, and 032H, except that P3.6 and P3.7 must be pulled to a logic low. The values returned areas follows : (030H) = 1EH indicates manufactured by Atmel (031H) = 51H indicates 89C51 (032H) = FFH indicates 12V programming (032H) = 05H indicates 5V programming 2.4 Programming Interface Every code byte in the Flash array can be written and the entire array can be erased by using the appropriate combination of control signals. The write operation cycle is self timed and once initiated, will automatically time itself to completion. A microcomputer interface converts information between two forms. Outside the microcomputer the information handled by an electronic system exists as a physical signal, but within the program, it is represented numerically. The function of any interface can be broken down into a number of operations which modify the data in some way, so that the process of conversion between the external and internal forms is carried out in a number of steps. An analog-to-digital converter is used to convert a continuously variable signal to a corresponding digital form which can take any one of a fixed number of possible binary values. If the output of the transducer does not vary continuously, no ADC is necessary. In this case the signal conditioning section must convert the incoming signal to a form which can be connected directly to the next part of the interface, the input/output section of the microcomputer itself. Output interfaces take a similar form, the obvious difference being that here the flow of information is in the opposite direction; it is passed from the program to the outside world. In this case the program may call an output subroutine which supervises the operation of the interface and performs the scaling numbers which may be needed for digital-to-analog converter. This subroutine passes information in turn to an output device which produces a corresponding electrical signal, which could be converted into analog form using a DAC. Finally the signal is conditioned to a form suitable for operating an actuator. The signals used within microcomputer circuits are almost always too small to be connected directly to the outside world” and some kind of interface must be used to translate them to a more appropriate form. The design of section of interface circuits is one of the most important tasks facing the engineer wishing to apply microcomputers. We have seen that in microcomputers information is represented as discrete patterns of bits; this digital form is most useful when the microcomputer is to be connected to equipment which can only be switched on or off, where each bit might represent the state of a switch or actuator. To solve real-world problems, a microcontroller must have more than just a CPU, a program, and a data memory. In addition, it must contain hardware allowing the CPU to access information from the outside world. Once the CPU gathers information and processes the data, it must also be able to effect change on some portion of the outside world. These hardware devices, called peripherals, are the CPU’s window to the outside. The most basic form of peripheral available on microcontrollers is the general purpose I70 port. Each of the I/O pins can be used as either an input or an output. The function of each pin is determined by setting or clearing corresponding bits in a corresponding data direction register during the initialization stage of a program. Each output pin may be driven to either a logic one or a logic zero by using CPU instructions to pin may be viewed (or read.) by the CPU using program instructions. Some type of serial unit is included on microcontrollers to allow the CPU to communicate bit-serially with external devices. Using a bit serial format instead of bit-parallel format requires fewer I/O pins to perform the communication function, which makes it less expensive, but slower. Serial transmissions are performed either synchronously or asynchronously.  
中文翻译:
        基于微控制器和单片机的设计
微控制器被用在众多的商业应用,如调制解调器,电机控制系统,空调控制系统,汽车发动机等等。这些微控制器的高处理速度和增强型外设集,使它们适合这种高速的基于事件的应用程序。然而,这些关键应用领域还要求,这些微控制器是高度可靠的。一个有力的测试流程和适当的工具,这些微控制器在组件和系统级验证环境可以保证高可靠性和低市场风险。英特尔平台工程部门开发的一种面向对象的多线程测试环境AT89C51的汽车微控制器的验证。这种环境下的目标不仅是为AT89C51汽车微控制器提供了一个可靠的测试环境,但可以很容易地扩展和重用的验证其他几个未来的微控制器开发环境。开发环境配合Microsoft基础类(AT89C51)。本文描述的设计和此测试环境中的机制,其与各种硬件/软件环境组件的相互作用,以及如何使用AT89C51。
1.1引言8位单片机AT89C51 CHMOS微控制器设计用于处理高速计算和快速的输入/输出操作。 MCS 51微控制器通常用于高速事件控制系统。商业应用包括调制解调器,电机控制系统,打印机,复印机,空调控制系统,磁盘驱动器,和医疗器械。汽车行业使用MCS 51单片机在发动机控制系统,安全气囊,悬挂系统和防抱死制动系统(ABS)。 AT89C51是特别适合的应用程序从它的处理速度和增强的片上外设功能设置,如汽车动力总成控制,车辆动态悬架,防抱死制动,稳定控制应用的好处。因为这些关键的应用,市场需要一个可靠的低中断延迟响应,服务驱动的集成外设,在实时应用中所需的大量时间和事件的能力,以及高于平均水平的处理能力的CPU有成本效益的控制器一个封装内。设备发生不可预知的财务风险和法律风险是非常高的。一旦在市场上,尤其是在关键任务的应用程序,如自动驾驶仪或防抱死制动系统,错误是财政望而却步。重新设计的成本可能高达$ 500K,更意味着2回注解整个产品系列,共享相同的核心和/或周边的设计缺陷修复。此外,现场更换的部件是极为昂贵的,因为这些设备通常是密封在模块几倍组件,总值。为了解决这些问题,至关重要的是,在最坏的情况下的环境和电压条件下的组件级和系统级进行全面测试控制器。这完全和彻底的验证,必须不仅是一个定义的过程,但也是一个适当的环境和工具,以促进和成功地执行任务。英特尔钱德勒平台工程组提供后的硅系统验证(SV)的各种微控制器和处理器。系统验证过程可分为三个主要部分。不同的设备和它的应用程序的要求确定,在设备上执行的测试类型。
现在,这个MCU具有非常广泛的使用领域,如智能电表,实时工业控制,通讯设备,导航系统,家电等。
一旦微控制器使用的各种产品,可以有助于提升产品功效,往往在产品名称前面的形容词聪明,如洗衣机等intelligent.At的目前,一些工厂的技术人员或其它业余电子开发者从事某些产品,不是电路太复杂,也就是,功能过于简单,容易被copied.The原因可能会卡在产品中不使用一个微控制器或其它可编程逻辑器件。
单片机的基本组成部分是一个中央处理单元(CPU在计算设备和控制器)。只读存储器(通常表示为ROM),读写存储器(也称为随机存取存储器MRAM,通常被表示为一个RAM),输入/输出端口(也分为并口和串口,I / O端口),以及这么composed.In其实还有一个时钟电路,微控制器,所以在操作过程中,微控制器的控制,可以有节奏地进行。此外,所谓的“中断系统”,该系统是一个“看门人”的作用,当单片机控制对象的参数,需要干预,以达到某个特定的盯,这个“看门”后传送到CPU,因此,在CPU的外部事件的优先次序,以采取适当的防范措施。
 
1电锅炉温度系统
MCU
微控制器(MCU)是一个电脑上的一个chip.It是一种类型的micripricessor强调自给自足和成本效益的,相反,一个通用微处理器(在PC上使用的那种)。
当今使用的大多数计算机系统被嵌入在其它机器,例如电话机,钟表,家电,汽车,和infrastructure.An嵌入式系统通常有存储器和程序长度的最低要求,并且可能需要简单,但不寻常的输入/输出systems.For的例如,大多数嵌入式系统缺乏键盘,屏幕,硬盘,打印机,或其他可识别的个人compter.They的I / O设备可以控制电子马达,继电器或电压,读取开关,可变电阻器或其他电子devices.Often,只有I / O装置,人类可读的是一个单一的发光二极管,和严峻的成本或功率的限制,甚至可以消除。
邪教的对比,通用CPU,microconrtollers不具有地址总线或数据总线,因为他们,他们需要更少的引脚作为CPU.Because的在同一芯片上集成所有的RAM和非易失性存储器,该芯片可以被放置在一个更小,更便宜的包。
在单个芯片上集成存储器和其他外围设备,它们作为一个单元进行测试,该芯片的成本增加,但通常会导致减少的嵌入式系统作为一个整体的净成本。(即使集成了外围设备的CPU的成本略多于一个CPU +外部的外围设备的成本,通常允许具有较少的芯片更小,更便宜的电路板,并减少所需的人工组装和测试的电路板),这种趋势导致设计。
àmicricintroller是一个集成电路,通常具有以下特点:百磅处理单元范围小而简单的4位处理器复杂。
32位或64位处理器
 
输入/输出接口,如串行端口器(UART)
区域网络系统互连外围设备如定时器和看门狗RAM器数据存储ROM,EPROM,EEPROM或闪存用于程序存储的时钟发生器往往振荡器,石英计时地壳,谐振器或RC电路很多,包括模拟 - 数字转换器。
这种集成大大减少了芯片的数量,布线和PCB空间的量,将需要产生相同的系统,使用独立的芯片,并已被证明是非常流行的,在嵌入式系统中,因为在20世纪70年代引进。
有些mifrocontrollers能够用得起哈佛结构:单独指令和数据存储器总线,允许访问同时发生。
决定往往是困难。外设集成的微控制器供应商经常交易的工作频率和系统设计的灵活性,从他们的客户对时间的市场需求和整体较低的sustem cost.Manufacturers平衡需要,以尽量减少对额外的大小功能。
Micricinrtiller架构可以从许多不同的供应商,这么多的品种,每个指令集架构可能本来属于他们own.Chief处理器核心,内存,可编程输入/输出外设的一类。
Micricinrtiller包括一个集成CPU,内存(RAM一个小AMOUT的,程序存储器,或两者兼而有之)和外设能够输入和输出。
它强调高集成度,微处理器只包含一个CPU(在PC上使用的那种)相比,除了通常的算术和逻辑元素,如数据存储读写存储器,只读存储器用于存储程序,永久性的数据存储,外设,输入/输出interfaces.At的时钟速度尽量少32KHZ的闪存,微控制器往往以非常低的速度运行的微处理器相比,但这是足够典型applications.They的消耗相对较少的电源(毫瓦,甚至微瓦),一般有能力保留功能whlie,等待一个按下按钮或interrupt.Power的消费甚至如睡觉时(CPU时钟和外设禁用)可能只是使它们成为理想的低功耗和纳瓦长期持久的电池中的应用。
自动控制的产品和设备,如汽车的发动机控制系统,远程控制,办公机器,家电,电动工具,toys.By的尺寸减小,成本,以及输入/输出设备中使用micricinriollers micricitrollers使其经济的电子控制多个进程玛丽。
大部分在今天使用的计算机系统中嵌入其他机械,如汽车,电话,家用电器,计算机及外设systems.These被称为嵌入式systems.While某些嵌入式系统是非常复杂的,有最小的内存最低要求节目长度,不带操作系统,以及低软件complexity.Typical的输入与输出decices,包括开关,继电器,温度,湿度等数据,光照水平etc.Embedded系统通常没有键盘,屏幕,硬盘,打印机,或其他可识别的I / O设备一台个人电脑,并可能缺乏任何形式的人机交互deveces。
它是强制性的micricintrollers提供在嵌入式系统中,他们是controlling.When某些事件发生的事件的实时响应,产生一个中断系统,可对信号处理器暂停处理当前指令序列,并开始一个中断服务例程(ISR)。依赖于设备,通常包括一个内部定时器溢出事件,例如,完成一个模拟到数字的转换,一个逻辑电平的变化,,ISR将执行所需的任何处理之前返回的原始指令sequence.Possible的中断源的基础上的源的中断如从某个按钮被按下时,接收到的数据上通信link.Where的功耗是很重要的,如在电池供电设备的输入,中断也可能唤醒一个microconroller从低功耗的睡眠过程中处理器暂停状态下,直到需要通过外围事件做一些事情。
单片机程序必须适合在可用片上程序存储器,因为这将是昂贵的提供了系统与外部的,可扩展的,memory.Compilers和汇编语言,高级语言程序用于打开成一个紧凑的机器代码存储的memory.Depending设备上的微控制器,程序存储器可能是永久性的,只能在出厂前编程,程序内存可能是现场可变闪存或可擦除只读存储器只读存储器。
由于嵌入式处理器通常用于控制设备时,它们有时需要从他们的移动设备通常用于控制设备controlling.This模拟数字converter.Since处理器的目的是接受输入时,它们有时需要接受输入他们的设备是controlling.This的目的是模拟的目的数字converter.Since处理器内置的数字数据ie1s和0来解释和处理,那倒可以做任何事情的模拟信号可能被发送给它的一个的移动设备,所以模拟的转换器是用来转换器是用来将输入的数据转换成一种形式,该处理器可以的recognize.There也为数字到模拟转换器,允许特处理器将数据发送到其所控制设备。
除了转换器,包括许多嵌入式微处理器的各种定时器作为well.One最常见的类型的定时器是可编程间隔定时器,或PIT PIT short.A倒计时从一些值,zero.Once达到为零,它发送一个中断处理器,表明它已经完成的counting.This是有用的设备,如恒温器,定期测试他们周围的温度,看看他们是否需要开启空调,加热器等
时间处理单元TPU short.Is基本上只是另一个定时器,但除了倒计时sophisticated.In,TPU可以检测输入事件,产生输出事件,以及其他其他有用的操作。
使得它可以为CPU,控制功率转换器,电阻性负载,电机等,在狭小的定时器回路的CPU资源的丢失,而无需使用专用的脉冲宽度调制(PWM)块。
使得它可以接收和发送数据通过串行线用很少的CPU上的负载在一个通用异步接收器/发送器(UART)模块。
对于那些想要以太网之一,可以使用外部芯片一样,瑞昱RTL8019的晶体半导体CS8900A或Microchip ENC 28J60.All便于与低引脚数接口。
 
2编程算法
编程AT89C51之前,应的地址,数据和控制信号,设置根据Flash编程模式表和图3和图4。 AT89C51编程,以下steps.1。输入所需的内存位置的地址株。输入相应的数据字节的数据线。 3。激活控制信号的正确组合。 4。提高EA / VPP到12V的高电压编程模式。 5。脉冲的ALE / PROG一次编程闪存阵列中的一个字节或锁定位。字节写周期是自定时的,通常以不超过1.5毫秒。重复步骤1至5,改变的地址,并达到整个数组或对象文件,直到结束的数据。数据查询:AT89C51的数据查询功能来表示结束写周期。在写周期,企图读取最后写入的字节将导致在书面数据PO.7补。一旦写周期已经完成,真正的数据是有效的所有输出,并开始下一个周期可能。数据轮询可能会开始后的任何时间写周期已经启动。
2.1Ready/Busy:字节编程的进展,也可以监测RDY / BSY输出信号。 P3.4被拉低在ALE变为高后在编程过程中,表示忙。 P3.4被拉高时再编程做是为了表明就绪。程序验证:如果锁定bits LB1和LB2没有被编程,编程代码数据可以被读回验证通过地址线和数据线。锁定位不能直接验证。锁位的验证是通过观察启用了它们各自的特点。 2.2芯片擦除:整个电擦除闪存阵列通过使用适当的组合控制信号,并通过ALE / PROG低10毫秒。与所有的“1”的代码被写入阵列。芯片擦除操作必须执行之前的代码存储器可以被重新编程。 2.3阅读签名字节:签名字节由同一程序读取作为一个正常的核查地点030H,031H,032H,除了P3.6和P3.7必须被拉至逻辑低。返回的值如下:(030H)= 1EH表示由Atmel公司生产的(031H)= 51H表示89C51(032H)= FFH表示12V编程(032H)= 05H表示5V编程2.4编程接口闪存阵列中的每个字节代码可以书面和整个阵列可以通过使用适当的控制信号组合被删除。写操作周期是自定时的,一旦启动,时间本身会自动完成。微机接口两种形式之间的信息转换。室外微计算机处理的信息通过一个电子系统,作为一个物理信号的存在,但在该程序之内,它被表示数值。任何接口的功能可以被分解成的操作数,以某种方式,使修改数据之间的转换的过程中,外部和内部的形式进行了若干步骤。一个analog-to-digital转换器是用来转换到相应的数字的形式,可以采取任何可能的二进制值的一个固定数目的连续可变的信号。如果换能器的输出不连续变化的,没有ADC是必要的。在这种情况下,信号调理部分必须转换输入信号的一种形式,它可以直接连接到下一个部分的接口,输入/输出部分的微型计算机本身。输出接口采取类似的形式,很明显的区别在于,这里的信息流是在相反的方向,它是通过从程序到外部世界。在这种情况下,该程序可能会调用监督操作的界面,并执行缩放可能需要数字 - 模拟转换器的数字输出的子程序。此子程序通过在转的输出装置,其产生相应的电信号,可以使用DAC转换成模拟形式的信息。最后,信号的条件是适用于操作的致动器的一种形式。微机电路内使用的信号几乎总是太小,无法直接连接到外部世界“,并把它们翻译成一个更合适的形式中,必须使用某种接口。边的接口电路的设计工程师希望应用微型计算机所面临的最重要的任务之一。我们已经看到,在微型计算机的信息被表示为离散的位模式,这是数字形式的最有用的是要连接的设备只能开启或关闭,其中每个比特表示的状态的一个开关或当微机致动器。为了解决现实世界的问题,微控制器必须有超过只是一个CPU,程序和数据存储器。此外,它允许在CPU访问来自外部世界的信息必须包含硬件。一旦CPU的信息收集和处理数据,还必须能够对变化对外部世界的某些部分。这些硬件设备的外围设备,是CPU的窗口外面。外周上提供微控制器最基本的形式是通用I70端口。每个I / O引脚可以用作输入或输出。确定每个引脚的功能,通过设置或清除相应的数据方向寄存器中相应的位在一个程序的初始化阶段。通过使用CPU指令到引脚可被视为由CPU使用的程序指令(或读)。每个输出引脚可被驱动为逻辑1或逻辑零。某种类型的串行单元包括微控制器,以便让CPU位与外部设备的串行通信。使用位串行格式,而不是位并行格式,需要更少的I / O引脚进行通讯功能,这使得它更便宜,但速度慢。串行传输进行同步或异步。
 
 
 
收缩