【正文】
For example, most embedded systems lack keyboards, screens, disks, printers, or other recognizable I/O devices of a personal puter. They may control electric 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 lightemitting diode, and severe cost or power constraints can even eliminate that. In contrast to generalpurpose CPUs, microcontrollers do not have an address bus or a data bus, because they integrate all the RAM and nonvolatile 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 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 microcontroller is a single integrated circuit, monly with the following features: central processing unit ranging from small and simple 4bit processors to sophisticated 32 or 64bit processors input/output interfaces such as serial ports (UARTs) other serial munications interfaces like I178。C, Serial Peripheral Interface and Controller Area Network for system interconnect peripherals such as timers and watchdog RAM for data storage ROM, EPROM, EEPROM or Flash memory for program storage clock generator often an oscillator for a quartz timing crystal, resonator or RC circuit many include analogtodigital 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 microcontrollers 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