《基于STC89C52单片机的太阳能智能充电系统外文翻译.doc》由会员分享,可在线阅读,更多相关《基于STC89C52单片机的太阳能智能充电系统外文翻译.doc(13页珍藏版)》请在三一办公上搜索。
1、毕业论文(设计)文献翻译本翻译源自于:维基百科 http:/en.wikipedia.org/wiki/Microcontroller 毕业设计名称:基于STC89C52单片机的太阳能智能充电系统 外文翻译名称: 学 生 姓 名 : 院 (系): 专 业 班 级 : 指 导 教 师 : 辅 导 教 师 : 时 间 : 至 微控制器英特尔8742的核心, 片上集成12 MHz的CPU, 128字节的RAM, 2048字节EPROM, 以及I/O设备。微控制器,也称单片机(有时缩写为C,UC或MCU)是一种在单个集成电路上包含一个控制器核心,内存和可编程输入/输出外设的小型计算机。类型为NOR F
2、lash或OTP ROM的存储器也往往包括在芯片上,以及通常少量的RAM。微控制器(MCU)是专为嵌入式应用,而相比之下,个人电脑或其他一般用途的应用中使用微控制器(CPU)。 微控制器用于自动控制产品和设备,如汽车发动机控制系统,植入式医疗设备,遥控器,办公设备,家用电器,电动工具,玩具。比起使用一个单独的微控制器,内存和输入/输出设备,微控制器通过降低尺寸和成本来更经济地数控更多的设备和流程。混合信号微控制器是很常见的,整合了需要控制非数字电子系统的模拟组件。 有些微控制器可使用四位字长,操作频率的时钟速率低至4 kHz来实现低功耗(毫瓦或微瓦)。他们通常在等待一个事件,如按一个按钮或其它
3、中断时进入节能状态,处于节能状态(CPU时钟和大部分的外设关闭)时功耗可能只有纳瓦级别,使得他们很适合用电池供电长期工作。其他微控制器,像数字信号控制器(DSP),可能需要注重性能,他们有更大的计算量,更高的时钟速度和更大的功耗。历史在1971年第一款单片机4位英特尔4004被发布, 在随后的数年时间里英特尔8008和其它功能更为强大微控制器也开始出现。然而,控制器需要外部芯片来实现某工作方式,这就提高了整个系统的成本,使它不能成为经济的电子器件。史密森尼学会表示Gary Boone 和 Michael Cochran工程师在1971年成功地创造了第一款单片机。他们的研究成果TMS 1000在
4、1974年就已经商业化。它在一块芯片中集合了只读存储器、读/写内存、控制器和时钟芯片,是在嵌入式系统中使用。部分原因是出于对单芯片TMS1000的考虑,英特尔公司开发了一种基于优化控制芯片应用的计算机系统, 在1977年英特尔8048的商业化有部分开始运营了部。英特尔8048将只读存储器和随机存储器组合在一块芯片上。该芯片将会在超过十亿个计算机键盘和其它许多应用上找到用武之地。在那时,英特尔公司董事长Luke JValenter声称在公司历史上微控制器是最为成功的,且它使部门的预算超过了25%。在这个时候大多数微控制器有两个变体。有一个可擦除可编程只读存储器的程序存储器,这明显比只能编程一次的
5、可编程只读存储器更加昂贵。可擦除可编程只读存储器的擦除需要通过一个透明石英的盖子暴露于紫外线光。一次性部分可以在低成本的不透明的塑料包装中制作。在1993年, 电可擦可编程只读存储器的引入使微控制器 (从芯片PIC16x84开始)能快速地实现电擦,而不必像可擦除可编程只读存储器一样需要昂贵的包装,且允许在系统编程中快速成型。同年, Atmel公司首次推出使用闪速存储器的单片机,其它公司迅速跟进,推出具有同样存储类型的单片机。随着时间的推移,微控制器成本急剧下降,在2009年,最便宜的8位微控制器只需花费不到0.25美金就可以大量获得,且类似的数量的一些32位微控制器也只需1美元左右就可以获得。
6、如今微控制器很便宜,这使得爱好者更容易获得,且针对某些控制器有许多的网上论坛。在不久的将来, 非挥发性的磁性随机存储器因其具有很长的耐久力和半导体晶片工艺成本较低的特点,很可能被用于微控制器中。容量在世界上销售cpu中大约有55%属于8位微控制器和微控制器。根据Semico所述, 2006年8位微控制器销量超过四十亿。在发达国家有些家可能只有四个通用微控制器,但确拥有大约三打微控制器。一辆典型的中档汽车有多达30或更多的微控制器。它们也可以在诸如洗衣机、微波炉和电话等许多电气设备上找到。嵌入式设计微控制器可以被认为是自包含的控制器、内存和外围设备,可作为嵌入式系统中使用。今天的多数微控制器嵌入
7、在其他设备里,如汽车,电话,家用电器,计算机外设。这些被称为嵌入式系统。一些嵌入式系统非常复杂,而很多对内存大小和程序长度有很低的要求,他们没有操作系统,软件的复杂性很低。典型的输入和输出设备包括开关,继电器,螺线管,LED灯,小型或定制液晶显示器,射频器件,传感器(如温度,湿度,光照强度等)。嵌入式系统通常没有键盘,屏幕,硬盘,打印机或其他电脑上用的I / O设备,可能缺乏任何形式的人机交互设备。中断微控制器必须对它所控制的嵌入式设备发生的事件提供实时(可预测的,虽然不一定快)的响应。当某些事件发生时,中断系统可以命令控制器暂停处理当前指令序列,并开始中断服务例程(ISR,或“中断处理程序”
8、)。ISR将根据中断源执行响应的程序,然后再返回原来的指令序列。可能的中断源是依赖设备的,通常包括一些事件如内部定时器溢出,完成模数转换,逻辑电平变化,一个按钮被按下等,数据会从通信链路接受。在注重功耗的设备(如使用电池供电)中,中断也可能用来唤醒处于低功耗休眠状态的微控制器。程序单片机程序必须符合现有的片上程序存储器,因为一个有外部可扩展存储器的系统是很贵的。编译器和汇编器用来将高级语言和汇编语言代码转换成一个紧凑的机器代码来保存到微控制器的存储器中。取决于不同的设备,存储器可能是永久性的只读存储器,只能在工厂里编程,或是Flash或可擦写ROM中。其他微控制器的功能微控制器通常包含几个到几
9、十个通用输入/输出引脚(GPIO的)。GPIO引脚可通过软件配置为输入或输出状态。当GPIO引脚配置为输入状态,他们往往是用来读取传感器或外部信号。配置为输出状态,GPIO引脚可以驱动LED或马达等外部设备。许多嵌入式系统需要读取传感器产生的模拟信号。这是使用模数转换器(ADC)的目的。由于控制器在建造时,解释和处理数字数据,即1和0,他们是无法处理一个设备发送给它的任何模拟信号的。因此,模数转换器用来将传入的数据转换成控制器可以识别的一种形式。微控制器一个不常见的功能,是数模转换器(DAC),允许控制器输出模拟信号或电压等级。除了转换器,许多嵌入式微控制器还包括多种定时器。对定时器的最常见的
10、类型是可编程间隔定时器(PIT)。无论是从一个值倒数至零,或增加计数寄存器的值,溢出到零。一旦它到达零,它发送一个表明它已经完成计数的中断到控制器。这对于恒温器等设备是非常有用的:它定期测试周围的温度,判断这时是否需要开启空调的、加热器等设备。实时处理单元(TPU)是一个复杂的计时器。除了倒计时,TPU可检测输入事件,产生输出事件,并执行其他有用的操作。一个专用的脉宽调制(PWM)模块使得CPU可以控制电源转换器,阻性负载,电机等,而不需要在计时循环上浪费大量的CPU资源。通用异步接收器/发送器(UART)的模块使我们能够在一个非常低的CPU负载的情况下通过串行线收发数据。专用片上硬件还常常包
11、括与其他设备数字通信的能力,如I2C和串行外设接口(SPI)。更高的集成度相对于通用CPU,微控制器可能无法像CPU一样在同一个芯片上集成外部地址或数据总线,RAM和非易失性内存。由于使用更少的引脚,该芯片可以被放置在一个更小,更便宜的封装里。在单个芯片上集成了内存和其他外围设备并把它们作为一个单元来测试增加了该芯片的成本,但结果往往是降低整个嵌入式系统的净成本。虽然一个已经集成外设的芯片通常成本略高于一个CPU和外围设备芯片,但是可以制作芯片更少,成本更小,更便宜的电路板,并减少所需的组装和测试的电路板的劳动。一个微控制器是一个集成电路,通常具有以下特点: 中央处理器单元,包括小型和简单的4
12、位处理器到复杂的32或64位处理器 易失性存储器(RAM)为数据存储 ROM,EPROM中,EEPROM或闪存用于存储程序和操作参数 离散输入和输出位,允许控制或检测每个封装引脚的逻辑状态 串行输入/输出,如串行端口器(UART) 其他串行通讯接口,如IC,串行外围接口和控制器区域网络互联定时器,计数器,PWM发生器和看门狗等外设时钟发生器,往往是一个石英振荡器计时晶体谐振器或RC电路许多包括模拟到数字转换器,一些包括数字至模拟转换器在线编程和调试支持这种集成大大降低了芯片的数量和电路板布线和空间,可以使用单独的芯片生产等效系统。此外,在低引脚数的器件,每个引脚可用作几个内部外设接口,由软件选
13、择的引脚功能。这使得这样的一个部件比每个引脚专用功能的芯片应用更广泛。微控制器已被证明自从1970年问世以来在嵌入式系统中高度流行。有些微控制器采用哈佛结构:指令和数据分开存储总线,从而采取同时进行访问。凡采用哈佛架构,控制器字长可能和内部存储器和寄存器位长度不同,例如:用8位数据寄存器使用了12位指令。周边设备的整合往往难以决定。微控制器供应商通常灵活地设计产品来适应不同时期的市场需求,使得系统整体成本较低。制造商必须平衡的需要,尽量减少芯片尺寸而不是增加更多功能。微控制器架构有很大的不同。有些设计包括通用微控制器与一个或多个ROM,RAM,或集成I/ O功能内核到封装内。其他设计构建目的是
14、控制应用程序。一个微控制器的指令集通常有很多逐位运算的指令旨在使控制程序更紧凑。例如,通用控制器可能需要几个指令,以测试在一个寄存器位的值来判断分支,而微控制器可以用一个单一的指令来实现这个常用的功能。微控制器通常没有一个数学协控制器,因此,浮点运算是由软件处理。影响据2006共售出超过四十亿的8位微控制器Semico公司称,世界上销售的所有CPU中约55%是8位微控制器和微控制器。一个典型的发达国家家庭很可能只有四个通用微控制器,却有约三十几个微控制器。一个典型的中档汽车已多达30个或更多的微控制器。他们还可以在很多电器设备中找到,如洗衣机,微波炉和电话。制造商们通常生产微控制器的特殊版本,
15、以帮助目标系统的硬件和软件开发。起初这些措施包括EPROM的顶部有一个“窗口”,可以通过紫外线擦除它的程序存储器,以便重新编程(“烧写”)和测试周期。自1998年以来,EPROM的版本变得罕见,并已被EEPROM和FLASH这些容易使用(可以电擦除)和更便宜的设备所取代。其他版本可能出现在ROM作为外部设备,而不是内部记忆体的场合,但是因为廉价微控制器编程器的广泛使用,这种情况越来越少了。单片机的现场可编程器件的使用可能允许现场更新固件或升级工厂已经组装的,但尚未交付的产品的版本。可编程存储器也减少了新产品的部署所需的时间。由于有无数同型号设备的需求,利用在制造时编程的部件是一个经济的选择。这
16、些“掩模编程” 的部件有相同的逻辑程序。编程环境微控制器最初只用汇编语言编程,但目前各种高级编程语言普遍使用在目标微控制器上。这些语言或者专门为某一用途设计,或是通用语言版本,如C编程语言。通用语言的编译器通常会有一些限制,以及增强,更好地支持微控制器的独特性。有些微控制器有帮助开发某些类型的应用程序的环境。微控制器供应商通常免费提供工具给开发者,使其更容易地操作他们的硬件。许多微控制器是如此奇特,它们有效地要求自己非标准的C,如8051的 SDCC,它阻止使用标准的工具(如代码库或静态分析工具)防止代码和硬件功能不相关。解释程序常用来隐藏这种低层次的错误。解释程序固件也可用于一些微控制器。例
17、如,BASIC用于早期的英特尔8052微控制器; BASIC和FORTH用于Zilog Z8。通常这些解释程序交互编程。模拟器可用于如Microchip的MPLAB环境和Revolution Education PICAXE的有些微控制器。这允许开发人员分析如果他们用的是真实的器件,微控制器的行为和程序应该是什么样的。一个模拟器将显示控制器内部状态和输出,以及允许输入信号的产生。虽然一方面大多数模拟器无法在一个系统中模拟许多其他的硬件,但他们可以模拟难以再现的物理实现条件,可以最快的方式进行调试和分析问题。最近的微控制器往往集成了片上调试电路,当由JTAG访问内电路仿真器时,允许用调试器调试固
18、件。MicrocontrollerThe die from an Intel 8742, an 8-bit microcontroller that includes a CPU running at 12 MHz, 128 bytes of RAM, 2048 bytes of EPROM, and I/O in the same chip.A microcontroller (sometimes abbreviated C, uC or MCU) is a small computer on a single integrated circuit containing a processo
19、r core, memory, and programmable input/output peripherals. Program memory in the form of NOR flash or OTP ROM is also often included on chip, as well as a typically small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal compu
20、ters or other general purpose applications.Microcontrollers are used in automatically controlled products and devices, such as automobile engine control systems, implantable medical devices, remote controls, office machines, appliances, power tools, and toys. By reducing the size and cost compared t
21、o a design that uses a separate microprocessor, memory, and input/output devices, microcontrollers make it economical to digitally control even more devices and processes. Mixed signal microcontrollers are common, integrating analog components needed to control non-digital electronic systems.Some mi
22、crocontrollers may use Four-bit words and operate at clock rate frequencies as low as 4 kHz, for low power consumption (milliwatts or microwatts). They will generally have the ability to retain functionality while waiting for an event such as a button press or other interrupt; power consumption whil
23、e sleeping (CPU clock and most peripherals off) may be just nanowatts, making many of them well suited for long lasting battery applications. Other microcontrollers may serve performance-critical roles, where they may need to act more like a digital signal processor (DSP), with higher clock speeds a
24、nd power consumption.HistoryThe first single-chip microprocessor was the 4-bit Intel 4004 released in 1971, with the Intel 8008 and other more capable microprocessors becoming available over the next several years. However, both processors required external chips to implement a working system, raisi
25、ng total system cost, and making it impossible to economically computerize appliances.The Smithsonian Institution says TI engineers Gary Boone and Michael Cochran succeeded in creating the first microcontroller in 1971. The result of their work was the TMS 1000, which went commercial in 1974. It com
26、bined read-only memory, read/write memory, processor and clock on one chip and was targeted at embedded systems.Partly in response to the existence of the single-chip TMS 1000, Intel developed a computer system on a chip optimized for control applications, the Intel 8048, with commercial parts first
27、 shipping in 1977. It combined RAM and ROM on the same chip. This chip would find its way into over one billion PC keyboards, and other numerous applications. At that time Intels President, Luke J. Valenter, stated that the microcontroller was one of the most successful in the companys history, and
28、expanded the divisions budget over 25%.Most microcontrollers at this time had two variants. One had an erasable EPROM program memory, which was significantly more expensive than the PROM variant which was only programmable once. Erasing the EPROM required exposure to ultraviolet light through a tran
29、sparent quartz lid. One-time parts could be made in lower-cost opaque plastic packages.In 1993, the introduction of EEPROM memory allowed microcontrollers (beginning with the Microchip PIC16x84) to be electrically erased quickly without an expensive package as required for EPROM, allowing both rapid
30、 prototyping, and In System Programming. The same year, Atmel introduced the first microcontroller using Flash memory. Other companies rapidly followed suit, with both memory types.Cost has plummeted over time, with the cheapest 8-bit microcontrollers being available for under $0.25 in quantity (tho
31、usands) in 2009, and some 32-bit microcontrollers around $1 for similar quantities.Nowadays microcontrollers are cheap and readily available for hobbyists, with large online communities around certain processors.In the future, MRAM could potentially be used in microcontrollers as it has infinite end
32、urance and its incremental semiconductor wafer process cost is relatively low.VolumesAbout 55% of all CPUs sold in the world are 8-bit microcontrollers and microprocessors. According to Semico, over four billion 8-bit microcontrollers were sold in 2006.A typical home in a developed country is likely
33、 to have only four general-purpose microprocessors but around three dozen microcontrollers. A typical mid-range automobile has as many as 30 or more microcontrollers. They can also be found in many electrical devices such as washing machines, microwave ovens, and telephones.Embedded designA microcon
34、troller can be considered a self-contained system with a processor, memory and peripherals and can be used as an embedded system.1 The majority of microcontrollers in use today are embedded in other machinery, such as automobiles, telephones, appliances, and peripherals for computer systems. These a
35、re called embedded systems. While some embedded systems are very sophisticated, many have minimal requirements for memory and program length, with no operating system, and low software complexity. Typical input and output devices include switches, relays, solenoids, LEDs, small or custom LCD display
36、s, radio frequency devices, and sensors 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 devices of any kind.InterruptsMicrocontrollers
37、 must provide real time (predictable, though not necessarily fast) 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
38、(ISR, or interrupt handler). 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
39、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 microcontroller from a low power sleep state where the processor is hal
40、ted until required to do something by a peripheral event.ProgramsMicrocontroller 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 assemblers are used to convert high-level language and assembler l
41、anguage codes into a compact machine code for storage in the microcontrollers 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.Other microcont
42、roller featuresMicrocontrollers usually contain from several to dozens of general purpose input/output pins (GPIO). GPIO pins are software configurable to either an input or an output state. When GPIO pins are configured to an input state, they are often used to read sensors or external signals. Con
43、figured to the output state, GPIO pins can drive external devices such as LEDs or motors.Many embedded systems need to read sensors that produce analog signals. This is the purpose of the analog-to-digital converter (ADC). Since processors are built to interpret and process digital data, i.e. 1s and
44、 0s, they are not able to do anything with the analog signals that may be sent to it by a device. So the analog to digital converter is used to convert the incoming data into a form that the processor can recognize. A less common feature on some microcontrollers is a digital-to-analog converter (DAC
45、) that allows the processor to output analog signals or voltage levels.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 (PIT). A PIT may either count down from some value to zer
46、o, or up to the capacity of the count register, overflowing 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
47、the air conditioner on, the heater on, etc.Time Processing Unit (TPU) is a sophisticated timer. In addition to counting down, the TPU can detect input events, generate output events, and perform other useful operations.A dedicated Pulse Width Modulation (PWM) block makes it possible for the CPU to c
48、ontrol power converters, resistive loads, motors, etc., without using lots of CPU resources in tight timer loops.Universal Asynchronous Receiver/Transmitter (UART) block makes it possible to receive and transmit data over a serial line with very little load on the CPU. Dedicated on-chip hardware also often includes capabiliti