【正文】
age. Other designs are purpose built for control applications. A microcontroller instruction set usually has many instructions intended for bitwise operations to make control programs more pact.[2] For example, a general purpose processor might require several instructions to test a bit in a register and branch if the bit is set, where a microcontroller could have a single instruction to provide that monlyrequired function.Microcontrollers typically do not have a math coprocessor, so floating point arithmetic is performed by software.[VolumesAbout 55% of all CPUs sold in the world are 8bit microcontrollers and microprocessors. According to Semico, over four billion 8bit microcontrollers were sold in 2006.[3]A typical home in a developed country is likely to have only four generalpurpose microprocessors but around three dozen microcontrollers. A typical midrange 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.Manufacturers have often produced special versions of their microcontrollers in order to help the hardware and software development of the target system. Originally these included EPROM versions that have a window on the top of the device through which program memory can be erased by ultraviolet light, ready for reprogramming after a programming (burn) and test cycle. Since 1998, EPROM versions are rare and have been replaced by EEPROM and flash, which are easier to use (can be erased electronically) and cheaper to manufacture.Other versions may be available where the ROM is accessed as an external device rather than as internal memory, however these are being increasingly rare due to the widespread availability of cheap microcontroller programmers.The use of fieldprogrammable devices on a microcontroller may allow field update of the firmware or permit late factory revisions to products that have been assembled but not yet shipped. Programmable memory also reduces the lead time required for deployment of a new product.Where hundreds of thousands of identical devices are required, using parts programmed at the time of manufacture can be an economical option. These mask programmed parts have the program laid down in the same way as the logic of the chip, at the same time.[]Programming environmentsMicrocontrollers were originally programmed only in assembly language, but various highlevel programming languages are now also in mon use to target microcontrollers. These languages are either designed specially for the purpose, or versions of general purpose languages such as the C programming language. Compilers for general purpose languages will typically have some restrictions as well as enhancements to better support the unique characteristics of microcontrollers. Some microcontrollers have environments to aid developing certain types of applications. Microcontroller vendors often make tools freely available to make it easier to adopt their hardware.Many microcontrollers are so quirky that they effectively require their own nonstandard dialects of C, such as SDCC for the 8051, which prevent using standard tools (such as code libraries or static analysis tools) even for code unrelated to hardware features. Interpreters are often used to hide such low level quirks.Interpreter firmware is also available for some microcontrollers. For example, BASIC on the early microcontrollers Intel 8052。[4] BASIC and FORTH on the Zilog Z8[5] as well as some modern devices. Typically these interpreters support interactive programming.Simulators are available for some microcontrollers, such as in Microchip39。s MPLAB environment and the Revolution Education PICAXE range. These allow a developer to analyze what the behavior of the microcontroller and their program should be if they were using the actual part. A simulator will show the internal processor state and also that of the outputs, as well as allowing input signals to be generated. While on the one hand most simulators will be limited from being unable to simulate much other hardware in a system, they can exercise conditions that may otherwise be hard to reproduce at will in the physical implementation, and can be the quickest way to debug and analyze problems.Recent microcontrollers are often integrated with onchip debug circuitry that when accessed by an incircuit emulator via JTAG, allow debugging of the firmware with a debugger.第 11 頁 (共 11 頁)