【正文】
r as is done in the case of a microprocessor system since RAM and registers are not usually physically separated in a microputer. Central processing unit (CPU) The CPU is much like that of any microprocessor. Many applications of microputers and microcontrollers involve the handling of binarycoded decimal (BCD) data (for numerical displays, for example) ,hence it is mon to find that the CPU is well adapted to handling this type of data .It is also mon to find good facilities for testing, setting and resetting individual bits of memory or I/O since many controller applications involve the turning on and off of single output lines or the reading the single line. These lines are readily interfaced to twostate devices such as switches, thermostats, solidstate relays, valves, motor, etc. Parallel input/output Parallel input and output schemes vary somewhat in different microputer。 in most a mechanism is provided to at least allow some flexibility of choosing which pins are outputs and which are inputs. This may apply to all or some of the ports. Some I/O lines are suitable for direct interfacing to, for example, fluorescent displays, or can provide sufficient current to make interfacing other ponents straightforward. Some devices allow an I/O port to be configured as a system bus to allow offchip memory and I/O expansion. This facility is potentially useful as a product range develops, since successive enhancements may bee too big for onchip memory and it is undesirable not to build on the existing software base. Serial input/output Serial munication with terminal devices is mon means of providing a link using a small number of lines. This sort of munication can also be exploited for interfacing special function chips or linking several microputers together .Both the mon asynchronous synchronous munication schemes require protocols that provide framing (start and stop) information .This can be implemented as a hardware facility or U(S) ART (Universal (synchronous) asynchronous receiver/transmitter) relieving the processor (and the applications programmer) of this lowlevel, timeconsuming, detail. t is merely necessary to selected a baudrate and possibly other options (number of stop bits, parity, etc.) and load (or read from) the serial transmitter (or receiver) buffer. Serialization of the data in the appropriate format is then handled by the hardware circuit. Timing/counter facilities Many application of singlechip microputers require accurate evaluation of elapsed real time .This can be determined by careful assessment of the execution time of each branch in a program but this rapidly bees inefficient for all but simplest programs .The preferred approach is to use timer circuit that can independently count precise time increments and generate an interrupt after a preset time has elapsed .This type of timer is usually arranged to be reloadable with the required count .The timer then decrements this value producing an interrupt or setting a flag when the counter reaches zero. Better timers then have the ability to automatically reload the initial count value. This relieves the programmer of the responsibility of reloading the counter and assessing elapsed time before the timer restarted ,which otherwise wound be necessary if continuous precisely timed interrupts were required (as in a clock ,for example).Sometimes associa